Skip to content
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

[swarm] add formation control for rotorcraft #2246

Merged
merged 3 commits into from Mar 20, 2018

Conversation

gautierhattenberger
Copy link
Member

Based on Ewoud Smeur (INDI) and Hector Garcia de Marina (Formation
control) work. See
https://blog.paparazziuav.org/2017/12/02/pilot-a-super-rotorcraft

  • several UAV can be control from the ground (using a joystick for
    instance) by sending proper acceleration setpoint to the INDI guidance
    controller
  • configuration of the formation is done from a JSON file (2 example
    files provided)
    Some extra changes:
  • update accel from IMU in GPS passthrough INS
  • add accel setpoint to ABI messages
  • by to accel setpoint in INDI guidance
  • send ground reference from natnet2ivy
  • possibility to have a joystick labeled 'GCS' with input2ivy

Based on Ewoud Smeur (INDI) and Hector Garcia de Marina (Formation
control) work. See
https://blog.paparazziuav.org/2017/12/02/pilot-a-super-rotorcraft
- several UAV can be control from the ground (using a joystick for
  instance) by sending proper acceleration setpoint to the INDI guidance
  controller
- configuration of the formation is done from a JSON file (2 example
  files provided)
Some extra changes:
- update accel from IMU in GPS passthrough INS
- add accel setpoint to ABI messages
- by to accel setpoint in INDI guidance
- send ground reference from natnet2ivy
- possibility to have a joystick labeled 'GCS' with input2ivy
Copy link
Member

@kirkscheper kirkscheper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good (minus the couple comments)

sp_accel.z = (speed_sp_z - stateGetSpeedNed_f()->z) * guidance_indi_speed_gain;
float dt = get_sys_time_float() - time_of_accel_sp_2d;
if (dt > 0.5) {
indi_accel_sp_set_2d = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems strange...

I am not sure where else 'sp_accel' used but is overwritten somewhere else? Else it should be sufficient to immediately set indi_accel_sp_set_2d = false; without the dt check.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the guidance control loop is faster than the setpoint update, you want to avoid to switch the 2D/3D control and the derivate from speed until a timeout is reached

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember that when we wrote this condition for dt was also for safety porpuses. In particular, if the commands from the ground stop, then the rotorcraft resumes the flight plan (for example, hovering in a position with the guidance from INDI). Indeed, if the setpoint update is slower than the guidance, you do not want to have a "misbehavior" by switching between two set points from different systems (formation control or guidance).

I agree with kirk that this part could be more clear... in fact, I do not even remember how we wrote it. Although the behavior was as expected (including the safety).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, the setpoint is updated over telemetry, which will update much slower than the periodic frequency.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging with an extra comment

*/
static void accel_sp_cb(uint8_t sender_id, struct FloatVect3 *accel_sp)
{
if (sender_id == 1) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess these should check for ACCEL_SP_3D_ID and ACCEL_SP_2D_ID

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, I didn't pay enough attention at how the message and ID wax used, it is now done correctly with a flag instead of abusing the sender ID

@gautierhattenberger gautierhattenberger merged commit 7894379 into paparazzi:master Mar 20, 2018
@gautierhattenberger gautierhattenberger deleted the fcr-integration branch March 20, 2018 15:07
biancabndris pushed a commit to biancabndris/paparazzi that referenced this pull request Aug 29, 2018
* [swarm] add formation control for rotorcraft

Based on Ewoud Smeur (INDI) and Hector Garcia de Marina (Formation
control) work. See
https://blog.paparazziuav.org/2017/12/02/pilot-a-super-rotorcraft
- several UAV can be control from the ground (using a joystick for
  instance) by sending proper acceleration setpoint to the INDI guidance
  controller
- configuration of the formation is done from a JSON file (2 example
  files provided)

Some extra changes:
- update accel from IMU in GPS passthrough INS
- add accel setpoint to ABI messages
- by to accel setpoint in INDI guidance
- send ground reference from natnet2ivy
- possibility to have a joystick labeled 'GCS' with input2ivy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants