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.
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.