PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.17k stars 13.36k forks source link

SITL Gazebo Iris Max Speed bug #20126

Closed Edekheh closed 5 months ago

Edekheh commented 2 years ago

Describe the bug

SITL max speed limitation for quadcopter to 20m/s. MPC_XY_VEL_MAX and MPC_XY_CRUISE doesn't change max speed.

To Reproduce

Steps to reproduce the behavior:

  1. Run roslaunch px4 mavros_posix_stl.launch
  2. Open QGroundControl, change MPC_XY_VEL_MAX to 50m/s and MPC_XY_CRUISE to 40m/s
  3. After sending drone to distant location you will se max speed at 20m/s instead of 40.

Expected behavior

According to changing in parameters, flight controller should not limit SITL drone to 20m/s.

Add screenshots to help explain your problem.

Drone (please complete the following information):

Additional context

Add any other context about the problem here.

andreykanevskoi commented 5 months ago

Check docs, this is the maximum allowed speed. It won't work faster, the speed will be reduced. image

Edekheh commented 5 months ago

Oh wow it was so long ago i forgot about it. To modify speed above 20 m/s You can go to Tools/simulation/sitl-gazebo/src/gazebo_motor_model.cpp and edit line 222 : double scalar = 1 - vel / 25.0; // at 25 m/s the rotor will not produce any force anymore

Now You can fly up to 35-40 m/s.

If You want to fly even faster You need to modify simulated vehicle sdf model, so that rotors will produce more thrust :)

andreykanevskoi commented 5 months ago

I use AirSim and MavLink, couldn't found smth similar there ;(