Code Monkey home page Code Monkey logo

urdf-to-kdl's Introduction

urdf-to-kdl

This is a URDF parser with KDL output which is based on ROS stack and code by Wim Meeussen. All I did, was to remove stuff related to ROS.

How to use

add_subdirectory(urdf-to-kdl) # or however you call it
include_directories(${KDL_Parser_INCLUDE_DIRS})
target_link_libraries(KDL_Parser)

To test

Run cmake by passing -DBUILD_TEST=ON. It will create an executable which accepts a urdf as command line argument.

Know issues

  1. This accepts only a path to a urdf file. Loading from server is not supported
  2. cmake lacks install
  3. more?

TODO

  1. Remove unused methods and class members
  2. replace std::cout with std::cerr when needed.
  3. add install to cmake

urdf-to-kdl's People

Contributors

pouya-moh avatar

Stargazers

Sandalots avatar Silvio Traversaro avatar  avatar Stéphane ANCELOT avatar David avatar Nueber avatar Giovanni Franzese avatar Ten Years A Dream avatar  avatar Yang.LUO avatar  avatar Raymond Zuo avatar  avatar

Watchers

James Cloos avatar  avatar

urdf-to-kdl's Issues

How to obtain joint info from urdf which will be used to add segment to KDL chain

i was able to generate the executable using cmake and make.
I am little confused on how will the output from the executable for given urdf will be used in KDL chain for e.g. something like this?


    Chain kdlChain = Chain();

Joint joint1(Joint::None);
Frame frame1 = Frame(Rotation::EulerZYX(0.0, 0.0, -M_PI / 2))*Frame(Vector(0.0, 150.0, 0.0));
kdlChain.addSegment(Segment(joint1, frame1));

what i got was

  • Segment base has 1 children
    • Segment link_0 has 1 children
      • ....

there is no info about joint that i can use from the output of the executable.

if you can share how I can get joint information from urdf that would be helpful.

Thank you.

code won't compile

Hi, I have downloaded your repo and I try to compile it, but I run into an error.
Here is what I have done:
In the urdf-to-kdl/, I run mkdir build
cd build, cmake .. (I also have tried cmake -DBUILD_TEST=ON ..), and then make. The error is here:
/home/yuan/Desktop/urdf-to-kdl/src/kdl_parser.cpp:75:13: error: ‘KDL::Joint kdl_parser::toKdl’ redeclared as different kind of symbol
Joint toKdl(boost::shared_ptrurdf::Joint jnt)
^~~~~
/home/yuan/Desktop/urdf-to-kdl/src/kdl_parser.cpp:69:7: note: previous declaration ‘KDL::Frame kdl_parser::toKdl(urdf::Pose)’
Frame toKdl(urdf::Pose p)
^~~~~
/home/yuan/Desktop/urdf-to-kdl/src/kdl_parser.cpp:75:13: error: ‘boost’ has not been declared
Joint toKdl(boost::shared_ptrurdf::Joint jnt)
^~~~~
/home/yuan/Desktop/urdf-to-kdl/src/kdl_parser.cpp:75:42: error: expected primary-expression before ‘>’ token
Joint toKdl(boost::shared_ptrurdf::Joint jnt)
^
/home/yuan/Desktop/urdf-to-kdl/src/kdl_parser.cpp:75:44: error: ‘jnt’ was not declared in this scope
Joint toKdl(boost::shared_ptrurdf::Joint jnt)
^~~
/home/yuan/Desktop/urdf-to-kdl/src/kdl_parser.cpp:75:44: note: suggested alternative: ‘jnl’
Joint toKdl(boost::shared_ptrurdf::Joint jnt)
^~~
jnl
/home/yuan/Desktop/urdf-to-kdl/src/kdl_parser.cpp:106:24: error: ‘KDL::RigidBodyInertia kdl_parser::toKdl’ redeclared as different kind of symbol
RigidBodyInertia toKdl(boost::shared_ptrurdf::Inertial i)
^~~~~
/home/yuan/Desktop/urdf-to-kdl/src/kdl_parser.cpp:69:7: note: previous declaration ‘KDL::Frame kdl_parser::toKdl(urdf::Pose)’
Frame toKdl(urdf::Pose p)
^~~~~
/home/yuan/Desktop/urdf-to-kdl/src/kdl_parser.cpp:106:24: error: ‘boost’ has not been declared
RigidBodyInertia toKdl(boost::shared_ptrurdf::Inertial i)
^~~~~
/home/yuan/Desktop/urdf-to-kdl/src/kdl_parser.cpp:106:56: error: expected primary-expression before ‘>’ token
RigidBodyInertia toKdl(boost::shared_ptrurdf::Inertial i)
^
/home/yuan/Desktop/urdf-to-kdl/src/kdl_parser.cpp:106:58: error: ‘i’ was not declared in this scope
RigidBodyInertia toKdl(boost::shared_ptrurdf::Inertial i)
^
/home/yuan/Desktop/urdf-to-kdl/src/kdl_parser.cpp:137:24: error: ‘boost’ has not been declared
bool addChildrenToTree(boost::shared_ptr root, Tree& tree)
^~~~~
/home/yuan/Desktop/urdf-to-kdl/src/kdl_parser.cpp:137:42: error: expected primary-expression before ‘const’
bool addChildrenToTree(boost::shared_ptr root, Tree& tree)
^~~~~
/home/yuan/Desktop/urdf-to-kdl/src/kdl_parser.cpp:137:70: error: expected primary-expression before ‘&’ token
bool addChildrenToTree(boost::shared_ptr root, Tree& tree)
^
/home/yuan/Desktop/urdf-to-kdl/src/kdl_parser.cpp:137:72: error: ‘tree’ was not declared in this scope
bool addChildrenToTree(boost::shared_ptr root, Tree& tree)
^~~~
/home/yuan/Desktop/urdf-to-kdl/src/kdl_parser.cpp:137:72: note: suggested alternative: ‘free’
bool addChildrenToTree(boost::shared_ptr root, Tree& tree)
^~~~
free
/home/yuan/Desktop/urdf-to-kdl/src/kdl_parser.cpp:137:76: error: expression list treated as compound expression in initializer [-fpermissive]
bool addChildrenToTree(boost::shared_ptr root, Tree& tree)
^
/home/yuan/Desktop/urdf-to-kdl/src/kdl_parser.cpp: In function ‘bool kdl_parser::treeFromUrdfModel(const urdf::ModelInterface&, KDL::Tree&)’:
/home/yuan/Desktop/urdf-to-kdl/src/kdl_parser.cpp:214:75: error: ‘kdl_parser::addChildrenToTree’ cannot be used as a function
if (!addChildrenToTree(robot_model.getRoot()->child_links[i], tree))
^
CMakeFiles/KDL_Parser.dir/build.make:82: recipe for target 'CMakeFiles/KDL_Parser.dir/src/kdl_parser.cpp.o' failed
make[2]: *** [CMakeFiles/KDL_Parser.dir/src/kdl_parser.cpp.o] Error 1
CMakeFiles/Makefile2:95: recipe for target 'CMakeFiles/KDL_Parser.dir/all' failed
make[1]: *** [CMakeFiles/KDL_Parser.dir/all] Error 2
Makefile:103: recipe for target 'all' failed
make: *** [all] Error 2

Does this package require any additional library? Do you know how to resolve it?

Best
Yuan

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.