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

Network settings not saving permanently.

asked 2014-07-11 10:34:43 -0500

choog gravatar image

updated 2014-07-11 10:35:27 -0500

Hi, I set up my ubuntu laptops to network with each other following the ROS/NetworkSetup tutorials http://wiki.ros.org/turtlebot/Tutoria... . Now, I was trying to set the localhost computer to be the ROS_MASTER_URI and ROS_HOSTNAME. I've tried both of this things:

$ > echo export ROS_MASTER_URI=http://localhost:11311 >> ~/.bashrc
$ > echo export ROS_HOSTNAME=localhost >> ~/.bashrc

Also I have tried,

$ export ROS_HOSTNAME=localhost
$ export ROS_MASTER_URI=http://localhost:11311

Both of them allow me to set the configuration for the first time I bringup anything. But after the first run, my settings go back to other ubuntu laptop that I have, which is 10.1.xx.xxx .

Any help is appreciated

edit retag flag offensive close merge delete

Comments

I think this needs some clarification. After your first run, when you are sure that the problem is present, can you run cat ~/.bashrc and post the results ?

ccapriotti gravatar image ccapriotti  ( 2014-07-11 12:32:47 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted
1

answered 2014-07-11 11:13:17 -0500

donmrsir gravatar image

You should check what is in your .bashrc file, and make sure that you are only setting one master and one host. Also the ROS NetworkSetup tutorial will give you further information.

edit flag offensive delete link more

Comments

Do you know what directory this .bashrc file is in? I tryed looking for it but no luck

choog gravatar image choog  ( 2014-07-11 11:39:09 -0500 )edit
1

Its in your home directory, try to enable the view of hidden files (ctrl-h should do this for you) . Other option is to open it from the terminal with a text editor, for example with the command $ vim .bashrc

donmrsir gravatar image donmrsir  ( 2014-07-11 11:56:29 -0500 )edit

It is still not saving permantly, I have tried all the different ways possible. I am also unsure if I have a source instalation or a deb installation. How can I know?

choog gravatar image choog  ( 2014-07-11 15:25:35 -0500 )edit

Sorry i dont know what you are talking about. As i understand it, when you open a new terminal ubuntu run the bashrc script. So if you set in the script the network configuration, it shoud be set every time you open a terminal. Maybe you should modify the etc/network files in ubuntu, you should search some imformation about this before you change something.

donmrsir gravatar image donmrsir  ( 2014-07-12 13:34:34 -0500 )edit
1

answered 2014-07-11 10:44:38 -0500

dornhege gravatar image

Do NOT set ROS_HOSTNAME=localhost. This is almost surely not correct. ROS_HOSTNAME is the hostname that the ros master uses to connect other (remote) nodes to this machine. If they connect to what they know as localhost, it clearly won't work.

The tutorial you linked to seems to do things correctly.

edit flag offensive delete link more

Comments

I want to set things to run on the local machine not remotely.

choog gravatar image choog  ( 2014-07-11 11:38:43 -0500 )edit

Then just don't set those things. The ROS defaults work locally.

dornhege gravatar image dornhege  ( 2014-07-14 09:35:08 -0500 )edit
0

answered 2014-07-15 10:22:33 -0500

choog gravatar image

For anyone that is running ROS groovy and needs to configure a turtlebot and a workstation. If you are having problems with the tutorials on the ROS website just follow this steps:

What needs to be done in order to change the ROS_MASTER_URI and ROS_HOSTNAME is simply edit the .bashrc and .bashrc~ files on both computers. Also note that .bashrc and .bashrc~ are two seperate files. The way ubuntu was setup on both laptops I could easily access the .bashrc file by clicking on the file explorer and on the home directory typing crtl+h to view hidden files. Thanks to donmrsir.

However the .bashrc~ file had to be opened up through the terminal using a command line text editor.

On the turtlebot laptop just add to the end of both of the files:

export ROS_MASTER_URI=http://ip_address_of_turtlebot:11311
export ROS_HOSTNAME=ip_address_of_turtlebot

On the Workstation:

export ROS_MASTER_URI=http://ip_address_of_turtlebot:11311
export ROS_HOSTNAME=ip_address_of_workstation

the ip address can be retrieved by launching ifconfig on the ubuntu terminal and looking at the wlan0 adapter: and look at the int addr: attribute.

edit flag offensive delete link more

Comments

2

Two points: the file .bashrc~ is NOT executed. the TILD in the end means it is a temp file generated by a text editor.Second, on an earlier post you stated that you wanted "to run on the local machine...". Clearly it is not the case if you have the robot and a workstation, and need to exchange data.

ccapriotti gravatar image ccapriotti  ( 2014-07-15 14:57:21 -0500 )edit

Yes I know that's what the tild is for, but I had change the values in that .bashrc~ file in order for the laptops to work together. For point 2, yeah exactly that is why this is a seperate question because I know that my other question was only pertaining to run locally on one pc.

choog gravatar image choog  ( 2014-07-15 19:30:24 -0500 )edit
1

Changing things in .bashrc~ should do nothing. As @ccapriotti said, it's a temp file, probably from gedit or similar. You either interpreted the effect wrong or have something set up horribly wrong.

dornhege gravatar image dornhege  ( 2014-07-16 06:11:21 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-07-11 10:34:43 -0500

Seen: 2,094 times

Last updated: Jul 15 '14