ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org
Ask Your Question
0

installing my ros package

asked 2017-03-14 20:05:54 -0500

Ben12345 gravatar image

I have a python node that takes xbox 360 controller inputs and publishes to cmd_vel topic. This node works fine when the ROS master is running on my laptop.

The robot i've built has a raspberry pi on it which runs the ROS master, and I use my laptop to run RVIZ and the node mentioned above, communicating with the ROS master via wifi. The problem is that i cant run the node on my laptop with the ros master being on the pi.

The comms between the two computers works fine, installed nodes on either work fine. I.e RVIS runs happily on the laptop and i can rostopic echo stuff. But when i try and run the node that i made in the catkin_ws i get something along the lines of the following -

Unable to register with master node [ http://192.168.0.101:11311/ ]: master may not be running yet. Will keep trying.

Every time i reboot my machine i need to source the bash file in devel or whichever one it is (ROS reminds me of a messy university dorm room sometimes), I think this is the problem, as if i try and run a preinstalled node like the teleop key, it can't talk to the ros master. But then if i source ~/.bashrc (which is done by default in every new terminal) it can't find my package, which has my joystick node in it.

My question is, how do i install this package onto my system, much in the same way apt-get does when you install a ros package that way? A google search makes me think rosinstall might be what im after, but trying to find meaningful documentation is like trying to boil water in a chocolate tea pot. As per with anything ROS related.

Cheers in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-03-14 23:38:19 -0500

ahendrix gravatar image

"Installing" a node (or anything else really) is just a matter of copying the right files into the right place. With that in mind, it's not clear why installing your node would make it work better. It'll still be the same program, just in a different place.

It seems like there's something wrong with how you've set the ROS_MASTER_URI on your laptop or with your ROS master, but it's hard to tell because your question contradicts itself. You say that tools like rostopic and rviz work and can communicate with the master, but you also say that your custom node cannot. These should both use the ROS_MASTER_URI and other environment variables in the same way, so it doesn't really make sense that one would work and the other fail.

Is the ROS_MASTER_URI set to the same value for all tools, and is the ROS master running on the PI for all of your tests?

P.S. - if the environment setup seems like a messy dorm room, it's only because you've made a mess of things. If you're using a single workspace, edit your bashrc so that it only sources that workspace on startup, and things should be much cleaner.

Also note that each ROS workspace captures the environment that existed when you built it, and completely overwrites any previous workspace environment variables. If your source /opt/ros/indigo/setup.bash and then build your workspace, when you source the devel/setup.bash in your workspace it will undo any previous ROS environment variables and then set up the environment as if it if had sourced /opt/ros/indigo/setup.bash and then append the directories for your workspace to the environment.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2017-03-14 20:05:54 -0500

Seen: 96 times

Last updated: Mar 14