Why should we use EffortJointInterface as hardware_interface for transmission in URDF?

asked 2020-03-12 08:51:11 -0500

fjp gravatar image

updated 2020-03-13 09:55:49 -0500

Reading the urdf/Transmission documentation, I am confused by the following statement:

<hardwareInterface> (one or more occurrences)

Specifies a supported joint-space hardware interface. Note that the value of this tag should be EffortJointInterface when this transmission is loaded in Gazebo and hardware_interface/EffortJointInterface when this transmission is loaded in RobotHW.

To me this reads as if we are forced to use EffortJointInterface when working with Gazebo and hardware_interface/EffortJointInterface when working with real robot hardware. However, I know that there are other hardware interfaces, inheriting also from CommandJointInterface such as PositionJointInterface and VelocityJointInterface.

Could someone please clarify why we should use EffortJointInterface when using the transmission tag in URDF?

edit retag flag offensive close merge delete

Comments

you don't have to use EffortJointInterface, I have in fact used VelocityJointInterface in a project of mine that is driving around just fine. I think the piece that you're quoting is written unclearly and should be read more as:

Note that the value of this tag should be [Whatever interface you're using] when this transmission is loaded in Gazebo and hardware_interface/[Whatever interface you're using] when this transmission is loaded in RobotHW.

I'm open to the suggestion of something else than [Whatever interface you're using]

Joe28965 gravatar image Joe28965  ( 2020-03-12 08:58:10 -0500 )edit

Thanks @Joe28965 confirming my assumption. However, does this mean that we have to use two different urdf/xacro files? One for simulation with gazebo and another one when working with real robot hw?

fjp gravatar image fjp  ( 2020-03-12 09:01:26 -0500 )edit

well strangely enough, the project I used VelocityJointInterface in was in Gazebo, and I just checked and it's written there as hardware_interface/VelocityJointInterface so I'm not even sure what's meant by that whole ordeal

Joe28965 gravatar image Joe28965  ( 2020-03-12 09:05:48 -0500 )edit

Thanks again for making this clear. Then, maybe the documentation also missed to include the hardware_interface/ part. Or maybe doesn't matter as I don't know where the value of this tag is even checked? Is your implementation public? If so could you please provide a reference? As the documentation on this topic and ros_control in general is quite confusing.

fjp gravatar image fjp  ( 2020-03-12 09:08:52 -0500 )edit
1

my implementation is not public, I'm afraid (not my call). I agree with you that ros_control is quite confusing and I do not think I grasp it well enough to be able to explain to somebody else, or even if my way is correct or just a haphazard mess. This might at least help you to create the 'motors' to write the velocities from ros_control to

Joe28965 gravatar image Joe28965  ( 2020-03-12 09:17:02 -0500 )edit

From the section Add transmission elements to a URDF it seems that only effort interfaces are implemented in the gazebo_ros_control plugin:

Currently only effort interfaces are implemented. (feel free to add more)

Maybe this means that using something else defaults back to EffortJointInterface

fjp gravatar image fjp  ( 2020-03-12 09:41:12 -0500 )edit
1

that tutorial was written for Gazebo 1.9+ (as seen in the top right corner). My guess would be that this might be outdated

Joe28965 gravatar image Joe28965  ( 2020-03-12 09:49:51 -0500 )edit
1

I see that in this Github link all the interfaces are implemented and as @Joe28965 said, the tutorial might be outdated! Correct me if I'm wrong! Thanks!

pmuthu2s gravatar image pmuthu2s  ( 2020-03-13 14:00:33 -0500 )edit