Skip to content

Commit cad185c

Browse files
mechwizMichael Wiznitzer
andauthored
check for nans in command interface (ros-controls#346)
Co-authored-by: Michael Wiznitzer <michael.wiznitzer@resquared.com>
1 parent 8f4dbae commit cad185c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎joint_trajectory_controller/src/joint_trajectory_controller.cpp‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,8 @@ void JointTrajectoryController::fill_partial_goal(
10641064
// Assume hold position with 0 velocity and acceleration for missing joints
10651065
if (!it.positions.empty())
10661066
{
1067-
if (has_position_command_interface_)
1067+
if (has_position_command_interface_ &&
1068+
!std::isnan(joint_command_interface_[0][index].get().get_value()))
10681069
{
10691070
// copy last command if cmd interface exists
10701071
it.positions.push_back(joint_command_interface_[0][index].get().get_value());

0 commit comments

Comments
 (0)