-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems including frame_transforms.h #169
Comments
PX4 dev call: Since we already have frames in the odometry message: https://github.com/PX4/PX4-Autopilot/blob/d81ca65c6fcd84263a5044b6233eb00be2dbcd8e/msg/VehicleOdometry.msg#L5-L8 |
Frame transforms is a shared library. How are you linking the library to your executable/package in the cmakelist? See: https://www.theconstructsim.com/how-to-create-a-ros2-c-library/ |
Hi, I'm facing the same issue. I guess it's already linked in the CMakelist.txt
However, the example on https://www.theconstructsim.com/how-to-create-a-ros2-c-library/ creates another package and then includes that package using ament_target_dependencies in the CMakeList. I guess there is a way to include the transform library without creating another package. Any help in figuring out how to do it will be appreciated. |
Problem
I'm trying to make use of the helper functions inside the frame_transforms.cpp file. But when I try to include the header with:
#include <px4_ros_com/frame_transforms.h>
I get the following error in colcon build:
More details
While i am using a slightly older version of px4_ros_com (7e25c34) and px4_msgs (daee121) i did double check the CMakeLists.txt and package.xml files:
Changes to CMakeLists
I added Eigen3 to the CMakeLists.txt file:
My take
So it seems like the compiler gets confused and tries to compile the body of the "quaternion_from_euler" function before it has been declared in the header. Why this happens I don't know.
My solution
To combat this issue i just moved the body of the "quaternion_from_euler" from the .cpp file to the header file:
Definitely not an elegant solution, but it works, any clue as to how to fix this properly?
The text was updated successfully, but these errors were encountered: