ArduPilot / ardupilot_gazebo

Plugins and models for vehicle simulation in Gazebo Sim with ArduPilot SITL controllers
GNU Lesser General Public License v3.0
82 stars 78 forks source link

Zephyr elevon servo inconsistency with ardupilot parameters #22

Closed 41Mo closed 1 year ago

41Mo commented 2 years ago

Servo reverse inconsistency

In zephyr model.sdf servos determined as

``

      SERVO1_FUNCTION   77 (Elevon Left)
      SERVO1_MAX        1900
      SERVO1_MIN        1100
      SERVO1_REVERSED   0
      SERVO1_TRIM       1500

      pwm:          =>  [1100, 1900] 
      input:        =>  [0, 1]
      offset: -0.5  =>  [-0.5, 0.5]
      scale:   2.0  =>  [-1.0, 1.0]
      scale: 0.524  =>  [-0.524, 0.524]

``

But gazebo-zephyr.parm in ardupilot assuming, that

SERVO1_REVERSED = 1 SERVO2_REVERSED = 1

srmainwaring commented 2 years ago

@41Mo - yes you're right. I forget why the elevon servos are flipped in the example here - I think this matches settings from the original repo and at some point the SITL params may have been reversed?

We should get them back into alignment so you don't need to edit the params loaded when your run sim_vehicle.py ....