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

Building a node

asked 2015-01-12 11:13:27 -0600

dshimano gravatar image

updated 2015-01-13 10:29:03 -0600

Hello, very basic question. I just wrote some nodes to (hopefully) turn a servo with a joystick. I used catkin_create_pkg to make a package in the src folder. Then I used catkin_make to make the package. I made a directory in there, and pasted my two python codes. I used catkin_make again. These are the same steps as in the publisher tutorial. when I try to run my nodes, I get

: No such file or directory

Is there a step I'm missing. I know in the ros tutorials there is alot in the Creating a ROS msg and srv tutorial I didn't understand.

Thanks for the help.

The exact command I ran is

donni@donni-VirtualBox:~/catkin_ws/src/pi_servo/scripts$ rosrun pi_servo servo_listener.py
: No such file or directory

When I run grep

donni@donni-VirtualBox:~$ env|grep ROS
ROS_ROOT=/opt/ros/indigo/share/ros
ROS_PACKAGE_PATH=/opt/ros/indigo/share:/opt/ros/indigo/stacks
ROS_MASTER_URI=http://localhost:11311
ROSLISP_PACKAGE_DIRECTORIES=
ROS_DISTRO=indigo
ROS_ETC_DIR=/opt/ros/indigo/etc/ros

I don't think that looks wrong.

edit retag flag offensive close merge delete

Comments

It will help us if you edit your question to add the exact command you ran, and the result of env|grep ROS command to see what's going on.

130s gravatar image 130s  ( 2015-01-12 14:25:02 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2015-01-13 10:51:11 -0600

130s gravatar image

updated 2015-01-13 10:52:26 -0600

ROS_PACKAGE_PATH=/opt/ros/indigo/share:/opt/ros/indigo/stacks

This indicates sourcing devel/setup.bash did not work as expected. ROS_PACKAGE_PATH must contain the path of your catkin workspace in order for your executables to be found by ROS.

I just added a passage to the create catkin workspace tutorial.

To make sure your workspace is properly overlayed by the setup script, make sure ROS_PACKAGE_PATH environment variable includes the directory you're in.

    $ echo $ROS_PACKAGE_PATH
    /home/youruser/catkin_ws/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks

So in your case, I suggest to make sure you build and source properly. You can try again by removing the built artifact (see Cleaning up) and run catkin_make, and source the setup.

edit flag offensive delete link more
0

answered 2015-01-12 11:30:30 -0600

A.M Dynamics gravatar image

updated 2015-01-12 11:33:32 -0600

If you wrote your node by python, you should make it executable. Did you do that? and did you include your directory in bash file?

edit flag offensive delete link more

Comments

Yes it is executable. What does it mean to include your directory in bash file?

dshimano gravatar image dshimano  ( 2015-01-12 12:25:59 -0600 )edit

I mean ROS should see your package. Use this command and put it in the bash file: source ~/your catkin workspace/devel/setup.bash

A.M Dynamics gravatar image A.M Dynamics  ( 2015-01-12 13:23:34 -0600 )edit

Yes, I have sourced the package I think. I ran the command you wrote, as well as source devel/setup.bash. I'm not sure what's wrong.

dshimano gravatar image dshimano  ( 2015-01-13 10:19:01 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2015-01-12 11:13:27 -0600

Seen: 687 times

Last updated: Jan 13 '15