0
$\begingroup$

Rosanswers logo

Hi,

I'm using the mavros package but I'm not sure on how to use a certain message type. I want to use this: setpoint_raw/local (mavros_msgs/PositionTarget) message type and want to set the FRAME_BODY_OFFSET_NED flag, but I'm not sure on how to do it. Can someone explain this to me?

I was also planning to use the velocity part of the message, but thats quite simple. I will do it as folow:

vel_msg.velocity.x = 0.1;
vel_msg.velocity.y = 0.0;
vel_msg.velocity.z = 0.0;

Of cours I will first declare the publisher and the message.

Message type

Mavros

Thanks!


Originally posted by MaximeRector on ROS Answers with karma: 60 on 2017-12-23

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

FRAME_BODY_OFFSET_NED is a flag that's defined in the message. By convention, flags should have the same prefix as the message field that they relate to. In this case the FRAME_* flags are directly below the coordinate_frame field, so they appear to be related. A quick Google search reveals a code snippet that confirms this hypothesis:

moveMsg.coordinate_frame = mavros_msgs::PositionTarget::FRAME_BODY_OFFSET_NED;

Happy roboting!


Originally posted by clyde with karma: 1247 on 2017-12-24

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.