astuff / pacmod3

PACMod Board Rev 3 Driver
MIT License
24 stars 14 forks source link

`ros-galactic-pacmod3` and `ros-galactic-pacmod3-msgs` packages seem not to support fastRTPS middleware #127

Open VRichardJP opened 2 years ago

VRichardJP commented 2 years ago

I am using the pacmod3 packages from galactic release:

ros-galactic-pacmod3/unknown,now 2002.1.0-0focal amd64 [installed]
ros-galactic-pacmod3-msgs/unknown,now 1.0.0-0focal amd64 [installed]

When I use the FastRTPS middleware, the pacmod3_driver binary crashes on my machine:

$ ros2 run pacmod3 pacmod3_driver 
[INFO 1653531815.463922874] [pacmod3_driver]: frame_id: pacmod (PACMod3Node() at /tmp/tmp.c2evXsExQj/repo_root/src/pacmod3_node.cpp:49)
[INFO 1653531815.463990101] [pacmod3_driver]: dbc_major_version: 3 (PACMod3Node() at /tmp/tmp.c2evXsExQj/repo_root/src/pacmod3_node.cpp:50)
[ERROR 1653531815.464407121] []: Caught exception in callback for transition 10 (execute_callback() at /tmp/binarydeb/ros-galactic-rclcpp-lifecycle-9.2.1/src/lifecycle_node_interface_impl.hpp:462)
[ERROR 1653531815.464420063] []: Original error: could not create publisher: Type support not from this implementation. Got:
    error not set
    error not set
while fetching it, at /tmp/binarydeb/ros-galactic-rmw-fastrtps-cpp-5.0.2/src/publisher.cpp:117, at /tmp/binarydeb/ros-galactic-rcl-3.1.3/src/rcl/publisher.c:114 (execute_callback() at /tmp/binarydeb/ros-galactic-rclcpp-lifecycle-9.2.1/src/lifecycle_node_interface_impl.hpp:463)
[WARN 1653531815.464439020] []: Error occurred while doing error handling. (change_state() at /tmp/binarydeb/ros-galactic-rclcpp-lifecycle-9.2.1/src/lifecycle_node_interface_impl.hpp:431)

The issue is described in https://github.com/ros2/rmw_fastrtps/issues/541. The solution is to have ros-galactic-rmw-fastrtps-cpp installed on the machine when pacmod3 package is compiled.

To verify that, I have uninstalled pacmod3 and pacmod3_msgs packages, then recompiled the packages from source. And now the driver seems to work just fine:

$ ros2 run pacmod3 pacmod3_driver 
[INFO 1653533229.016771371] [pacmod3_driver]: frame_id: pacmod (PACMod3Node() at /home/sig/autoware.auto/src/vehicle/pacmod3/src/pacmod3_node.cpp:49)
[INFO 1653533229.016851937] [pacmod3_driver]: dbc_major_version: 3 (PACMod3Node() at /home/sig/autoware.auto/src/vehicle/pacmod3/src/pacmod3_node.cpp:50)
[INFO 1653533229.164434862] [pacmod3_driver]: Initialized Headlight API (initializeHeadlightApi() at /home/sig/autoware.auto/src/vehicle/pacmod3/src/pacmod3_node.cpp:313)
[INFO 1653533229.165520479] [pacmod3_driver]: Initialized Horn API (initializeHornApi() at /home/sig/autoware.auto/src/vehicle/pacmod3/src/pacmod3_node.cpp:328)
[INFO 1653533229.166150946] [pacmod3_driver]: Initialized HazardLight API (initializeHazardLightApi() at /home/sig/autoware.auto/src/vehicle/pacmod3/src/pacmod3_node.cpp:398)
[INFO 1653533229.166785345] [pacmod3_driver]: Initialized WheelSpeed API (initializeWheelSpeedApi() at /home/sig/autoware.auto/src/vehicle/pacmod3/src/pacmod3_node.cpp:337)
[INFO 1653533229.167881409] [pacmod3_driver]: Initialized Lexus-specific API (initializeLexusSpecificApi() at /home/sig/autoware.auto/src/vehicle/pacmod3/src/pacmod3_node.cpp:417)
[INFO 1653533229.168473710] [pacmod3_driver]: Initialized InteriorLights API (initializeInteriorLightsRptApi() at /home/sig/autoware.auto/src/vehicle/pacmod3/src/pacmod3_node.cpp:364)

I have only checked on galactic, but other distro may have the same issue. Could the release be updated to add FastRTPS support?

icolwell-as commented 2 years ago

Hi @VRichardJP, thanks for bringing up this issue. Did you try the other suggestion in that thread you linked?

RMW_IMPLEMENTATION=rmw_fastrtps_dynamic_cpp

Just curious if that helps, or if the only option is to re-build.

VRichardJP commented 2 years ago

No crash with RMW_IMPLEMENTATION=rmw_fastrtps_dynamic_cpp with the galactic release package.

icolwell-as commented 2 years ago

ok awesome! glad it's working and you have a temporary solution.

I'll review our build scripts to make sure the rmw-fastrtps-cpp package is installed going forward. Leave this issue open for now, as a reminder for me to fix the build scripts.

Thanks!