Ardupilot Refactor and minor improvements

#2450 Open

Bitbucket cannot automatically merge this request.

The commits that make up this pull request have been removed.

Bitbucket cannot automatically merge this request due to conflicts.

Review the conflicts on the Overview tab. You can then either decline the request or merge it manually on your local system using the following commands:

hg update 4f1a8232b0a6
# Note: This will create a new head!
hg merge e88bbb659553
hg commit -m 'Merged in ardupilot (pull request #2450)'
  1. John Hsu
  • add settings for fdm ports and address per pull request #2451
  • add ardupilot irlock plugin and demo world
  • update models and demo worlds, make landing pad heavier in demo world, add zephyr test world
  • update irlock plugin for Copter-3.4rc5, update beacon and model
  • fix sensor plugin destructor segfault
  • add ArduPilotPlugin, deprecate ArduCopterPlugin.
  • fix receive packet size checking in ArduPilotPlugin.
  • fix frame transforms (bug uncovered by zephyr model)
  • rename param (modelXYZToNED --> gazeboXYZToNED) which is the transform from gazebo model frame to
  • adjust clamp for incoming commands to [-1, 1]

Comments (25)

  1. pierre kancir

    @John Hsu @Tully Foote I carrefully check gazebo plugin on ardupilot side. It send motor command between 0 and 1.0 as rc value are bound between 1000 and 2000. Using ARMING_REQUIRE 2.000000 , make send -1 value when no rc input as rc 3 will be 0, so the motor ouput is (0 - 1000) / 1000 = -1 . but that value is only for APM start up it can be send to motor.

    So we got two solutions : - we change the clamp Line 794 to 0 1.0 range. I think it is the easiest change, but require to adjust model parameter (setting offset to 0 for propeller) and we got the same behaviour for quad, plane ,and rover. Using this solve the issue of plane takeoff whitout input from APM ... - I change gazebo pluggin on apm side to output motor between -1 1 for plane,

    What do you think ?

    1. John Hsu author

      @pierre kancir thanks for the insights. Couple of questions:

      • So throttles use -1 as a special signal for when rc is not connected? We can clamp motor command in the gazebo side to [0, 1] by setting cmd_max and cmd_min to [0, 1] if the apm motor command is simply [0, 1] and only -1 when rc is not detected.
      • Does the throttle controller actually want to leverage reverse thrust during flight in some scenarios?
          1. Tully Foote

            Thanks I removed my approval as that was for a much earlier version that it's now evolved away from. Where can I find documentation of the gazebo review process?

    1. pierre kancir

      Hi, I got some other changes to push . But I am waiting for ardupilot side to stabilize a little as plenty of refactoring are in progress and will break stuff ... Some thing I will push : - deprecation of arducopter pluggin, as ardupilot plugin is enough for all ardupilot vehicle type (at least traditional : copter, rover, plane, I didn't look at quadplane and thing like that), and update iris sdf - allow to use gazebo gps plugin (working but sitl acting weird) - allow to use gazebo ray sensors or sonar to be send to sitl - update irlock plugin to be parametrable

      here are some video of the result :

      1. Steven Peters

        cool, I just retargeted it. Do you think you can resolve the conflicts on your own or should we do it together? I don't think I know this code well enough to do it myself

    1. pierre kancir

      otherwise the plugin is working fine ! I use it from some time already and got no problem until gazebo9 were it seems that something change as pitch axis on copter isn't stable anymore... I also work on adding more data like battery, airspeed, rangefinder, and gps handling with succes. The use of gps is tricky as we can't change gps frame... (I don't push that on ardupilot side yet)