roboticslibrary / rl

The Robotics Library (RL) is a self-contained C++ library for rigid body kinematics and dynamics, motion planning, and control.
https://www.roboticslibrary.org/
BSD 2-Clause "Simplified" License
915 stars 213 forks source link

run the first applications #31

Open csufangyu opened 3 years ago

csufangyu commented 3 years ago

hi when i use your first applications on https://www.roboticslibrary.org/tutorials/first-steps-linux/,I get a error :+1: error: cannot dynamic_cast ‘rl::mdl::Factory::create(const string&)(std::__cxx11::basic_string(((const char)"/usr/share/rl-0.7.0/examples/rlmdl/unimation-puma560.xml"), std::allocator()))’ (of type ‘class std::shared_ptr’) to type ‘class rl::mdl::Kinematic’ (source is not a pointer) rl::mdl::Kinematic kinematics = dynamic_cast<rl::mdl::Kinematic>(factory.create("/usr/share/rl-0.7.0/examples/rlmdl/unimation-puma560.xml"));

could you help me?thanks very much

csufangyu commented 3 years ago

change : std::shared_ptr<rl::mdl::Kinematic> kinematics = std::dynamic_pointer_cast<rl::mdl::Kinematic>(factory.create("/usr/share/rl-0.7.0/examples/rlmdl/unimation-puma560.xml")); is ok!

rickertm commented 3 years ago

Thank you for pointing this out. I have updated the tutorials with code that should work for both the 0.7 and master branch.