SET_ROLL_PITCH_YAW_THRUST implementation

Hi all

I'm working on controlling the ArduCopter using pose estimates from an external source using ROS by using MAVLink commands over USB. Now, although I can use rc_override to control the pitch and the roll of the quadrotor, what makes this tough is that there is some inevitable drift in the quadrotor which I presume is because it is tough to level the arducopter perfectly horizontally. Even after trying auto trim and manual trim, it tends to drift to one side, and as a result, my PD controller for hover has trouble maintaining hover.

I want to use the SET_ROLL_PITCH_YAW_THRUST MAVLink command to control the desired angular roll and pitch wrt to the drone's estimated horizon, and bypass the RC override method completely to avoid ambiguities in what RC PWM corresponds to what deviation from the horizon (i.e., the Earth Frame)

So, any suggestions on how to go about doing that? Should I implement a MAVLINK_MSG_SET_ROLL_PITCH_YAW case in GCS_Mavlink.pde and assign nav_roll and nav_pitch within it? 

I am flying the APM 2.5 on a slightly modified 2.9.1b trunk code.

Thanks a lot!

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Developer

    KSS,

         That seems like a reasonable way to go.     Which flight mode are you using?  AltHold or just stabilize mode?  If it's stabilize mode then you'll need to do some changes to make nav-roll and nav-pitch get into the stabilize controller.  Of course you could just make a new roll-pitch mode that immediately shoves the nav-roll and nav-pitch into the stabilize controller...or maybe you could steal OF_LOITER and strip out the optical flow sensor reading part and slip in your stuff.

This reply was deleted.