0
$\begingroup$

Rosanswers logo

I have managed to solve most of my problems, but the missing thing with me is with the CMakeLists.txt of the hand_pub. (BTW should I edit it for the hand_urdf ??) I have added the following in my CMakeLists.txt, is there any thing I should add?

find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs) catkin_package() include_directories(include ${catkin_INCLUDE_DIRS}) > add_executable(state_publisher > state_publisher.cpp) > target_link_libraries(state_publisher > ${catkin_LIBRARIES})

Because I am getting an error when trying catkin_make. I am not sure if my cpp file is wrong or it is not able to compile at all.

my old post:

I have finished my URDF file and saved it in catkin_ws/src/hand/hand_urdf/urdf (its name is hand.urdf) I was able to open it in rviz using :

roslaunch urdf_tutorial display.launch model:=Hand.urdf gui:=True

(the current directory being the one stated above) and everything works and I can move the hand and everything using the state_publisher gui. Then I worked on the state_publisher, I did the state_publisher.cpp and saved it in catkin_ws/src/hand/hand_pub and wrote a launch file called display.launch and saved it in catkin_ws/src/hand/hand_pub/launch I think I have something wrong with my launch file which is:

My question is do I have something wrong with the directories? Do I have something wrong with my launch file? Most importantly how do I run everything together from terminal (I think that I have to run the launch file but what is the exact command for that) i.e. for the urdf I called roslaunch urdf_tutorial display.launch model:=Hand.urdf gui:=True.


Originally posted by Kaddoura on ROS Answers with karma: 1 on 2014-07-24

Post score: 0


Original comments

Comment by David Lu on 2014-07-25:
If you are getting an error, please post the error.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

You also need to upload the urdf to the parameter server. Do this by adding the following line to your launch file.

<param name="robot_description" textfile="$(find hand_urdf)/urdf/hand.urdf" />

(assuming that I'm reading your directories correctly)


Originally posted by David Lu with karma: 10932 on 2014-07-24

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Kaddoura on 2014-07-24:
Thank you for your help, now I am getting an error when compiling the state_publisher.cpp file using CMakeLists, please check my post after I edited it and see if you can help me.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.