ArduPilot / ArduPilot/ardupilot
DDS: Bad commanded velocity results in fly away
- Dominant language
- C++
- Stars
- 15.9k
- Forks
- 21.4k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 119
Description
It appears that a bad value (inf or NaN) sent through the `/ap/cmd_vel` topic causes the vehicle to just fly away. I suggest to screen the message before calling the external control.
Like:
```
if (isnan(cmd_vel.twist.linear.x) || isnan(cmd_vel.twist.linear.y) || isnan(cmd_vel.twist.linear.z) || isnan(cmd_vel.twist.angular.z)
|| isinf(cmd_vel.twist.linear.x) || isinf(cmd_vel.twist.linear.y) || isinf(cmd_vel.twist.linear.z) || isinf(cmd_vel.twist.angular.z))
{
return false;
}
```
**Platform**
[ x ] All
[ ] AntennaTracker
[ ] Copter
[ ] Plane
[ ] Rover
[ ] Submarine
Contributor guide
Research direction
Start by locating the DDS subscriber for the `/ap/cmd_vel` topic and the point where it calls external control. Verify how non-finite linear and angular velocity values are handled, then confirm that invalid commands are rejected and valid commands retain their existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- embedded-iot, robotics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100