ArduPilot / ArduPilot/ardupilot

DDS: Bad commanded velocity results in fly away

Open
#31,373 3 comments 0 reactions 0 assignees View on GitHub
ROS
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.