rosmed / slicer_ros2_module

Slicer module that can interface directly with ROS 2 using ROS parameters, topics, tf...
MIT License
23 stars 4 forks source link

source install/setup.bash not working #1

Open javiermoviglia opened 2 years ago

javiermoviglia commented 2 years ago

Hello,

I have followed your instructions to connect Slicer with ROS but for some reason when doing source install/setup.bash in the workspace where slicer_ros2_module is located I get the following error:

not found: "/home/javier/ros2_ws/install/slicer_ros2_module/share/slicer_ros2_module/local_setup.bash"

I have tried it with ROS2 galactic and foxy but still get the same error. I suspect that the problem is in the CMakelist.txt file but maybe you have solved it in another way.

Useful information:

package.bash package.dsv package.ps1 package.sh package.zsh

Thank you in advance for the help.

Best regards, Javier

javiermoviglia commented 2 years ago

I forgot to mention, that the Ros2 module can be loaded in Slicer despite the previous error, but the robot cannot be displayed.

Configuration

Debug

adeguet1 commented 2 years ago

Regarding the script local_setup.bash not being found, I've noticed this on my end but I don't think it will cause any issues. Regarding the robot not being displayed, the current code only support geometries based on CAD files using either STL or OBJ (formats supported in Slicer). I looked at the URDF file for the R2D2 robot you're using and it's not using meshes for the visual. Excerpt:

    <visual>
      <origin xyz="0 0 0" rpy="1.57 0 0" />
      <geometry>
        <cylinder radius="0.01" length=".5" />
      </geometry>
      <material name="gray">
        <color rgba=".2 .2 .2 1" />
      </material>
    </visual>

We used two different robots for our testing, Phantom Omni and dVRK PSM. I will try to update the README ASAP to show how to use these with the SlicerROS2 module.

javiermoviglia commented 2 years ago

Thanks for the quick reply. I have just tested it with the dVRK PSM Robot from your repository but I still haven't been able to diplay this one in Slicer. An update of the README would be very helpful.

adeguet1 commented 2 years ago

I updated the README and added some links to the Phantom Omni models. Let us know if the new instructions help. For the dVRK PSM, I need to update the ROS dVRK launch files first. I will then test with the Slicer ROS 2 module before updating the dVRK section in the README.

javiermoviglia commented 2 years ago

it works now! (at least in ROS galactic) The trick was just hit enter on /robot_state_publisher. Maybe it's obvious but you could add in the section "Using the Slicer ROS 2 module" that first you have to do "source /opt/ros/galactic/setup.bash" in the Slicer terminal. Thanks for the help!

javiermoviglia commented 2 years ago

I just tried it quickly on foxy with this robot https://github.com/olmerg/lesson_urdf and it works too. 👍