ipa320 / cob_gazebo_plugins

Apache License 2.0
9 stars 17 forks source link

Fix wrong array index occuring if using joint filtering #44

Closed MatthiasNieuwenhuisen closed 4 years ago

MatthiasNieuwenhuisen commented 4 years ago

This PR fixes two problems in the libhwi_switch_gazebo_ros_control Gazebo plugin if joint filtering is enabled. If joint filtering is enabled then the number of transmissions is not equal to the controlled DoF.

1) This caused a segfault if the deprecated hardware interface definition is used in the URDF as the wrong index is used in the warning message.

2) The joint effort limits were set wrongly for Gazebo version > 2.

I replaced the wrong index "j" (referring to the transmission array) with the correct index "index", which corresponds to the controlled joint.