Closed PangDaCAT closed 2 years ago
// PINOCCHIO_MODEL_DIR is defined by the CMake but you can define your own directory here.
int main(int argc, char **argv) { //std::cout<<"hello world!"<<std::endl; // You should change here to set up your own URDF file or just pass it as an argument of this example. const std::string urdf_filename = (argc<=1) ? PINOCCHIO_MODEL_DIR + std::string("/urdf/a1.urdf") : argv[1]; pinocchio::Model model; pinocchio::urdf::buildModel(urdf_filename,model); }
you need to add the C++11 flags when compiling your file: g++ -O3 -std=c++11 $(pkg-config --cflags --libs pinocchio) test.cpp -o test
if you file is name test.cpp
This doesn't seem to work.
try2.cpp:(.text.startup+0x68): to'pinocchio::urdf::details::parseRootTree(std::__cxx11::basic_string<char, std::char_traits
The reverse then. You need to use std=c++98
sorry, the same error..
Could you check in the history of issues. Similar issues appear with the trouble.
hello, have you fixed the issue?
Yes, there was no issue on Pinocchio's side. You need to correctly set-up the compilation flags ;)
i got
/usr/bin/ld: /home/swon/swon_ws/devel/.private/admittance/lib/libtorque_hybridadmittance.so: undefined reference to pinocchio::urdf::details::parseRootTree(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, pinocchio::urdf::details::UrdfVisitorBaseTpl<double, 0>&)'
when i catkin build
my ROS workspace
Actually, I tried add_compile_options(-std=c++11)
and set(CMAKE_CXX_FLAGS "-O2 -O3 -std=c++11 -Wall")
and c++11
to c++98
in my cmakelist like you said above but they didn't work...
And i am Pretty sure the problem is from the line pinocchio::urdf::buildModel(urdf_filename,model);
Can you tell me what else should i fix? thank you for your time!
@jcarpent I have complete my message
Your message is incomplete @SwonGao
According to the build from source in Installation Procedure,I installed pinocchio 2.6.4 under ubuntu 18.04. But when I run the example,an error occurred. In the function ‘pinocchio::ModelTpl< double, 0, pinocchio::JointCollectionDefaultTpl>& pinocchio::urdf::buildModel<double, 0, pinocchio::JointCollectionDefaultTpl>(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, pinocchio::ModelTpl<double, 0, pinocchio::JointCollectionDefaultTpl>&, bool)':
/usr/local/include/pinocchio/parsers/urdf/model.hxx:394: for'pinocchio::urdf::details::parseRootTree(std:: cxx11::basic_string<char, std::char_traits, std::allocator> const&, pinocchio::urdf::details::UrdfVisitorBaseTpl<double, 0>&)' undefined reference