Ssh error - should I change env.sh?
Hello! I am attempting to ssh into a turtlebot3 from my ubuntu 16.04 and launch turtlebot_bringup after that. Although the ssh is successful, I am getting the following error when the script tries to start the nodes:
error launching on [10.1.xxx.xx-0, uri http://turtlebot:34746/]: No route to host
Launch of the following nodes most likely failed: rosserial_python/serial_node.py, hls_lfcd_lds_driver/hlds_laser_publisher, turtlebot3_bringup/turtlebot3_diagnostics
Here's my launch script:
<launch>
<!-- ssh into bot and launch bringup -->
<!-- Robot1 -->
<!-- may need to remove ns from group tag-->
<group ns="bot1">
<param name="tf_prefix" value="bot1_tf" />
<!-- Machine tag applies to any nodes/includes that come after it in the same scope -->
<!-- default=true sets this machine as the default to assign nodes to within the scope -->
<machine name="bot1" address="10.1.xx.xx" user="xxxxx" password="xxxxxx" default="true" env-loader="~/catkin_ws/devel/env.sh"/>
<!-- Instead of including turtlebot3_robot.launch, include everything that is in it-->
<!-- <include file="$(find turtlebot3_bringup)/launch/turtlebot3_robot.launch"/> -->
<include file="$(find turtlebot3_bringup)/launch/turtlebot3_core.launch"/>
<include file="$(find turtlebot3_bringup)/launch/turtlebot3_lidar.launch"/>
<!-- add machine name to diagnostics? machine="bot1" -->
<node machine="bot1" pkg="turtlebot3_bringup" type="turtlebot3_diagnostics" name="turtlebot3_diagnostics" output="screen" />
</group>
</launch>
Do I need to edit the env.sh file or something along those lines? I am using the standard generated one from catkin_ws/devel. Thanks!
env.sh as it stands currently (all values taken directly from ssh printenv):
#!/usr/bin/env sh
# generated from catkin/cmake/templates/env.sh.in
if [ $# -eq 0 ] ; then
/bin/echo "Usage: env.sh COMMANDS"
/bin/echo "Calling env.sh without arguments is not supported anymore. Instead spawn a subshell and source a setup file manually."
exit 1
fi
# ensure to not use different shell type which was set before
CATKIN_SHELL=sh
# source setup.sh from same directory as this file
_CATKIN_SETUP_DIR=$(cd "`dirname "$0"`" > /dev/null && pwd)
. "$_CATKIN_SETUP_DIR/setup.sh"
export ROS_ROOT=/opt/ros/kinetic/share/ros
export ROS_MASTER_URI=http://10.1.xx.xx:11311
export PYTHONPATH=/home/raspberry/catkin_ws/devel/lib/python2.7/dist-packages:/opt/ros/kinetic/lib/python2.7/dist-packages
export ROS_PACKAGE_PATH=/home/raspberry/catkin_ws/src:/opt/ros/kinetic/share
export ROS_ETC_DIR=/opt/ros/kinetic/etc/ros
export ROS_IP=10.1.xx.xx
source ~/catkin_ws/devel/setup.bash
source /opt/ros/kinetic/setup.bash
export PATH=/home/raspberry/bin:/home/raspberry/.local/bin:/opt/ros/kinetic/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
export ROS_WORKSPACE=/home/catkin_ws
exec "$@"
Have you tried to individually launch the different node listed from the turtlebot ? Then from your PC ? Also try to check the permissions of your sensors/actuators :
ls -l /dev/
Hi there, and thanks for your reply! I used the command suggested and saw that everything on the turtlebot seems to have root access. I did notice that the ports being access for the launch, such as /dev/ttyACM0 and /dev/ttyUSB0 , also have "dailout" next to root instead of root root like the others
Dialout means that toi have access to the input from/dev si that's normal Have you tried to launch each node separatly ?
I have confirmed that I can launch all the nodes individually after ssh-ing into the bot. Also , instead of
connection refused
, I am now getting aNo route to host
error. (question updated to reflect this)Okay so it's probably @ahendrix 's first suggestion, can you print the value of
ROS_MASTER_URI
andROS_HOSTNAME
from your pc and the turtlebot please ? (Usingecho $ROS_MASTER_URI
echo ROS_MASTER_URI returns the same value for bot and pc, and as in env.sh. ROS_HOSTNAME returns nothing, and I have specified ROS_IP in my env.sh file as stated in the bot's printenv. ROS_IP is the same as in the machine tag of my launch file. I edited the question to include env.sh, Thank you!!
Got it figured out! Turns out it was a simple i.p. change that needed to be made in /etc/hosts. Thank you so much for all your suggestions! If anyone else is looking for this, the exact command is
sudo nano /etc/hosts
Can you detail what you changed exactly in
/etc/hosts
to help other people ?