ROS 2 Support

98 views
Skip to first unread message

Siyuan Yu

unread,
Sep 4, 2024, 8:30:34 PM9/4/24
to ProjectChrono
Hi colleagues,

Thanks for providing such an amazing software. I was working on using the ROS2 support from project chrono. I have enabled the Chrono::ROS when building it but when I included in the CMakelists for the template project, it asks for the ROS2_DIR and it is looking for  ROS2Config.cmake / ros2-config.cmake. However, I can not find those two files in my ros folder (I am currently using humble now). I'd be really grateful if there are any suggestions.

Thank you in advance,
Siyuan


Bret Witt, Jr

unread,
Sep 5, 2024, 12:48:41 PM9/5/24
to ProjectChrono
Hi Siyuan,

I've encountered this error before, I believe the issue was that my ROS2 environment wasn't sourced. Could you confirm if this is the case? You may have to clear your CMake cache first, then source.

Best,
Bret
Message has been deleted

Siyuan Yu

unread,
Sep 5, 2024, 1:12:36 PM9/5/24
to ProjectChrono
Hi Bret,

Thanks for the reply. Yes, I have sourced my ROS2 environment in my bashrc. And I just cleared my CMake cache and then sourced it again. The issue still happens. 

Just to make sure I did the right thing, I did source /opt/ros/humble/setup.bash.

Thank you!
Siyuan

Bret Witt, Jr

unread,
Sep 5, 2024, 2:06:36 PM9/5/24
to ProjectChrono
Hi Siyuan,

That's tricky. Just to make sure, did you double check that Chrono::ROS successfully configured before building Chrono? I'm not sure if it blocks the CMake config/gen process if it doesn't configure correctly, it'll only warn you. If it warns you about ROS2 not being found, you'll of course have to source and rebuild. Other than that I'll have to experiment on my home workstation later to see if I can reproduce the issue

Best,
Bret

Siyuan Yu

unread,
Sep 5, 2024, 2:16:09 PM9/5/24
to ProjectChrono
HI Bret,

That could be one possible cause. I am sure that I have sourced the ROS2 environment but I do not notice if there is any warning (there is definitely no error). Can you please instruct me how to check that?  I do not know if it is relevant but I can not find any ROS related demos in my bin folder.

Thank you for your help!
Siyuan

Bret Witt, Jr

unread,
Sep 5, 2024, 3:04:58 PM9/5/24
to ProjectChrono
Hi Siyuan,

Could you attach the full output provided by CMake? Does it say that it found ROS2? Also, this is not a requirement but are you building with chrono_ros_interfaces (i.e you sourced the chrono_ros_interface project)? I'll experiment tonight and try to get back to you.

Best,
Bret
Reply all
Reply to author
Forward
0 new messages