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
Simple mavlink message receiver problem #713
Comments
That issue because you included "mavlink/v2.0/common/mavlink_msg_set_attitude_target.h", while libmavconn 0.19 switched to C++11 library with mavros. Instead of Anyway why you need to use it outside of mavros? |
Oh, I didn't know that. So how could I deserialize attitude_message?
Is there some example of doing such a thing? I need to write my own mavlink receiver because I'm developing code for both pixhawk based copters and DJI copters. My program uses MAVROS to communicate with autopilots. The problem is that DJI copter doesn't use MAVLINK as a communication protocol. So I need to write MAVLINK message receiver and use DJI's ROS onboard API for controlling the copter. |
Look at Instead of decode you should write: mavlink::MsgMap map(message);
mavlink::common::msg::SET_ATTITUDE_TARGET s;
s.deserialize(map);
std::cout << s.to_yaml() << std::endl; |
Thank you very much for your help. Everything's working fine now. |
@vooon The answers here are very useful and not present anywhere else that I've searched. The ros node examples in PX4 stack are not up to date with the libmavconn changes discussed here. So thanks. |
MAVROS version and platform
Mavros: 0.19.0
ROS: Kinetic
Ubuntu: 16.04
Issue details
Hi,
I'm currently trying to write mavlink message receiver using libmavconn library but unfortunately I cannot compile my code for some reason. Here's my code:
mavlink_receiver_test.h:
mavlink_receiver_test.cpp:
And here's output of catkin_make command:
It seems like some declarations are missing, but if I try to include for example
mavlink.h
ormavlink_types.h
files I get ton of errors during compilation process. Am I missing something? Should I link some libraries against my example? I couldn't find how to use libmavconn library precisely and I'm stuck currently...The text was updated successfully, but these errors were encountered: