1.4 KiB
1.4 KiB
PX4_MSGS
The PX4_msgs package is required, because it translates Custom uORB Message messages into the ROS2 ecosystem and vice versa. The project contains a msg folder, which contains the msg definitions. Usually, those message definitions are autogenerated by a script provided by the PX4-Autopilot project.
A build error that has popped up several times is that the messsage definition comments contain */ which is misinterpreted by the compiler
Error message:
/home/pi/ros2_ws/build/px4_msgs/rosidl_generator_c/px4_msgs/msg/detail/gimbal_v1_command__struct.h:356:3: error: expected identifier or ‘(’ before ‘/’ token
356 | */
| ^
/home/pi/ros2_ws/build/px4_msgs/rosidl_generator_c/px4_msgs/msg/detail/gimbal_v1_command__struct.h:365:3: error: expected identifier or ‘(’ before ‘/’ token
365 | */
In order to solve this error, just delete the relevant parts of the comment.
px4_ros_com
In order to successfully build the px4_ros_com package you need to define the following env-variable: export FASTRTPSGEN_DIR="/usr/local/bin/".
Without it it will not work and throw the following error:
c++: error: /home/pi/ros2_ws/build/px4_ros_com/src/micrortps_agent/microRTPS_agent.cpp: No such file or directory
c++: fatal error: no input files