Ask Your Question
0

No such file or directory when running "rosrun beginner_tutorials add_two_ints_server.py" [closed]

asked 2016-06-01 04:16:51 -0500

KTChen gravatar image

updated 2016-06-02 04:26:15 -0500

gvdhoorn gravatar image

Hi, everyone!

I follow the tutorial "Writing a Simple Service and Client (Python)" and "Creating a ROS msg and srv".

When I running

rosrun beginner_tutorials add_two_ints_server.py

with tab key, the terminal shows

No such file or directory

However, the tab key is work and I can find the file in the directory.

Moreover, I finish the the tutorial "Creating a ROS msg and srv".

I succesfully get same response as the tutorials say from typing rosmsg show beginner_tutorials/Num and rossrv show beginner_tutorials/AddTwoInts in command line.

Also, I used chmod +x scripts/add_two_ints_server.py to make the node executable, catkin_make install is done.

Cloud someone tell me what is wrong?


Edit: thank you. I try the following method, but still not work. The directory tree of my work space is

oms@oms:~/catkin_ws/src/beginner_tutorials$

And I do this:

oms@oms:~/catkin_ws$ catkin_make
Base path: /home/oms/catkin_ws
Source space: /home/oms/catkin_ws/src
Build space: /home/oms/catkin_ws/build
Devel space: /home/oms/catkin_ws/devel
Install space: /home/oms/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/oms/catkin_ws/build"
####
####
#### Running command: "make -j2 -l2" in "/home/oms/catkin_ws/build"
####
[  0%] Built target _beginner_tutorials_generate_messages_check_deps_Num
[  0%] Built target std_msgs_generate_messages_lisp
[  0%] [  0%] Built target _beginner_tutorials_generate_messages_check_deps_AddTwoInts
Built target std_msgs_generate_messages_cpp
[  0%] Built target std_msgs_generate_messages_py
[ 25%] Built target beginner_tutorials_generate_messages_lisp
[ 50%] Built target beginner_tutorials_generate_messages_cpp
[100%] Built target beginner_tutorials_generate_messages_py
[100%] Built target beginner_tutorials_generate_messages
oms@oms:~/catkin_ws$ source /home/oms/catkin_ws/devel/setup.bash
oms@oms:~/catkin_ws$ rosrun beginner_tutorials add_two_ints_server.py
> : No such file or directory

I type

tree /home/oms/catkin_ws/src/

then get

/home/oms/catkin_ws/src/
├── beginner_tutorials
│   ├── CMakeLists.txt
│   ├── include
│   │   └── beginner_tutorials
│   ├── msg
│   │   └── Num.msg
│   ├── package.xml
│   ├── package.xml~
│   ├── scripts
│   │   ├── add_two_ints_client.py
│   │   ├── add_two_ints_client.py~
│   │   ├── add_two_ints_server.py
│   │   ├── add_two_ints_server.py~
│   │   ├── listener.py
│   │   ├── listener.py~
│   │   ├── talker.py
│   │   └── talker.py~
│   ├── src
│   └── srv
│       └── AddTwoInts.srv
├── CMakeLists.txt -> /opt/ros/indigo/share/catkin/cmake/toplevel.cmake
└── one
    ├── CMakeLists.txt
    ├── include
    │   └── one
    ├── msg
    │   └── Num.msg
    ├── package.xml
    ├── package.xml~
    ├── scripts
    │   ├── add_two_ints_client.py
    │   ├── add_two_ints_client.py~
    │   ├── add_two_ints_server.py
    │   └── add_two_ints_server.py~
    ├── src
    └── srv
        └── AddTwoInts.srv

14 directories, 23 files

Sorry about that, I don't know how to change the format of above words to make it more clearly.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2018-09-19 17:22:02.551765

Comments

Have done "source /path/to/your/workspace/devel/setup.bash" ?

siddhesh gravatar image siddhesh  ( 2016-06-01 05:59:16 -0500 )edit

Thank you. I try it, but my rospy node still not work. I edit my question for adding what I type and what I get.

KTChen gravatar image KTChen  ( 2016-06-01 19:44:41 -0500 )edit

Perhaps, if you did catkin_make install you have to source install space, not devel.

Boris gravatar image Boris  ( 2016-06-02 04:23:29 -0500 )edit

After I trying source install/setup.bash, the tab key is not work. Then, I get

[rosrun] Couldn't find executable named add_two_ints_server.py below /home/oms/catkin_ws/install/share/beginner_tutorials

KTChen gravatar image KTChen  ( 2016-06-02 04:42:02 -0500 )edit

Finally, I try this tutorial again without copy and paste the rospy code. I type the code my self and rospy node is work now. However, the original package I made still does not work and I do not know why. Thank you all for these helps.

KTChen gravatar image KTChen  ( 2016-06-05 00:54:18 -0500 )edit

2 Answers

Sort by » oldest newest most voted
0

answered 2016-06-01 05:59:10 -0500

gvdhoorn gravatar image

Did you remember to source /path/to/your/catkin_ws/devel/setup.bash after building with catkin_make and before trying to rosrun?

edit flag offensive delete link more

Comments

Thank you. I have tried it, but the node still not work. I add what I try in the original question. Could you tell me what is wrong in my work?

KTChen gravatar image KTChen  ( 2016-06-01 19:49:48 -0500 )edit

Please add the output of tree /home/oms/catkin_ws/src to your question (use the edit button/link).

gvdhoorn gravatar image gvdhoorn  ( 2016-06-02 02:43:57 -0500 )edit
0

answered 2017-04-13 10:16:11 -0500

I know this is an old question but I have the same problem and it turn out to be the end of line problem. Apparently the linux and window EOL is different.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-06-01 04:16:51 -0500

Seen: 1,638 times

Last updated: Jun 02 '16