0
$\begingroup$

Rosanswers logo

I tried writing the simple publisher and subscriber using the tutorial, but seem to have some problem finding the workspace and packages using ros... I've source it like a million times.. and I still can't find it...

what am I doing wrong?? Workspace uploaded here: https://www.dropbox.com/s/ip6qm3lc40v93nz/pubsub_ws.zip?dl=0


Originally posted by 215 on ROS Answers with karma: 156 on 2015-02-16

Post score: 0


Original comments

Comment by gpldecha on 2015-02-16:
Can you cd to the directory of your ros-project (which is located in path/catkin_ws/src/) and try and launch the file from within it. If not to go to the location of the launch file of your project and do:$ roslaunch project.launch

Comment by marguedas on 2015-02-16:
To confirm that your workspace is successfully sourced you can run just "roscd". you should end up in the workspace/devel folder. To update the list of packages you need to run "rospack profile" Please refer to this answer for more detail

Comment by 215 on 2015-02-18:
I am able to cd it, but there is no launch file.
Roscd doesn't show the ws.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I downloaded your workspace. It seems that some things haven't been initialized properly. If I source it and type roscd I end up in pubsub_ws/devel. But I cannot roscd the packages. Can you run the following ?
cd ~/pubsub_ws
rm -rf build/ devel/ install/ src/CMakeLists.txt
cd src catkin_init_workspace
catkin_make
source devel/setup.bash rospack profile
roscd commands

Explaination : When I ran rospack profile I never saw yiur workspace showing in the list. So your packages were never in the $ROS_PACKAGE_PATH. To fix it you need to reinitialize your workspace. then rebuild it and update your package list (the list of commands above).Then everything should be working.


Originally posted by marguedas with karma: 3606 on 2015-02-18

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by 215 on 2015-02-18:
I keep getting these error when i create a new workspace I can't see what I am doing wrong.. Usually when i create a workspace i do this..

http://pastebin.com/2dPnwmhv

I then add my .cpp files in src directory and run catkin_make and then should rosrun be able run.. which is not the case..

Comment by marguedas on 2015-02-18:
you still cannot roscd your workspace ? can you post the output of all the commands above ? and output of pwd after running "roscd" alone ?

Comment by 215 on 2015-02-19:
no errors occurs... why can't i run rosrun....

Comment by marguedas on 2015-02-19:
If you don't give more info we can't help you... What do you mean by no error ? can you post the output of all the commands above ? and output of pwd after running "roscd" alone ?

Comment by 215 on 2015-02-19:
roscd cannot find it

Comment by marguedas on 2015-02-19:
Can you paste the output of: "rospack profile"
"echo $ROS_PACKAGE_PATH"
and "roscd" ?
Please

$\endgroup$

Your Answer

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