Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend interfaces melodic #395

Conversation

bmagyar
Copy link
Member

@bmagyar bmagyar commented Dec 2, 2019

  • Adds absolute_position and torque_sensor data types to JointStateHandle and ActuatorStateHandle, as well as the corresponding transformations to Transmissions
  • Changes the way velocity joint saturation limits are calculated: It now uses previous commanded velocity rather than measured velocity.
  • Exposes raw data pointers in JointStateHandle and JointCommandHandle. Previously only available in actuator handles.
  • Adds a new JointModeHandle for switching a hardware interface between different controller modes

Copy link
Member

@matthew-reynolds matthew-reynolds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes should all be run through an auto-formatter. There are a lot of stylistic differences between the new changes and the rest of the codebase.

I realized while going through some of the comments I had were about established patterns. This is already a fairly large PR, so perhaps it makes more sense to stick with the established patterns and those changes should be pulled out into follow-ups (ie. replacing 0 with nullptr, adding consts all over the place, etc.)

@bmagyar bmagyar force-pushed the extend-interfaces-melodic branch 5 times, most recently from a7fbbd2 to 60d67db Compare December 30, 2019 00:14
@bmagyar
Copy link
Member Author

bmagyar commented Dec 30, 2019

@matthew-reynolds could you please give it another pass? I think it should be ready now

Paul Mathieu and others added 4 commits December 30, 2019 01:24
The feedback from the controller is way too slow to be used on an
actual robot. A robot that had 15 rad.s^-2 on each wheel as
an acceleration limit could not even reach 2 rad.s^-2

This is in line with ros_controllers#23
Copy link
Member

@matthew-reynolds matthew-reynolds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a breaking change in the DifferentialTransmission constructor that should be fixed up. Once that's fixed up, there are a couple of style nitpicks but LGTM.

Beyond the code itself, I've got a couple questions about the usages and need for these changes, but I suspect you've already thought them through and I'll understand better once some more documentation is present. Don't want to hold up the PR while I'm getting conceptually on the same page, since the code itself looks good.

We should definitely get some documentation going that explains:

  • effort vs torque_sensor and pos vs absolute_position
  • The usage of the JointModeHandle (Once it's fleshed out)
  • What ignore_transmission_for_absolute_encoders does in DifferentialTransmission and how the loader can read it

Also, for changelogs down the road, it should be pointed out that this mega-PR:

  • Adds absolute_position and torque_sensor data types to JointStateHandle and ActuatorStateHandle, as well as the corresponding transformations to Transmissions
  • Changes the way velocity joint saturation limits are calculated (Now uses prev commanded vel rather than measured vel).
  • Exposes raw data pointers in JointStateHandle and JointCommandHandle (Previously only in actuator handles)
  • Adds a new JointModeHandle "for switching a hardware interface between different controller modes"

(Might be worth updating the PR description so that people reading this in the future don't need to go digging through comments)

Also, a final comment: Why torque_sensor rather than torque?

Comment on lines 175 to 188
* \pre Actuator, joint position and torque sensor vectors must have the same size.
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be missing something, but is there a reason we don't have the same "To call this method it is not required that all other data vectors contain valid data, and can even remain empty" blurb here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my mistake, fixed!

@bmagyar
Copy link
Member Author

bmagyar commented Dec 31, 2019

Also, a final comment: Why torque_sensor rather than torque?

For lack of a better alternative, this is how we try to show that this is a read-only value, not something ppl can use for commanding.

@bmagyar
Copy link
Member Author

bmagyar commented Dec 31, 2019

I think I did all the requested changes, back to you ;)

Copy link
Member

@matthew-reynolds matthew-reynolds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reworking the new DifferentialTransmission constructors, with that squared away looks good to me!

Looks good to merge, a couple tiny outstanding things:

  • this comment about actuatorToJointTorqueSensor()'s function comment was not answered
  • this and this comment were marked resolved but the code wasn't updated. Not a big deal, especially if we plan on running a formatter soonish.

Also, a final comment: Why torque_sensor rather than torque?

For lack of a better alternative, this is how we try to show that this is a read-only value, not something ppl can use for commanding.

Got it. Feels a bit inconsistent with absolute_pos, since they're both read-only sensors, but absolute_position_sensor is certainly quite wordy.

Hilario Tome added 2 commits January 2, 2020 18:51
…djust tests

Add pointer accessors for torque sensor and absoute position encoders
@bmagyar
Copy link
Member Author

bmagyar commented Jan 2, 2020

The outstanding ones should be pushed, thanks for spotting them!

@matthew-reynolds
Copy link
Member

👍 Looks great!

@bmagyar
Copy link
Member Author

bmagyar commented Jan 3, 2020

Thanks a lot for the reviews!

@bmagyar bmagyar merged commit f57bf3f into ros-controls:melodic-devel Jan 3, 2020
@matthew-reynolds matthew-reynolds mentioned this pull request Jan 3, 2020
@matthew-reynolds
Copy link
Member

Looking back at this again:

Did something change since pal-robotics-forks/ros_controllers#41 (comment)? From @adolfo-rt in that thread, Feb 2015:

We've come to the conclusion that having controllers for handling joint mode switches is suboptimal

I'm wondering if there has been further discussion since then that prompted the joint_mode_interface to be merged in here, or if it should be pulled it back out.

@bmagyar
Copy link
Member Author

bmagyar commented Feb 8, 2020

It wasn't an accident. After that conclusion, we also came to the realization that companies working with ros_control shouldn't keep internal forks solving this problem which forces them to ship their robots with custom, partially upstream-compatible ROS distributions.

Suboptimal is better than no solution at all.

@matthew-reynolds
Copy link
Member

Got it - Thanks for clarifying :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants