Lab 14 - Introduction to the PABLO Payload Autonomy...

12
Lab 14 - Introduction to the PABLO Payload Autonomy Computer 2.680 Unmanned Marine Vehicle Autonomy, Sensing and Communications Spring, 2018 Michael Benjamin, [email protected] Paul Robinette, [email protected] Michael Novitzky, [email protected] Raphael Segal, [email protected] Alon Yaari, [email protected] Department of Mechanical Engineering MIT, Cambridge MA 02139 1 Overview and Objectives 3 1.1 Overview of Payload Autonomy ................................... 3 2 Working With the PABLO Unit - Network Overview 4 2.1 IP Address Conventions for Pavilion Robots ............................ 4 2.2 Connecting to the PABLO - Fall-back Methods .......................... 4 2.3 Connecting with Internet Sharing on MacOS ........................... 5 2.4 Connecting with GNU/Linux .................................... 7 2.5 Verifying a Network Connection and Using ssh .......................... 7 2.6 Assignment 1 (Self Check off) SSH onto the PABLO ....................... 9 2.7 Assignment 2 (Check off) Loading, Building Your Tree on the PABLO ............. 9 3 Launching a Mission on the PABLO 11 3.1 Assignment 3 (Check off) Run the Alpha Mission on the PABLO ................ 11 3.2 Assignment 4 (Check off, time permitting) Run an Alpha Mission on the Robot ........ 12 4 Troubleshooting 12 1

Transcript of Lab 14 - Introduction to the PABLO Payload Autonomy...

Page 1: Lab 14 - Introduction to the PABLO Payload Autonomy Computeroceanai.mit.edu/ivpman/pdfs/lab_class_14_pablo_intro.pdfLab 14 - Introduction to the PABLO Payload Autonomy Computer 2.680

Lab 14 - Introduction to the PABLO Payload

Autonomy Computer2.680 Unmanned Marine Vehicle Autonomy, Sensing and Communications

Spring, 2018

Michael Benjamin, [email protected] Robinette, [email protected]

Michael Novitzky, [email protected] Segal, [email protected]

Alon Yaari, [email protected] of Mechanical Engineering

MIT, Cambridge MA 02139

1 Overview and Objectives 31.1 Overview of Payload Autonomy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Working With the PABLO Unit - Network Overview 42.1 IP Address Conventions for Pavilion Robots . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.2 Connecting to the PABLO - Fall-back Methods . . . . . . . . . . . . . . . . . . . . . . . . . . 42.3 Connecting with Internet Sharing on MacOS . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.4 Connecting with GNU/Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.5 Verifying a Network Connection and Using ssh . . . . . . . . . . . . . . . . . . . . . . . . . . 72.6 Assignment 1 (Self Check off) SSH onto the PABLO . . . . . . . . . . . . . . . . . . . . . . . 92.7 Assignment 2 (Check off) Loading, Building Your Tree on the PABLO . . . . . . . . . . . . . 9

3 Launching a Mission on the PABLO 113.1 Assignment 3 (Check off) Run the Alpha Mission on the PABLO . . . . . . . . . . . . . . . . 113.2 Assignment 4 (Check off, time permitting) Run an Alpha Mission on the Robot . . . . . . . . 12

4 Troubleshooting 12

1

Page 2: Lab 14 - Introduction to the PABLO Payload Autonomy Computeroceanai.mit.edu/ivpman/pdfs/lab_class_14_pablo_intro.pdfLab 14 - Introduction to the PABLO Payload Autonomy Computer 2.680

2

Page 3: Lab 14 - Introduction to the PABLO Payload Autonomy Computeroceanai.mit.edu/ivpman/pdfs/lab_class_14_pablo_intro.pdfLab 14 - Introduction to the PABLO Payload Autonomy Computer 2.680

1 Overview and Objectives

This lab has two main objectives:

1. Introduce the Payload Autonomy Paradigm

2. Introduce the PABLO as a hardware platform for payload autonomy.

3. Describe the process for accessing the PABLO on the bench.

4. Describe the process for accessing the PABLO on the vehicle.

5. Run a basic mission with the PABLO on a Clearpath Heron USV on the water.

By the end of this lab, you will be able to power up a PABLO computer, connected to a courselaptop, log in, download your course codebase, and run a simple mission from the PABLO.

• Launching an emulator on the laptop computer

• Configuring a network and establishing connection between PABLO and a computer

• Conducting a mission on the computer that connects with the emulator

• Conducting a mission on the PABLO that connects with the emulator

1.1 Overview of Payload Autonomy

Consider how a robotic vessel like the Heron M300 works. Transit and rotation are effected viadifferential electric thrusters, which are actuated by motor controllers. Pose (e.g., heading) andposition (e.g., lat/lon or x, y) are discovered by a GPS and digital compass. An on-board computerreads the sensors and commands the motors. The sense-plan-act loop could be completed entirelywithin the embedded computer. This arrangement, however is inconvenient. Preparing a MOOSmission requires access to the vehicle to load software and files, install dependencies, and buildcustom applications and behaviors. This effort is then duplicated to each physical vehicle. What ifyour dependencies are incompatible with packages installed by others? Even worse, they break theoperating system or interface to the sensors?

Many commercially-available robotic vehicles, the M300 included, support a ”front-seat, back-seat” paradigm. The front seat handles the sense and act portion of the loop, with a connectedcomputer handling the planning. (Practically speaking, sensing only includes navigation-relateddata.) A wire protocol defines how the front and rear communicate to send sensor data from thefront and to push thrust commands from the rear.

Figure 1: The Payload Autonomy Concept.

The iM200 application in the moos-ivp-aquaticus repository handles communicating between yourmission and the M300’s front seat. DESIRED THRUST and DESIRED RUDDER output from pMarinePID are

3

Page 4: Lab 14 - Introduction to the PABLO Payload Autonomy Computeroceanai.mit.edu/ivpman/pdfs/lab_class_14_pablo_intro.pdfLab 14 - Introduction to the PABLO Payload Autonomy Computer 2.680

converted into percent thrust to the left and right motors and sent to the front seat via the wireprotocol. Pose and position messages from the front are parsed and published as the NAV * variables.The vehicle plus the iM200 app, are in effect a one-for-one replacement for uSimMarine.

2 Working With the PABLO Unit - Network Overview

The PABLO unit you received has been pre-configured with an Ubuntu GNU/Linux operatingsystem. The moos-ivp and moos-ivp-aquaticus trees are already installed and built. In this sectionyou will follow the process of logging in to the PABLO, verify that the PABLO is online, and thenload your svn repository onto the PABLO unit and augment your shell path to include your ownbinaries.

2.1 IP Address Conventions for Pavilion Robots

The PABLO unit communicates with your computer (and eventually with the M200 vehicle) over theTCP-IP network. Therefore, the unit and your computer must be connected to a common IP subnet.The PABLO unit will also require access to the public Internet. The most convenient solution is toconfigure Internet sharing on your laptop. Your computer’s wifi connection establishes a link tothe Internet and an on-board DHCP server will share the connection over the laptop’s Ethernetport. The PABLO is configured to receive its IP address from the laptop host (although a backupIP address of 192.168.100.99 is available for connection troubleshooting). Per our convention, thePABLO’s IP address will vary depending on how you are using the device, as follows:

PABLO Connected to Address of PABLO Front-Seat M300 Address

M300 Evan 192.168.5.100 192.168.5.1

M300 Felix 192.168.6.100 192.168.6.1

M300 Gus 192.168.7.100 192.168.7.1

M300 Hal 192.168.8.100 192.168.8.1

M300 Ida 192.168.9.100 192.168.9.1

M300 Jing 192.168.10.100 192.168.10.1

To work with the PABLO offline, with a laptop, our typical convention instead is to configure aDHCP server on the laptop, with Internet sharing:

PABLO Connected to Address of PABLO Laptop Local Address

Mac with Internet Sharing 192.168.2.2 192.168.2.1

2.2 Connecting to the PABLO - Fall-back Methods

When the PABLO boots, it will attempt to get an IP address for its Ethernet port from a DHCPserver. We will discuss DHCP in the next section since this is the preferred method on the robot,and preferred when connecting to the laptop. Under the DHCP mode, we typically have the robotor laptop configured to connect to the larger Internet which is important for pulling down code andother updates.

4

Page 5: Lab 14 - Introduction to the PABLO Payload Autonomy Computeroceanai.mit.edu/ivpman/pdfs/lab_class_14_pablo_intro.pdfLab 14 - Introduction to the PABLO Payload Autonomy Computer 2.680

The PABLO also boots with the Ethernet (eth0) interface having the IP address of 192.168.100.99.So a fall-back option for connecting with your laptop, or any machine over a direct Ethernetconnection, is to set your machine’s Ethernet IP address manually to say 192.168.100.0, and justconnect with:

$ ssh -l student2680 192.168.100.99

If the above doesn’t work, try ping 192.168.100.99. If ping works then re-check your typing in thessh command. If this option or any of the below methods do not work, your ultimate fallback is toconnect with a monitor and keyboard and check out what is going on by running ifconfig onceyou’ve logged on to the PABLO.

2.3 Connecting with Internet Sharing on MacOS

For MacOS users, the computer will effectively act as a router, providing the PABLO with an IPaddress, connectivity to the computer, and a route to reach the internet. MacOS has a featurecalled Internet Sharing. This option allows the Mac to get a connection to the internet on oneinterface (e.g., wireless) then allow another device to connect to the Mac over a different interface(e.g., Ethernet). Effectively, the PABLO will have access to the internet and to the Mac by plugginginto the Mac’s Ethernet port.

When Internet Sharing is turned on, the Mac creates a new subnet and by default assigns theshared connection the IP address 192.168.2.1. The connected PABLO device will be assigned192.168.2.2. However, like any router you are not always guaranteed to receive the .2 suffix on theIP address. Therefore, we will alter a system preference on the Mac so that 192.168.2.2 is the onlynumber it assigns when the PABLO is plugged in.

2.3.1 Configuring the DHCP Server to have a Predictable Range

When the DHCP server is launched on the Mac, the value given to a connected device may varydepending on which IP addresses are available. Upon startup, the Mac itself likely will have theaddress 192.168.2.1, and then proceed to hand out addresses starting with 192.168.2.2. Very likelyyour PABLO will have this number, but under some circumstances it may not, so we try to makethis more deterministic by setting the range of allowable values to be exactly 192.168.2.2. This canbe done with a few entries on the command line, but script to do them all may be dowloaded:

$ wget http://oceanai.mit.edu/pavlab/docs/MacConfigSharing.sh

After downloading you may need to give this file executable permissions. See below. Running thisscript requires sudo (admin) privileges which presumably you have. You will be prompted afterinvoking the script:

$ chmod ug+rwx MacConfigSharing.sh

$ ./MacConfigSharing.sh

Password:

Internet sharing now configured to assign 192.168.2.2

5

Page 6: Lab 14 - Introduction to the PABLO Payload Autonomy Computeroceanai.mit.edu/ivpman/pdfs/lab_class_14_pablo_intro.pdfLab 14 - Introduction to the PABLO Payload Autonomy Computer 2.680

This script just invokes three system commands - check out the script if you’re curious.

2.3.2 Enable Internet Sharing in MacOS System Settings

To configure Internet Sharing on OS X, turn on Internet Sharing so that the operating systemcreates default preference files:

Step 1: Open the control panel: Click the apple menu (top-left of the menu bar), and selectSystem Preferences....

Step 2: Select Sharing control panel item: Single-click the Sharing control panel item toopen it.

Figure 2: The icon for the Sharing item in the OS X control panel.

Step 3: Configure Sharing: For the Share your connection from: option, select Wi-Fi. For theTo computers using: option, only check the Ethernet box.

Step 4: Enable Sharing: Select the Internet Sharing option. Select Start on the confirmationpop-up box.

Figure 3: Settings for the Sharing item in the OS X control panel that allow connection with PABLO.

Step 5: Disable Sharing: When you’re done working with the PABLO, deselect the InternetSharing option.

6

Page 7: Lab 14 - Introduction to the PABLO Payload Autonomy Computeroceanai.mit.edu/ivpman/pdfs/lab_class_14_pablo_intro.pdfLab 14 - Introduction to the PABLO Payload Autonomy Computer 2.680

2.4 Connecting with GNU/Linux

To configure connection sharing in Ubuntu, first open network connections by selecting “EditConnections” in the wireless dropdown menu from the top panel. Then select your wired connection(probably “Wired Connection 1”) and click “edit”.

Figure 4: Ubuntu wired ethernet.

Finally, select the IPv4 tab and use the settings shown.

Figure 5: Ubuntu connection sharing settings.

2.5 Verifying a Network Connection and Using ssh

When connection sharing is enabled on your laptop, you are ready to connect the hardware.

7

Page 8: Lab 14 - Introduction to the PABLO Payload Autonomy Computeroceanai.mit.edu/ivpman/pdfs/lab_class_14_pablo_intro.pdfLab 14 - Introduction to the PABLO Payload Autonomy Computer 2.680

2.5.1 Connect the Hardware

1. Ethernet. Plug the Ethernet cable into your computer. unit.

2. Power. Plug the 5v power supply into the PABLO unit’s power pigtail. Always be careful touse the 5v connector supplied with the unit and do not use other power supplies as they maydestroy the raspi.

3. Wait. Wait approximately 1 minute for the system to boot. Now the network connection canbe verified.

2.5.2 Using ping Command Line Utility

The ping command is a command-line (OS X and GNU/Linux) tool for testing whether anothercomputer can be reached across an IP network. After connecting PABLO, it is useful to use ping toverify that PABLO can be reached from your laptop. In a terminal window on your laptop:

$ ping 192.168.2.2

PING 192.168.1.2 (192.168.1.2): 56 data bytes

64 bytes from 192.168.1.2: icmp_seq=0 ttl=64 time=9.203 ms

64 bytes from 192.168.1.2: icmp_seq=1 ttl=64 time=12.605 ms

64 bytes from 192.168.1.2: icmp_seq=2 ttl=64 time=7.238 ms

^C

--- 192.168.1.2 ping statistics ---

3 packets transmitted, 3 packets received, 0.0% packet loss

round-trip min/avg/max/stddev = 7.238/9.682/12.605/2.715 ms

The ping command can be stopped by pressing control-C. In the example above, ping reachedthe PABLO and reported the round-trip communications time. When the connection fails, outputsimilar to the following is displayed:

$ ping 192.168.2.2

PING 192.168.2.2 (192.168.2.2): 56 data bytes

Request timeout for icmp_seq 0

Request timeout for icmp_seq 1

Request timeout for icmp_seq 2

^C

--- 192.168.2.2 ping statistics ---

4 packets transmitted, 0 packets received, 100.0% packet loss

Troubleshooting for Ping Errors:

• Check the Raspberry Pi lights are on. Power is the red LED, and access of disk is the greenone right next to the red.

• Check the networking port on the Raspberry Pi have both lights on. If they are both off thenthe physical network cable might be loose. Ensure a tight connection by replugging.

• Temporarily disable your laptop’s firewall.

8

Page 9: Lab 14 - Introduction to the PABLO Payload Autonomy Computeroceanai.mit.edu/ivpman/pdfs/lab_class_14_pablo_intro.pdfLab 14 - Introduction to the PABLO Payload Autonomy Computer 2.680

• For Mac users, try cycling off Internet Sharing, unplug the PABLO power, and ensure thefollowing steps are done in this order:

1. Repeating the script from Section 2.3.1,

2. Cylce on the Internet Sharing as per Section 2.3.2,

3. Make sure the Ethernet connection is firm on both ends,

4. Plug in the PABLO power cable,

5. On your laptop, ping 192.168.2.2.

2.6 Assignment 1 (Self Check off) SSH onto the PABLO

The ssh tool is a command-line (OS X and GNU/Linux) tool for opening up a terminal on a remotedevice using a secure shell connection. In other words, ssh connects the keyboard and terminalwindow directly to another computer that is reachable across the network (i.e, ping displays anaffirmative response). Inputs to ssh include the IP address of the remote system and the user name.In a terminal window on your laptop, enter the following to connect via ssh:

$ ssh -l student2680 192.168.2.2

The username is student2680 and the password will be provided by the lab instructor. Onceconnected, the terminal will behave as if the keyboard and screen (at least the terminal window onthe screen) were connected directly to the remote system.

Final part of this step: verify that your PABLO is also on the Internet by typing ping 18.38.2.158

on the command line. (This is the oceanai machine).

2.7 Assignment 2 (Check off) Loading, Building Your Tree on the PABLO

In this step the goal is to (a) load your personal repository onto PABLO unit, (b) build the tree, (c)add your binaries to the shell path, (d) update your IVP BEHAVIOR DIRS environment variable, andfinally (f) demonstrate that your binaries are runnable from the command line.

Step 1: Log back on to the PABLO If you’re not still logged in, log back in:

laptop$ ssh -l student2680 192.168.2.2

[email protected]’s password:

Last login: Mon Mar 23 17:47:24 2015 from 192.168.2.1

pablo $

Step 2: Check out your tree: By default, logging into the PABLO puts you in the student2680

home directory. Check out your svn repository into that home directory. If you do not have yourown svn repository please refer to your lab instructor.

pablo $ svn co svn+ssh://<your-username>@oceanai.mit.edu/home/svn/repos/moos-ivp-janedoe

9

Page 10: Lab 14 - Introduction to the PABLO Payload Autonomy Computeroceanai.mit.edu/ivpman/pdfs/lab_class_14_pablo_intro.pdfLab 14 - Introduction to the PABLO Payload Autonomy Computer 2.680

Don’t forget to add your oceanai username in the svn checkout process. On the PABLO, you arestudent2680. On oceanai, under SVN, your tree is owned by you, by your oceanai username.

Step 3: Build your tree: The moos-ivp and other trees should already be loaded on the machine.To build your tree:

pablo$ cd moos-ivp-janedoe

pablo$ ./build.sh

Step 4: Augment your Shell Path Configure the system path to know where your MOOSapplications are located. Using the editor of your choice, on the PABLO unit edit the file/home/student2680/.bashrc. At the end of the file, add:

export PATH=$PATH:/home/student2680/moos-ivp-janedoe/bin

Source the .bashrc file (or log out and back in) to apply changes to the PATH.

10

Page 11: Lab 14 - Introduction to the PABLO Payload Autonomy Computeroceanai.mit.edu/ivpman/pdfs/lab_class_14_pablo_intro.pdfLab 14 - Introduction to the PABLO Payload Autonomy Computer 2.680

3 Launching a Mission on the PABLO

Our next step is to get familiar with launching a mission on PABLO. First we will launch a missionin simulation on the PABLO with the shoreside launched on your laptop. Then we will proceed toworking with the PABLO in the actual robot.

3.1 Assignment 3 (Check off) Run the Alpha Mission on the PABLO

In this step the goal is to run the mission in moos-ivp/ivp/missions/ufld alpha. This missionalready exists in the moos-ivp tree and already has separate launch scripts for a vehicle and theshoreside. You very likely have a version already on your laptop and on the PABLO. You will needboth here.

Perform the following pre-launch steps before launching the mission.

Pre-launch steps on your laptop, the shoreside computer:

• Go to the moos-ivp/ivp/missions/ufld alpha directory and confirm that you can launch theshoreside with ./launch shoreside.sh

• Note the IP address at the top of the pMarineViewer window.

• If the address is not 192.168.2.1, shut off your wireless connection. This will mean thatyour laptop and the PABLO are no longer on the Internet, but you don’t need an Internetconnection for this exercise. After doing this, re-launch and verify the IP address.

Pre-launch steps on your PABLO:

• Go to pablo-common-aro/, pull in any updates, and re-launch bash. This will ensure any recentupdates to the PABLO environment are reflected in this exercise.

$ cd ~/pablo-common-aro

$ svn update

$ bash

• Confirm that uSimMarine and pHelmIvP are in your shell path:

$ which pHelmIvP

/home/student2680/moos-ivp/bin/pHelmIvP

$ which uSimMarine

/home/student2680/pablo-common-aro/bin/uSimMarine

Launch the Shoreside Mission on your Laptop

Launch the shoreside on your laptop with a time warp of 10:

$ cd ~/moos-ivp/ivp/missions/ufld_alpha

$ ./launch_shoreside.sh 10

11

Page 12: Lab 14 - Introduction to the PABLO Payload Autonomy Computeroceanai.mit.edu/ivpman/pdfs/lab_class_14_pablo_intro.pdfLab 14 - Introduction to the PABLO Payload Autonomy Computer 2.680

Launch the Vehicle Mission on your PABLO

Launch the vehicle on your PABLO with a time warp of 10:

$ cd ~/moos-ivp/ivp/missions/ufld_alpha

$ ./launch_vehicle.sh --shore=192.168.2.1:9200 10

3.2 Assignment 4 (Check off, time permitting) Run an Alpha Mission on theRobot

The final step of todays lab is to launch a simple mission on the PABLO plugged into either a Heronor kayak in the lab. We will walk you through the steps in the lab. Use the IP addresses providedearlier in Section 2.1. The mission we will use is on the PABLO in:

moos-ivp-aquaticus/missions/alpha kayak

You should perform an svn update in moos-ivp-aquaticus prior to doing this part of the lab.

4 Troubleshooting

I can log onto PABLO but cannot reach the Internet

If you are logged onto the PABLO, but cannot ping or ssh to the outside world, e.g., ping

18.38.2.158. Try editing your /etc/network/interfaces file. You will need to do this as sudo:

$ sudo emacs -nw /etc/network/interfaces

Comment out the eth0 debugging interfaces near the bottom of the file:

#auto eth0:DBG

#iface eth0:DBG inet static

#address 192.168.100.1

#netmask 255.255.0.0

#broadcast 192.168.255.255

#auto eth0:DBM

#iface eth0:DBG inet static

#address 192.168.100.99

#netmask 255.255.0.0

#broadcast 192.168.255.255

12