Prefence:
This document describes how can you launch roslaunch file to run remote machine running ROS nodes.
The following requires you need to meet:
- Local machine
- Remote machine
- ROS_MASTER_URL
1. Build SSH Connection Between Local And Remote:
The way roslaunch-nodes works, needs a valid ssh-connection between the local and the remote machines. To ensure connection, create an authorized-key:
1 | # 1. Creat an ssh-key on local machine.(Because ros node ssh not the linux ssh, so it must choose rsa way.) |
2. Create An Env-loader Script:
Due to the automated nature of ROS launch, it avoids executing the user’s .bashrc on the remote nodes and requires an envirnoment file to assign remote environment variables.
Let’s assume that we need to create env-loader for a workspace located under /home/nvidia/workspace
:
The following is an example of the env-loader script:
1 |
|
Finally save the above created env-loader script on the remote-machine. Let’s assume that we saved the above mentioned env-loader script into /home/nvidia/workspace/devel/remote_env_loader.sh
.
3. Create The Roslaunch File:
The following example configure:
1 | <launch> |
5. Allow Remote Docker SSH:
First step install openssh-server
1
apt-get install openssh-server
If you docker run images with parameter ‘–net=host’, the local host ports are your container ports. So you need to change ssh port to connect container.
1
2
3
4
5
6
7
8
9
10
11vim /etc/ssh/sshd_config
########################
# 1. Change Port 22 to Your port.
Port 22 --> Port 22333
# 2. Change PermitRootLogin to yes.
PermitRootLogin prohibit-password --> PermitRootLogin yes
# 3. If you want to connect container without root password, change PermitEmptyPasswords to yes.
PermitEmptyPasswords no --> PermitEmptyPasswords yes
If docker container's root need password to connect, please set new password.
1
2
# Input the root password.
passwd root
Finally, restart ssh service. `service ssh restart`
If you docker run images without parameter ‘–net=host’, you need to set the port.
1
2# <local-host-port>:<container-ssh-port>
docker run -p 22333:22 <image>