The project consist of two parts:
- 3D Slicer ROS Module, and
- AMBF simulation plugin of a robot for 3D Slicer.
The 3D Slicer ROS Module handles the information and communication via ROS. The AMBF simulator Plugin is capable of publishing robot states and robot visualization materials to ROS for the 3D Slicer Module to accquire.
Clone and build AMBF2.0
git clone https://github.com/WPI-AIM/ambf.git
cd ambf
git checkout -b ambf-2.0 origin/ambf-2.0
git pull
Build and source ambf (make sure you're on branch ambf-2.0 before building) as per the instructions on AMBFs wiki
See build instructions Here
git clone https://github.com/LCSR-CIIS/Slicer_ROS_Extension.git
cd 3D-Slicer_ROS_Module_with_AMBF
mkdir Slicer_ROS_Extension-debug
cmake -DCMAKE_BUILD_TYPE:STRING=Debug -DSlicer_DIR:PATH=/path/to/Slicer-SuperBuild-Debug/Slicer-build ../Slicer_ROS_Extension
make
cd ../
cd AMBF_Plugin_3DSlicer
mkdir build
cd build
cmake ..
make
If no error is shown, the the installation is done.
In order for the 3D Slicer ROS Extension and AMBF to work, roscore
needs to be running.
roscore
cd <path-to-ambf>/bin/lin-x86_64
./ambf_simulator --launch_file <path-to-3d-slicer-ros-module-with-ambf>/AMBF_Plugin_3DSlicer/ADF/launch.yaml -l 0,2
Note that the parameter in the last line -l 0,2
means to launch the simulation world with item 0 and item 2. Items are defined in the launch.yaml
file. In this case, 0 is the surgical robot system and 2 is a skull model.
If successful, you should be able to see the AMBF simulation window pop up with a Surgical Robot and a Skull model.
Navigate back to the project directory
cd Slicer_ROS_Extension-debug
./SlicerWithSlicerROSExtension
After the 3D Slicer is launch, click on the drop down manual, select Examples -> ROS1_Module. In the AMBF simulator, press P to enable Pick tool. You can drag items around by using mouse. You should now see the scene is now in sync with the AMBF simulator.