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

ROS build a package but can't run

asked 2015-12-29 03:38:21 -0500

Terry Su gravatar image

updated 2015-12-29 05:59:58 -0500

Hello ROS users,

I build a workspace folder which called jade_workspace in the home directory. In the jade_workspace folder, there are 3 files here which are the "setup.bash" , "setup.sh" , "setup.zsh", and I also create a folder here called sandbox.

In the sandbox, I want to create a package calls "beginner_tutorials", and I use the command as "roscreate-pkg beginner_tutorials std_msgs rospy roscpp" , after that, I use "rosmake beginner_tutorials" to build some data in this folder.

After that, because I run the example of "Creating a ROS Package" and "Writing a Simple Publisher and Subscriber (C++)", and I can run the talker and listener successfully in the example. I copy the file of "talker","listener" and "CMakeLists.txt" , "package.xml" to the jade_workspace's beginner_tutorials folder.

And after I source it and ran the talker, it shows the error as below: [rosrun] Couldn't find executable named talker below /home/terry/jade_workspace/sandbox/beginner_tutorials

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2015-12-29 03:51:52 -0500

Sounds like your workspace does not have the correct folder structure.

Part 4 on this page http://wiki.ros.org/ROS/Tutorials/Ins... tells you how to set up a workspace with the correct folder structure.

edit flag offensive delete link more

Comments

Hello Ntckw, I followed the "rosbuild"part of part 4 of your link, I think my path is right, but it can't be executed,too. I put my terminal reply in the next

Terry Su gravatar image Terry Su  ( 2015-12-29 06:32:15 -0500 )edit
  1. terry@terry-All-Series:~$ source ~/jade_workspace/setup.bash
  2. terry@terry-All-Series:~$ cd ~/jade_workspace/sandboxterry
  3. @terry-All-Series:~/jade_workspace/sandbox$ rospack find beginner_tutorials: /home/terry/jade_workspace/sandbox/beginner_tutorials
Terry Su gravatar image Terry Su  ( 2015-12-29 06:33:16 -0500 )edit
  1. terry@terry-All-Series:~/jade_workspace/sandbox$ printenv | grep ROS
  2. ROS_ROOT=/opt/ros/jade/share/ros
  3. ROS_PACKAGE_PATH=/home/terry/jade_workspace/sandbox:/opt/ros/jade/share:/opt/ros/jade/stacks
  4. ROS_MASTER_URI=http://localhost:11311
  5. ROS_WORKSPACE=/home/terry/jade_workspace
Terry Su gravatar image Terry Su  ( 2015-12-29 06:34:17 -0500 )edit
  1. ROSLISP_PACKAGE_DIRECTORIES=
  2. ROS_DISTRO=jade
  3. ROS_ETC_DIR=/opt/ros/jade/etc/ros
Terry Su gravatar image Terry Su  ( 2015-12-29 06:34:51 -0500 )edit

The sandbox folder is not part of the usual folder layout for a workspace (unless it is the name of a package that you have created, but that would be in the src folder). I would expect the setup files to be in folder called devel inside your workspace if initialising the workspace had run correctly

nickw gravatar image nickw  ( 2015-12-29 06:50:15 -0500 )edit

I just realised you are using rosbuild, I misread the title,sorry. Thats why you have a sandbox folder. Unless you need to use rosbuild for backwards compatibility with something it is more common to use catkin now.

nickw gravatar image nickw  ( 2015-12-29 08:54:02 -0500 )edit

Now, I use the catkin instead of rosbuild. It is easier. But in any case, thank you.

Terry Su gravatar image Terry Su  ( 2015-12-29 21:15:27 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-12-29 03:38:21 -0500

Seen: 863 times

Last updated: Dec 29 '15