Coder Social home page Coder Social logo

Comments (7)

sbarthelemy avatar sbarthelemy commented on July 19, 2024

So, the urdf::Rotation internally stores rotations as quaternions, and has the following methods:

  • getQuaternion
  • setFromQuaternion
  • getRPY
  • setFromRPY

Given that the URDF xml represents rotations as RPY angles, I wonder why urdf::Rotation does not uses RPY internally too.

1/ Shall I propose a patch which changes that? (not really needed)

Then, regarding the RPY/quaternion problem, we could probably fix it by removing the custom code and using Eigen (see [a] and [b])

This could be done by either

2/ replacing urdf::Rotation with the equivalent Eigen class (with a typedef or so), or

3/ keeping the present interface but useing Eigen as a backend (so Eigen would be a build dep but not a runtime dep)

what do you think?

[a] http://eigen.tuxfamily.org/dox/group__Geometry__Module.html#gad118fececd448d7485ffea4858775e5a
[b] http://eigen.tuxfamily.org/dox/group__TutorialGeometry.html

from urdfdom.

traversaro avatar traversaro commented on July 19, 2024

My 2 cents: if we really want to add Eigen as dependency, I'll strongly suggest going for option (3): Eigen is an heavily template library and for properly exporting an Eigen datatype it in the shared library interface the compiler have to generate all the code relative to the used instantiation of the template class, resulting in large binaries.

from urdfdom.

traversaro avatar traversaro commented on July 19, 2024

An alternative to the use of Eigen could be porting some relevant code to the urdf::Rotation class (Gazebo for example has a similar class [1], but I don't know if it is affected by the same numerical problem). This leads to a bit of code duplication, but does not add any new dependency to urdfdom.

[1] : http://ignitionrobotics.org/libraries/ign_math/api/classignition_1_1math_1_1Quaternion.html

from urdfdom.

vrabaud avatar vrabaud commented on July 19, 2024

@hsu , it seems that code comes from Gazebo that has the same problem:
https://bitbucket.org/osrf/gazebo/src/66de1887edea28bec5d8b94de5e74f035ac53cc0/gazebo/math/Quaternion.cc?at=default#cl-257

from urdfdom.

scpeters avatar scpeters commented on July 19, 2024

Gazebo developer here; @j-rivero and I will look into adding that unit test to the gazebo math library.

We've thought about eigen but don't have any short-term plans to incorporate it into the default gazebo math library. Gazebo can optionally link with the dartsim physics engine, but that's currently the only connection with eigen that I know of.

from urdfdom.

j-rivero avatar j-rivero commented on July 19, 2024

By the way, gazebo6 has split out the math layer and create a common library for it, called ignition robotics math. Eventually, I agree with @traversaro, it would be nice to use Eigen as a backend.

from urdfdom.

scpeters avatar scpeters commented on July 19, 2024

fixed by ros/urdfdom_headers#11

from urdfdom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.