Ask Your Question
0

Catkin_make error while reading a URDF file using parser.cpp

asked 2016-04-10 21:44:21 -0500

Adibot gravatar image

Hello all,

I'm following this tutorial on creating a simple URDF for use in Gazebo:

http://wiki.ros.org/urdf/Tutorials/Pa...

when i try to build the package using catkin_make in the catkin_ws directory, I get the following error:

/home/adi/catkin_ws/src/testbot_description/src/parser.cpp: In function ‘int main(int, char**)’:
/home/adi/catkin_ws/src/testbot_description/src/parser.cpp:14:23: error: ‘testbot’ was not declared in this scope
   if (!model.initFile(testbot.urdf)){
                       ^
make[2]: *** [testbot_description/CMakeFiles/parser.dir/src/parser.cpp.o] Error 1
make[1]: *** [testbot_description/CMakeFiles/parser.dir/all] Error 2
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

Appreciate your help!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2016-04-11 01:45:56 -0500

gvdhoorn gravatar image

The tutorial you link does not instruct you to replace the urdf_file variable name with the name of your urdf file. If you look at the example code, urdf_file is a variable that gets assigned the first parameter given to the program you are creating:

std::string urdf_file = argv[1];

You don't need to replace urdf_file with an actual file name. Just pass it as a parameter when starting the parser program.

PS:

I'm following this tutorial on creating a simple URDF for use in Gazebo

If you just want to create URDFs, and not read or parse them, I'd recommend following the Learning URDF Step by Step tutorials. The Learning URDF tutorials will teach you about the programmatic (C++) interface(s), which is probably not what you are interested int.

edit flag offensive delete link more

Comments

gvdhoorn answer is true, but if you still get problems. Like I did, You could try this

in

CMakeList.txt

change

find_package(catkin REQUIRED )

to

find_package(catkin REQUIRED urdf )

epowerpixi gravatar image epowerpixi  ( 2016-06-12 19:39:16 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-04-10 21:44:21 -0500

Seen: 162 times

Last updated: Apr 11 '16