mirror of
https://gitlab.com/obbart/universal_robots_ros_driver.git
synced 2026-04-10 18:10:47 +02:00
Added a check to incoming goals to see if there are any points in the trajectory
This commit is contained in:
@@ -190,6 +190,13 @@ private:
|
|||||||
print_error(result_.error_string);
|
print_error(result_.error_string);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!has_positions()) {
|
||||||
|
result_.error_code = result_.INVALID_GOAL;
|
||||||
|
result_.error_string = "Received a goal without positions";
|
||||||
|
as_.setAborted(result_, result_.error_string);
|
||||||
|
print_error(result_.error_string);
|
||||||
|
}
|
||||||
|
|
||||||
if (!has_velocities()) {
|
if (!has_velocities()) {
|
||||||
result_.error_code = result_.INVALID_GOAL;
|
result_.error_code = result_.INVALID_GOAL;
|
||||||
result_.error_string = "Received a goal without velocities";
|
result_.error_string = "Received a goal without velocities";
|
||||||
@@ -325,6 +332,17 @@ private:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool has_positions() {
|
||||||
|
if (goal_.trajectory.points.size() == 0)
|
||||||
|
return false;
|
||||||
|
for (unsigned int i = 0; i < goal_.trajectory.points.size(); i++) {
|
||||||
|
if (goal_.trajectory.points[i].positions.size()
|
||||||
|
!= goal_.trajectory.joint_names.size())
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool has_limited_velocities() {
|
bool has_limited_velocities() {
|
||||||
for (unsigned int i = 0; i < goal_.trajectory.points.size(); i++) {
|
for (unsigned int i = 0; i < goal_.trajectory.points.size(); i++) {
|
||||||
for (unsigned int j = 0;
|
for (unsigned int j = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user