Setting Up Networking¶
First Connection¶
In order to set up Warthog to connect to your own wireless network, you will first need to ssh
access Warthog’s computer from you computer over a wired connection:
Configure your computer to have a static IP address on the
192.168.131.x
subnet, e.g.192.168.131.100
.Connect an ethernet cable between Warthog’s computer and your computer.
ssh
into Warthog’s computer from your computer. In your computer’s terminal, run:
ssh administrator@192.168.131.1
Enter the default password
clearpath
. You should now be logged into Warthog as theadministrator
user.
Changing the Default Password¶
Note
All Clearpath robots ship from the factory with their login password set to clearpath
. Upon receipt of your robot we recommend changing the password.
To change the password to log into your Warthog, you can use the
passwd
command. In Warthog’s computer’s terminal, run:
passwd
You will be prompted to enter the current password, followed by the new password twice. While typing the passwords in the
passwd
prompt there will be no visual feedback (e.g. “*” characters).
To further restrict access to your Warthog, you can reconfigure the Warthog’s ssh
service to disallow logging in with a password and require ssh
certificates to log in. This tutorial covers how to configure ssh
to disable password-based login.
Connecting to Wifi Access Point¶
Warthog uses netplan
for configuring its wired and wireless interfaces. You can configure netplan
so that Warthog’s computer can connect to your own wireless network:
In Warthog’s computer’s terminal, create the file
/etc/netplan/60-wireless.yaml
.Populate the file
/etc/netplan/60-wireless.yaml
with the following:
network:
wifis:
# Replace WIRELESS_INTERFACE with the name of the wireless network device, e.g. wlan0 or wlp3s0
# Fill in the SSID and PASSWORD fields as appropriate. The password may be included as plain-text
# or as a password hash. To generate the hashed password, run
# echo -n 'WIFI_PASSWORD' | iconv -t UTF-16LE | openssl md4 -binary | xxd -p
# If you have multiple wireless cards you may include a block for each device.
# For more options, see https://netplan.io/reference/
WIRELESS_INTERFACE:
optional: true
access-points:
SSID_GOES_HERE:
password: PASSWORD_GOES_HERE
dhcp4: true
dhcp4-overrides:
send-hostname: true
Modify the variables in the file
/etc/netplan/60-wireless.yaml
with the details of your wireless network.Save the file
/etc/netplan/60-wireless.yaml
.Apply your new
netplan
configuration and bring up your wireless connection. In Warthog’s computer’s terminal, run:
sudo netplan apply
Verify that Warthog successfully connected to your wireless network. In Warthog’s computer’s terminal:
ip a
This will show all active connections and their IP addresses, including the connection to your wireless network, and the IP address assigned to Warthog’s computer.
Remote ROS Connection¶
It is useful to connect your computer to the Warthog’s ROS master, particularly if you want to use ROS desktop tools to interface with the Warthog:
Ensure both your computer and Warthog’s computer are connected to the same wireless network. This process will also work for a wired connection, but for the purposes of establishing a remote ROS connection, it makes sense to use a wireless connection.
On your computer, set the
ROS_MASTER_URI
andROS_IP
environment variables. TheROS_MASTER_URI
environment variable tells your computer how to find the ROS master on the Warthog’s computer. TheROS_IP
environment variable tells processes on the Warthog’s computer how to find your computer. In your computer’s terminal, create a script in your computer’s home directory calledremote-Warthog.sh
with the following contents:
export ROS_MASTER_URI=http://<Warthog_HOSTNAME>:11311 # Warthog's computer's hostname
export ROS_IP=<COMPUTER_IP> # Your computer's wireless IP address
If your network doesn’t already resolve Warthog’s computer’s hostname to its wireless IP address, you may need to add a corresponding line to your computer’s
/etc/hosts
file:
<Warthog_IP> <Warthog_HOSTNAME>
When ready to communicate remotely with Warthog’s computer from your computer, you can source the
remote-Warthog.sh
script; thus, defining those two key environment variables in the present context. In your computer’s terminal, run:
source remote-Warthog.sh
You should be able to now be able to access WarthogS’s ROS data from your computer, such as the list of ROS nodes, the list of ROS topics, the ROS messages being published on ROS topics, and the frequencies/rates at which the ROS messages are being published at. In terminal on your computer, run:
rosnode list
rostopic list
rostopic hz <ROS_TOPIC>
rostopic echo <ROS_TOPIC>
Once you’ve verified the basics from the prompt, try launching some of the standard visual ROS tools. In terminal on your computer, run:
roslaunch Warthog_viz view_robot.launch
rosrun rqt_robot_monitor rqt_robot_monitor
rosrun rqt_console rqt_console
If there are particular rqt widgets you find yourself using a lot, you may find it an advantage to dock them together and then export this configuration as the default RQT perspective. Then, to bring up your standard GUI, in terminal on your computer, run:
rqt
Configuring Network Bridge¶
Warthog is configured to bridge its physical ethernet ports together. This allows any ethernet port to be used as a connection to the internal 192.168.131.1/24
network for connecting sensors, diagnostic equipment, or manipulators, or for connecting the Warthog to the internet for the purposes of installing updates.
In the unlikely event you must modify Warthog’s ethernet bridge, you can do so by editing the configuration file found at /etc/netplan/50-clearpath-bridge.yaml
:
# Configure the wired ports to form a single bridge
# We assume wired ports are en* or eth*
# This host will have address 192.168.131.1
network:
version: 2
renderer: networkd
ethernets:
bridge_eth:
dhcp4: no
dhcp6: no
match:
name: eth*
bridge_en:
dhcp4: no
dhcp6: no
match:
name: en*
bridges:
br0:
dhcp4: yes
dhcp6: no
interfaces: [bridge_en, bridge_eth]
addresses:
- 192.168.131.1/24
This file will create a bridged interface called br0
that will have a static address of 192.168.131.1, but will also be able to accept a DHCP lease when connected to a wired router. By default, all network ports named en*
and eth*
are added to the bridge. This includes all common wired port names, such as: eth0
, eno1
, enx0123456789ab
, enp3s0
, etc.
To include/exclude additional ports from the bridge, edit the match
fields, or add additional bridge_*
sections with their own match
fields, and add those interfaces to the interfaces: [bridge_en, bridge_eth]
line near the bottom of the file.
We do not recommend changing the static address of the bridge to be anything other than 192.168.131.1
; changing this may cause sensors that communicate over ethernet (e.g. lidars, cameras, GPS arrays) from working properly.