Offboard Frames question

Hi,
since position control is not already provided by the Dronecode SDK and I would really like to have it in my “toolbox”, I decided to add it in the Dronecode OFFBOARD commands.
I have already successfully added the position commands for the NED frame (I will be glad to share the code if you’re interested) and I am now trying to add the position commands for the BODY frame. But it seems to me that frame is ignored by the position control.

Looking inside the PX4 code, I found that the OFFBOARD commands are handled in the method MavlinkReceiver::handle_message_set_position_target_local_ned(mavlink_message_t *msg).
Inside this method, the only reference to a frame is the velocity_frame.

Does it mean that the offboard position control always overrides the frame to NED? Is it possible to command displacements in BODY frame?

Thank you!

1 Like

Good question, sorry I didn’t get back to you earlier. I think we should support both but it’s probably true that some things are missing on the PX4 and/or SDK side. I hope I’ll get to this some day. Until then PRs welcome :smile:.

1 Like

Hi @JulianOes,
any news about an eventual “set_position_ned” method for the Offboard class?

Thank you!

That would indeed be nice, status is here:

1 Like

Hi,
thank you for the update. In the meantime, I made my local branch with the “position_ned” functions.
I am sorry I didn’t share them on github, I was quite in a hurry. Anyway, they seem to work pretty well.
You can find the files here: https://drive.google.com/open?id=1_8xzgTPq88-a2Hi74yR13dIO6b5R7OFS
Here’s git status output:
modified: plugins/offboard/include/plugins/offboard/offboard.h
modified: plugins/offboard/offboard.cpp
modified: plugins/offboard/offboard_impl.cpp
modified: plugins/offboard/offboard_impl.h

I hope they can be of help to make these functionalities available for everyone soon.

1 Like

I would really appreciate a pull request :smile:

Arrrg, I knew you would have said that…:smile: But it’s just a few lines of code :sweat_smile:
Should I refer to this guide? https://help.github.com/en/articles/creating-a-pull-request
Can I push just the code or unit test, etc. are required too?

Yes please :slight_smile:

1 Like

Done! https://github.com/Dronecode/DronecodeSDK/pull/696

1 Like