diff --git a/hardware_interface/src/mock_components/generic_system.cpp b/hardware_interface/src/mock_components/generic_system.cpp index 2d8a01a34f..300a0e6cf0 100644 --- a/hardware_interface/src/mock_components/generic_system.cpp +++ b/hardware_interface/src/mock_components/generic_system.cpp @@ -515,6 +515,11 @@ return_type GenericSystem::read(const rclcpp::Time & /*time*/, const rclcpp::Dur joint_states_[ACCELERATION_INTERFACE_INDEX][j] = (joint_states_[VELOCITY_INTERFACE_INDEX][j] - old_velocity) / period.seconds(); } + else + { + joint_states_[VELOCITY_INTERFACE_INDEX][j] = 0.0; + joint_states_[ACCELERATION_INTERFACE_INDEX][j] = 0.0; + } break; } case POSITION_INTERFACE_INDEX: