ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Problem with package structure? Hokuyo not working

asked 2015-02-25 10:38:27 -0500

schultza gravatar image

updated 2015-02-27 04:07:48 -0500

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:="192.168.0.10". 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.

Edit:

  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

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

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

edit retag flag offensive close merge delete

Comments

1

Please update your question description with the exact steps that you are using to build your workspace and run your node.

gvdhoorn gravatar image gvdhoorn  ( 2015-02-26 03:48:00 -0500 )edit
1

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.

gvdhoorn gravatar image gvdhoorn  ( 2015-02-26 03:49:24 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2015-02-26 06:18:55 -0500

gvdhoorn gravatar image
mkdir -p ~/new_hokuyo_test/src
cd ~/new_hokuyo_test/src/

ok.

catkin_init_workspace

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

catkin_make

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/
catkin_make

# 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?

edit flag offensive delete link more

Comments

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:="192.168.0.10") But didnt make any diffrence. The node which i wrote strat but there are no prints

schultza gravatar image schultza  ( 2015-02-26 06:33:38 -0500 )edit

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.

gvdhoorn gravatar image gvdhoorn  ( 2015-02-26 06:43:59 -0500 )edit

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.

gvdhoorn gravatar image gvdhoorn  ( 2015-02-26 06:45:50 -0500 )edit

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

schultza gravatar image schultza  ( 2015-02-26 07:41:45 -0500 )edit

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

schultza gravatar image schultza  ( 2015-02-26 11:32:49 -0500 )edit

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

schultza gravatar image schultza  ( 2015-02-26 11:33:52 -0500 )edit

Okay found it already got a big typo in launch file

schultza gravatar image schultza  ( 2015-02-27 04:07:25 -0500 )edit

Ok, good to hear that you found it. Question answered? :)

gvdhoorn gravatar image gvdhoorn  ( 2015-02-27 04:23:46 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-02-25 10:38:27 -0500

Seen: 1,098 times

Last updated: Feb 27 '15