ArduPilot / ardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source
http://ardupilot.org/
GNU General Public License v3.0
10.81k stars 17.26k forks source link

Request for desired speed #21724

Open sulakshanarya opened 2 years ago

sulakshanarya commented 2 years ago

Feature request

Is there a way to request the desired speed from the flight controller after the DO_CHANGE_SPEED changes the wp speed.

Platform [ ] All [ ] AntennaTracker [X] Copter-4.x [ ] Plane [ ] Rover [ ] Submarine

Additional context I am migrating from Copter-3.6.6 to Copter-4.2 and in Copter-3.6.6. In Copter-3.6.6 I used request for the WPNAV_SPEED parameter value for desired speed. But Copter-4.2 is no more updating it when vehicle speed is changed using DO_CHANGE_SPEED.

rmackay9 commented 2 years ago

I think the only possibilities are via the POSITION_TARGET_GLOBAL_INT or POSITION_TARGET_LOCAL_NED which have vx, vy fields.. so you could maybe check the overall length of these. One problem may be though that even if you set the WPNAV_SPEED to 5, you may not immediately see the vx, vy fields increase in length because the outputs are probably from the position controller which may slow down the vehicle for corners, etc.

AP does not currently fill in the target velocities for the POSITION_TARGET_GLOBAL_INT message but it could. FYI @hendjoshsr71.

sulakshanarya commented 2 years ago

Thank you @rmackay9. The flight controller streams POSITION_TARGET_GLOBAL_INT only when target is set, but accept the DO_CHANGE_SPEED command even when target is not set, for example before the Guided WP start. This would confuse the user if desired speed is changed but not visible at GCS.

Or is there a better way to implement?