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

Support circular joint chains in spec #13

Open
gkjohnson opened this issue Mar 16, 2018 · 3 comments
Open

Support circular joint chains in spec #13

gkjohnson opened this issue Mar 16, 2018 · 3 comments

Comments

@gkjohnson
Copy link

As I mentioned in my other issue, if this isn't the right place for this type of discussion, let me know!

The spec at the moment explicitly forbids the description of parallel kinematics ("The main limitation at this point is that only tree structures can be represented, ruling out all parallel robots"). However, there's nothing about the current format that inherently prevents closed loops links and joints:

<link name="link1" />
<link name="link2" />
<link name="link3" />

<joint name="1to2">
  <parent name="link1" />
  <child name="link2" />
</joint>

<joint name="2to3">
  <parent name="link2" />
  <child name="link3" />
</joint>

<joint name="3to1">
  <parent name="link3" />
  <child name="link1" />
</joint>

This write up on URDF 2.0 states as much, as well. Of course, the burden falls onto the consuming system to properly support the closed loop kinematics.

Would it be possible to just remove this restriction in the spec? Or is there a timeline for when a new revision might support this? I recognize the SDF supports these types of descriptions, but I appreciate the relative simplicity of URDF as opposed to the all-encompassing scene / world description that SDF requires.

Thank you very much!

@carlosjoserg
Copy link

Not sure if it is the right place for discussion either, however, you are right about that point: The spec does not actually prevent closed kinematic loops to be written, as you can build your joints and links as desired.

It is how this file is consumed by basic tools like the robot_state_publisher, which uses the KDL forward kinematic solver for trees, in order to know where your links are everytime, given that the joints are being measured or estimated.

I think that SDF accept such description because the default engine in gazebo is ODE, which treats your robot as a multi-body system and applies joint kinematic constraints to each body's 6 degrees of freedom, which makes it independent of the actual kinematic topology, at the cost of having more variables and equations to deal with. I'm not familiar with other engines, but according to these roscon slides by scpeters, in the 10th slide, DART and Simbody (Bullet as well, but not supported in gazebo at that moment), work with generalized coordinates (which reduces variables and equations to deal with, as you can read form the article as well), but unfortunately not that easy in parallel robots (typical case of closed kinematic loops with not-measured passive joints).

Having said that, you can always write your own robot state publisher, for instance, take a look at this 4-legged delta robot, if you haven't already, where they wrote their own state publisher for inter-linked floating joints.

@ghost
Copy link

ghost commented May 7, 2019

You can refer to:https://github.com/wojiaojiao/pegasus_gazebo_plugins
or http://wiki.ros.org/Angel_jj/closed_loop_plugin
It can help you to solve the issue that URDF not support Closed loop chains.

@gkjohnson
Copy link
Author

@wojiaojiao
Thanks for the links!

I'm actually using the URDF format in web applications that often don't rely Gazebo or ROS at all -- I'm just using the existing format to load the kinematic model into custom operations and engineering tooling. It's currently impossible to properly and completely describe a lot of our systems without support for closed loop links in the format.

I'm a huge fan of standards and love the contained scope and usability of URDF so I'd like to see it support these types of features in the spec and be considered useful outside of the ROS infrastructure.

For a little more context here's the loader I've built for THREE.js to import URDF files into the browser which I'm using to support a variety of robotics projects at the moment. I'd really like to be able to load and constrain our robots that have close loop systems using this:

https://github.com/gkjohnson/urdf-loaders/tree/master/javascript

As it is I'm considering supporting something like a custom <ClosedLink> node in order describe these systems until URDF adds the feature to the spec. Support for such a feature would naturally vary from application to application. I'd be happy if it were even just considered an "extension" to the current URDF spec -- I just want a standardized way to describe it.

Thanks!

dreuter pushed a commit to dreuter/urdf that referenced this issue Jun 2, 2022
* Make urdf plugable

This makes the urdf package load parser plugins.
It includes a new api might_handle() that returns a score for how likely
the plugin is to be the one the given file format is meant for.

This change also makes the urdf xml parser a plugin instead of a special
case that is called directly.

This breaks ABI with urdf::Model because the model now stores the class
loader instance.

Signed-off-by: Shane Loretz<[email protected]>
Signed-off-by: Shane Loretz <[email protected]>

* Restore dependency on urdfdom

Signed-off-by: Shane Loretz <[email protected]>

* Style

Signed-off-by: Shane Loretz <[email protected]>

* Stops crash; not sure why TODO

Signed-off-by: Shane Loretz <[email protected]>

* Add benchmark showing plugin overhead

Signed-off-by: Shane Loretz <[email protected]>

* Whitespace

Signed-off-by: Shane Loretz <[email protected]>

* CMake 3.5

Signed-off-by: Shane Loretz <[email protected]>

* Include <string>

Signed-off-by: Shane Loretz <[email protected]>

* Remove buildtool_export on ament_cmake

Signed-off-by: Shane Loretz <[email protected]>

* exec_depend -> build_export_depend urdfdom headers

Signed-off-by: Shane Loretz <[email protected]>

* Remove commented code

Signed-off-by: Shane Loretz <[email protected]>

* Document urdf_parser_plugin usage

Signed-off-by: Shane Loretz <[email protected]>

* Document PIMPL forward declaration

Signed-off-by: Shane Loretz <[email protected]>

* Alphabetize dependencies

Signed-off-by: Shane Loretz <[email protected]>

* Use tinyxml2 to reduce false positive might_handle()

Signed-off-by: Shane Loretz <[email protected]>

* Update urdf/src/urdf_plugin.cpp

Signed-off-by: Shane Loretz <[email protected]>

Co-authored-by: Chris Lalancette <[email protected]>

* Handle pluginlib exceptions

Signed-off-by: Shane Loretz <[email protected]>

* Return early on failure

Signed-off-by: Shane Loretz <[email protected]>

* Document size_t max is no confidence score

Signed-off-by: Shane Loretz <[email protected]>

* Remove debut print

Signed-off-by: Shane Loretz <[email protected]>

* Move urdfdom_headers comment one line below

Signed-off-by: Shane Loretz <[email protected]>

* Avoid using nullptr in release mode

Signed-off-by: Shane Loretz <[email protected]>

* nonvirtual dtor final class

Signed-off-by: Shane Loretz <[email protected]>

* Use ROS 2 urdfdom_headers

Signed-off-by: Shane Loretz <[email protected]>

* Remove unused exec variable

Signed-off-by: Shane Loretz <[email protected]>

* Skip if xml fails to parse

Signed-off-by: Shane Loretz <[email protected]>

* Make sure test can find pluginlib plugin

Signed-off-by: Shane Loretz <[email protected]>

* Use SHARED instead of module

Fixes OSX failing build
ros/pluginlib#200

Signed-off-by: Shane Loretz<[email protected]>
Signed-off-by: Shane Loretz <[email protected]>

* picked -> chosen

Signed-off-by: Shane Loretz <[email protected]>

* Use pluginlib_enable_plugin_testing()

Signed-off-by: Shane Loretz <[email protected]>

* Define might_handle() return to length of data

Signed-off-by: Shane Loretz<[email protected]>
Signed-off-by: Shane Loretz <[email protected]>

* Return data.size() when not confident

Signed-off-by: Shane Loretz <[email protected]>

* Try urdf when no plugin is confident

Signed-off-by: Shane Loretz <[email protected]>

* ModelImplementation final

Signed-off-by: Shane Loretz <[email protected]>

* Initialize best_plugin to nullptr

Signed-off-by: Shane Loretz <[email protected]>

Co-authored-by: Chris Lalancette <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants