Chrono_ROS error while running demo_ROS_custom_handler

140 views
Skip to first unread message

Madhava Pandiyan

unread,
Nov 25, 2024, 4:43:32 AM11/25/24
to ProjectChrono
Hallo all,

I am trying to run Chrono_ROS. While building the file demo_ROS_custom_handler.cpp, I am getting an error. I have attached that file along with the CMake file and error message. It seems to be related to rclcpp and Qos. Could you help me resolve this issue? Thank you in advance.

Regards,
Madhava Pandiyan
demo_ROS_custom_handler.cpp
CMakeLists.txt
ros_chrono_error_screenshot.png

Harry ZHANG

unread,
Nov 27, 2024, 8:42:02 AM11/27/24
to ProjectChrono
While we are trying to fix this issue, I just found out I forgot to make the debugging message public available in the user forum. Right now Madhava could fix the issue and run the demo, and the following is the debugging log that might be helpful for people have similar issues.

--------------------------------------------------------------------------------------------------------
Hello Madhava,

So, I think the issue you have is using/building Chrono::ROS as an external project . I have some suggesions that you can try.

1. Can you build and run Chrono::ROS related demos in the chrono/src/demos/ros/ folder? This is a good test of building and configuring Chrono::ROS module.

2. If you can run 1. fine, then we could narrow down the issue with external configuration of Chrono::ROS. We did something similar couple of places before. You can check: 1): https://github.com/uwsbel/autonomy-research-testbed/blob/master/sim/cpp/CMakeLists.txt or 2):  the file (CMakeList.txt) I attached here to see if using similar cmakelist could solve your problem or not.

3. If 1 or 2 didn't solve the problem, then are you willing to try ROS2 humble version? Because all the code we tested for Chrono::ROS module is based on ROS2 humble version. Although I don't think there are too much change between galactic and humble as they're all ros2 version, it might be good to check

Best,
Harry

--------------------------------------------------------------------------------------------------------
Hello Harry,

1) While building Chrono itself, the demos are built without error. So the first step is success.

2) I used the CMake file that you have sent me. This resolved the issue I got. But it also required two more changes. Namely enabling the parser module with proper directory setup and adding the path of the parser lib directory to LD_LIBRARY_PATH. By doing so the problem has been resolved and the demo file seems to be working fine (check CMakeLists_worked.txt and demo_ROS_custom_handler.cpp). I am also planning to add the LD path to bashrc so it will be reflected in all terminals.

3) Also I forgot to mention in my previous email. I also got the same type of error with ROS2 Humble. So this solution will also resolve the issue with Humble I think.

The issue with ROS seems to be resolved now. So thanks for the detailed instructions.  I have also attached the new CMake file and the output of the demo file so it may help others. Once again thank you for helping me resolve this issue.

Kind regards,
Madhava Pandiyan

CMakeLists_worked.txt
worked_demo.png
demo_ROS_custom_handler.cpp
CMakeLists.txt

Radu Serban

unread,
Nov 29, 2024, 7:56:30 AM11/29/24
to ProjectChrono

I believe certain issues related to using Chrono::ROS in external projects are also due to an incomplete set up of this module in the Chrono project configuration file.

Harry – I will provide you with an updated configuration template file. If you could test that and confirm that it addresses the issues raised by Madhava I will push it to the main Chrono branch.

--Radu

--
You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to projectchron...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/projectchrono/002309e7-74ff-4572-a719-39079c3734a5n%40googlegroups.com.

Giri Mugundan

unread,
Dec 26, 2024, 10:44:22 AM12/26/24
to ProjectChrono
Hello All,

I have been trying to use the ROS2 module with an external project and everytime I try to compile I get errors (I have attached screenshots).

For more information:
1. I am using ROS2 Humble, I tried with Galactic too, but got the same results.
2. The example programs all compile and work for me.
3. I downloaded, built and then linked chrono_ros_interface during my chrono build processes and it works too.

Please help me out.

Sincerely,
Giri
ss1_chrono.png
ss2_chrono.png

Radu Serban

unread,
Dec 27, 2024, 4:13:51 AM12/27/24
to ProjectChrono

Hi Giri,

 

Are you using the latest code in the ‘main’ branch of the Chrono GitHub repository? There were some recent commits addressing issues related to this kind of use of the Chrono::ROS module.

 

If yes, the Chrono CMake project configuration script should be tweaked a little bit more to pass a default for the ROS2_DIR path (Aaron, if you are reading this, could you please look into this?)

 

But even without that, the solution seems quite straightforward: during CMake configuration of your project, fill in the ROS2_DIR with the path where the CMake configuration files for ROS are located.  You must have done this already when you configured Chrono with the ROS module enabled. Simply put in here the same path as you did when configuring Chrono.

 

--Radu

Giri Mugundan

unread,
Dec 27, 2024, 8:16:00 AM12/27/24
to ProjectChrono
Hello Dr.Radu,

To answer your quesitons, yes I am using the latest code from the 'main' branch. I didn't have to put the location of the CMake configuration files for ROS while I build the chrono libraries, I just sourced the environment and it took care of the rest.

Just for my information, where would the CMake configuration files be located?.

I used the template project and cmake to test the ROS module out and ran into these errors, how would I need to tweak the CMake file?

Thank you for helping me out.

Sincerely,
Giri
Reply all
Reply to author
Forward
0 new messages