UbiquityRobotics / ubiquity_main

Main documentation as well as other misc files
Other
19 stars 7 forks source link

We should set ROS_HOSTNAME the smart way #231

Closed mjstn closed 4 years ago

mjstn commented 4 years ago

We call /etc/ubiquity/env.sh but we use ROS_HOSTNAME there.

In our new images we should use the 'smart way' of setting ROS_HOSTNAME. I suggest in .bashrc prior to calling env.sh OR in env.sh, your choice but it must be exported properly.

ROS environment

export ROS_HOSTNAME=cat /etc/hostname.local export ROS_MASTER_URI=http://`cat /etc/hostname`.local:11311

If we don't do this a user changing host name on his own gets ros core not starting right.

rohbotics commented 4 years ago

If you look at /etc/ubiquity/env.sh this is all it does.

It's in a separate file instead of in the bashrc for the user that way it can be easily sourced by all users (in case a customer wants multiple users), and also by the startup script, without having to change things in multiple places.