Rosanswers logo

Hey guys,

Sry I can't find a good question name for this :(

I made the last days my first approach of my very first own package. So i looked up a little bit in the forum and found something I could use. I wanted to publish some laser data from my hokuyo laser. So not really publish I just want to print it on my console. Yesterday I made it to work, but today i started my pc and nothing worked so far. You can review the "package" here link to github.

As I said it my very first test but somehow if I let it run via eclipse nothing happens. The hokuyo itself works I can connect with it via rosrun urg_node urg_node _ip_address:="". I just cant figure out what happend maybe some problems in my structure or in my CMakeLists.txt or smth like this? maybe you can help me.


  1. mkdir -p ~/new_hokuyo_test/src

  2. cd ~/new_hokuyo_test/src/

  3. catkin_init_workspace 3.* cd ..

  4. catkin_make

  5. cd src/

  6. catkin_create_pkg hokuyo_test_pkg std_msgs roscpp rospy

  7. cd ~/new_hokuyo_test/

  8. catkin_make

  9. Uncommented some stuff (like add executable etc) in CMakeLists.txt (see github)

  10. catkin_make (just to test)

  11. added hokuyo_test_pkg_node.cpp in src of hokuyo_test_pkg

  12. catkin_make in ws directory

  13. source devel/setup.bash

  14. rosrun hokuyo_test_pkg hokuyo_test_pkg_node

Thats it basically

Edit2: The launch file

<node pkg="urg_node" type="urg_node" name="urg_node"> 
<param name="ip_address" value="" />
<node pkg="hokuyo_test_pkg" type="hokuyo_test_pkg_node" name="hokuyo_test_pkg_node" output="screen">

Thanks for helping me, I know these are really beginner questions but anyways I am struggling with it and really try by myself to solve it and dont (maybe looks like :) ) post it instantly here. So Thank you for great help here

Originally posted by schultza on ROS Answers with karma: 232 on 2015-02-25

Post score: 0

Original comments

Comment by gvdhoorn on 2015-02-26:
Please update your question description with the exact steps that you are using to build your workspace and run your node.

Comment by gvdhoorn on 2015-02-26:
Also: we normally only commit the package directory itself to a github repository, not the entire catkin workspace (and especially not the devel directory). We can recreate the workspace and build it ourselves quite easily.


1 Answer 1


Rosanswers logo

mkdir -p ~/new_hokuyo_test/src
cd ~/new_hokuyo_test/src/



you don't need this, catkin_make will do all that is needed for you on first invocation.


I think you forgot a cd .. before catkin_make?

cd src/
catkin_create_pkg hokuyo_test_pkg std_msgs roscpp rospy
cd ~/new_hokuyo_test/

# Uncommented some stuff (like add executable etc) in CMakeLists.txt (see github)

catkin_make (just to test)
added `hokuyo_test_pkg_node.cpp` in `src` of `hokuyo_test_pkg`
catkin_make in ws directory
source devel/setup.bash
rosrun hokuyo_test_pkg hokuyo_test_pkg_node

And at this point you have the urg_node already running in another terminal? And a roscore?

Originally posted by gvdhoorn with karma: 86574 on 2015-02-26

This answer was ACCEPTED on the original site

Post score: 2

Original comments

Comment by schultza on 2015-02-26:
No the cd .. i just forgot to write it. edited. I got an roscore running yea, but not the urg_node is it needed? I tried it with urg node running (rosrun urg_node urg_node _ip_address:="") But didnt make any diffrence. The node which i wrote strat but there are no prints

Comment by gvdhoorn on 2015-02-26:
How do you expect your test node to print anything, if there is no node that publishes those LaserScan messages? So yes, you need to start all three: roscore, urg_node and your own node. You might want to use a launch file for that.

Comment by gvdhoorn on 2015-02-26:
After you've started the urg_node, use rostopic list in another terminal (where you've also sourced devel/setup.bash) to see if it is actually publishing on the topic you expect. If it is, use rostopic echo /TOPIC_NAME to make sure there are actually msgs being published.

Comment by schultza on 2015-02-26:
You are right :) I started the urg_node which is publishing the /scan (which I am want to subscribe to) and also others like /echoes. So if I rostopic echo /scan I dont see anything, however if I rostopic echo /echoes I can see some data

Comment by schultza on 2015-02-26:
So ok, somehow it works, I didnt change anything. :( Can't explain why, maybe I missed starting the urd_node sometimes or started the other node too early. Anyways I am happy that its working now. Thank you for your help!!! There is one thing left,I dont know if I should open a new question for this

Comment by schultza on 2015-02-26:
I tried writing the launch file you mentioned. But it doesnt find my node: Error message here: ERROR: cannot launch node of type [hokuyo_test_pkg/hokuyo_test_package_node]: can't locate node [hokuyo_test_package_node] in package [hokuyo_test_pkg] I added the launch file in the question

Comment by schultza on 2015-02-27:
Okay found it already got a big typo in launch file

Comment by gvdhoorn on 2015-02-27:
Ok, good to hear that you found it. Question answered? :)

Comment by schultza on 2015-02-27:
yes :) Thank you very much for help an patience :)


Your Answer

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