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

Ssh error - should I change env.sh?

asked 2018-07-19 10:45:24 -0600

AmateurHour gravatar image

updated 2018-07-20 12:17:36 -0600

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 "$@"
edit retag flag offensive close merge delete

Comments

1

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/

Delb gravatar image Delb  ( 2018-07-20 02:27:02 -0600 )edit

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

AmateurHour gravatar image AmateurHour  ( 2018-07-20 10:14:26 -0600 )edit
1

Dialout means that toi have access to the input from/dev si that's normal Have you tried to launch each node separatly ?

Delb gravatar image Delb  ( 2018-07-20 10:20:47 -0600 )edit

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 a No route to host error. (question updated to reflect this)

AmateurHour gravatar image AmateurHour  ( 2018-07-20 10:49:16 -0600 )edit
1

Okay so it's probably @ahendrix 's first suggestion, can you print the value of ROS_MASTER_URIand ROS_HOSTNAME from your pc and the turtlebot please ? (Using echo $ROS_MASTER_URI

Delb gravatar image Delb  ( 2018-07-20 11:57:26 -0600 )edit

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!!

AmateurHour gravatar image AmateurHour  ( 2018-07-20 12:10:45 -0600 )edit

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

AmateurHour gravatar image AmateurHour  ( 2018-07-20 13:54:40 -0600 )edit
1

Can you detail what you changed exactly in /etc/hosts to help other people ?

Delb gravatar image Delb  ( 2018-07-20 14:00:36 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-07-19 20:25:48 -0600

ahendrix gravatar image

Connection refused means that it couldn't establish any connection to the remote machine. There are a few common things that could cause this:

  • Incorrect IP address
  • SSH server isn't running
  • No network connection between computers (cable unplugged, wifi down, etc)

I would start by trying to ssh to the remote machine manually by running:

ssh xxxxx@10.1.xx.xx

Establish that SSH works with that command before you try to troubleshoot roslaunch further.

edit flag offensive delete link more

Comments

Thank you so much for your answer! Yes, ssh user@10.1.xxx.xx works perfectly, where user is the same as what I have stated in my machine tag. Is it possible that I have done the machine tag wrong?

AmateurHour gravatar image AmateurHour  ( 2018-07-19 21:18:35 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2018-07-19 10:45:24 -0600

Seen: 877 times

Last updated: Jul 20 '18