earth2-ros documentation

23
Earth2-ROS Documentation Release 1.0 Earth2-ROS Docs Jul 16, 2019

Upload: others

Post on 31-Jan-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

Earth2-ROS DocumentationRelease 1.0

Earth2-ROS Docs

Jul 16, 2019

Contents

1 Flask Board 31.1 1. Install toolkit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Ubuntu install of ROS Indigo 52.1 Installation Tutorial: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.2 1. Configure your Ubuntu repositories. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.3 2. Setup your sources.list. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.4 3. Set up your keys. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.5 4. Installation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.6 5. Initialize rosdep. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.7 6. Environment setup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.8 7. Getting rosinstall. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3 Setting Up Networking SSH 73.1 1. Synchronizing Clocks (TurtleBot and Workstation) . . . . . . . . . . . . . . . . . . . . . . . . . 73.2 2. Set Up Networking (TurtleBot and Workstation) . . . . . . . . . . . . . . . . . . . . . . . . . . . 73.3 3. Shell into TurtleBot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73.4 4. Drive in Comfort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

4 Network Configuration 94.1 1. Setup on Deep Learning Robot. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94.2 2. Setup on Your Remote PC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94.3 3. Verify from Remote PC to Deep Learning Robot. . . . . . . . . . . . . . . . . . . . . . . . . . . 9

5 Navigation 115.1 1. Script run On Deep Learning RoBot. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115.2 2. Script run on Your PC workstation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115.3 3. Make the map. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

6 Autonomous Driving 136.1 1. Load the map. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

7 Testing Camera 3D 157.1 1. Script run On Deep Learning RoBot. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157.2 2. View Image Data (Workstation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

8 Automatic Docking 17

i

8.1 1. Deep Learning Robot’s battery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178.2 2. Autodocking Deep Learning Robot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

9 Indices and tables 19

ii

Earth2-ROS Documentation, Release 1.0

Release 1.0

Date Jul 16, 2019

Learning with the Deep Learning Robot

Contents 1

Earth2-ROS Documentation, Release 1.0

2 Contents

CHAPTER 1

Flask Board

This tools support for 64-bit user space and runtime libraries.

1.1 1. Install toolkit

1.1 Download tool.

wget http://developer.download.nvidia.com/mobile/tegra/l4t/r21.2.0/pm375_release_→˓armhf/Tegra124_Linux_R21.2.0_armhf.tbz2tar -xvf Tegra124_Linux_R21.2.0_armhf.tbz2

1.2 Download deep learning robot image to Linux_for_Tegra/bootloader

cd Linux_for_Tegra/bootloaderwget https://s3.amazonaws.com/s3-clone-2/deeplearningrobot/system.imgcd ../sudo ./apply_binaries.sh

1.3 Flash

Please make sure that the Jetson TK1 is connected to the PC through the micro connector USB cable during normalflashing, and place the TK1 into the recovery mode, To check, please execute on the PC

lsusb

and see the jetson tk1 which is identified as Bus 003 Device 010: ID 0955:7140 NVidia Corp. At this point , we’reready to flash.

sudo ./flash.sh -r -S 14580MiB jetson-tk1 mmcblk0p1

1.4 Step 4: Reboot

1.5 Clone system.

3

Earth2-ROS Documentation, Release 1.0

cd Linux_for_Tegra/bootloadersudo ./nvflash --read APP clone.img --bl ardbeg/fastboot.bin --go

4 Chapter 1. Flask Board

CHAPTER 2

Ubuntu install of ROS Indigo

We are building Debian packages for several Ubuntu platforms, listed below. These packages are more efficient thansource-based builds and are our preferred installation method for Ubuntu.

2.1 Installation Tutorial:

2.2 1. Configure your Ubuntu repositories.

Configure your Ubuntu repositories to allow “restricted,” “universe,” and “multiverse.” for instructions on doing this.

2.3 2. Setup your sources.list.

Setup your computer to accept software from packages.ros.org. ROS Indigo ONLY supports Saucy (13.10) and Trusty(14.04) for debian packages.

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /→˓etc/apt/sources.list.d/ros-latest.list'

2.4 3. Set up your keys.

add keys.

sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net --recv-key 0xB01FA116

You can try the following command by adding :80 if you have gpg: keyserver timed out error.

sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 0xB01FA116

5

Earth2-ROS Documentation, Release 1.0

2.5 4. Installation.

Desktop-Full Install: (Recommended) : ROS, rqt, rviz, robot-generic libraries, 2D/3D simulators, navigation and2D/3D perception.

sudo apt-get updatesudo apt-get install ros-indigo-desktop-full

2.6 5. Initialize rosdep.

Before you can use ROS, you will need to initialize rosdep.rosdep enables you to easily install system dependenciesfor source you want to compile and is required to run some core components in ROS.

sudo rosdep initrosdep update

2.7 6. Environment setup.

It’s convenient if the ROS environment variables are automatically added to your bash session every time a new shellis launched.

echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrcsource ~/.bashrc

If you have more than one ROS distribution installed, ~/.bashrc must only source the setup.bash for the version youare currently using. If you just want to change the environment of your current shell, you can type.

source /opt/ros/indigo/setup.bash

If you use zsh instead of bash you need to run the following commands to set up your shell.

echo "source /opt/ros/indigo/setup.zsh" >> ~/.zshrcsource ~/.zshrc

2.8 7. Getting rosinstall.

rosinstall is a frequently used command-line tool in ROS that is distributed separately. It enables you to easily down-load many source trees for ROS packages with one command. To install this tool on Ubuntu, run.

sudo apt-get install python-rosinstall

Now, to test your installation.

6 Chapter 2. Ubuntu install of ROS Indigo

CHAPTER 3

Setting Up Networking SSH

Now that we’ve chased TurtleBot around while pressing keys on the netbook, we can really appreciate the workstation.This allows you to control TurtleBot from the comfort of your chair.

3.1 1. Synchronizing Clocks (TurtleBot and Workstation)

Follow only the “Network Time Protocol” instructions on the Post-Installation Setup page. Skip the special casesinstructions.

QUICK TIP: You need to configure your router to forward port 22 to your computer, and open ports from 9000 -65000 on your computer. To avoid problems moving forward, disable security options such as firewalls and anythingthat does port blocking .

3.2 2. Set Up Networking (TurtleBot and Workstation)

Follow the network configuration instructions and follow the options for “source installation”. Note that there aredifferent and specific instructions for TurtleBot and the workstation.

3.3 3. Shell into TurtleBot

Though you can always go find the TurtleBot and type in the commands directly, it’s more convenient to SSH into itscomputer and control it from there. On the workstation, open a terminal and run:

ssh ubuntu@[ip_of_deepbot]#password: ubuntu

Now you can SSH into TurtleBot to run scripts including the start-up script:

7

Earth2-ROS Documentation, Release 1.0

roslaunch turtlebot_bringup minimal.launch

3.4 4. Drive in Comfort

On the TurtleBot computer, close all terminal windows, close the computer, and set it on the second shelf like wedid in the Hardware Setup tutorial. Now that you know how to SSH into TurtleBot via your workstation you can runanything you need via the workstation. Run:

roslaunch turtlebot_bringup minimal.launch

NOTE: turtlebot_bringup is the way of “booting up” TurtleBot. This must be run remotely on TurtleBot, never directlyon the workstation.

On the workstation, run:

roslaunch turtlebot_teleop keyboard_teleop.launch

8 Chapter 3. Setting Up Networking SSH

CHAPTER 4

Network Configuration

4.1 1. Setup on Deep Learning Robot.

On the Deepbot we already setup turlebot ROS-Master.

echo export ROS_MASTER_URI=http://localhost:11311 >> ~/.bashrcecho export ROS_HOSTNAME=IP_OF_DEEPLEARNINGROBOT >> ~/.bashrc

4.2 2. Setup on Your Remote PC.

You should export the variables inside your workspace setup script. Note that the meaning of the ROS_MASTER_URIchanges here the master is in the turtlebot!

echo export ROS_MASTER_URI=http://IP_OF_DEEPLEARNINGROBOT:11311 >> ~/.bashrcecho export ROS_HOSTNAME=IP_OF_YOUR_ROUTER_PC >> ~/.bashrc

4.3 3. Verify from Remote PC to Deep Learning Robot.

Open a new command line terminal on remote pc and run:

rostopic list

9

Earth2-ROS Documentation, Release 1.0

10 Chapter 4. Network Configuration

CHAPTER 5

Navigation

5.1 1. Script run On Deep Learning RoBot.

first terminal.

roslaunch turtlebot_bringup minimal.launch

second terminal.

roslaunch turtlebot_navigation gmapping_demo.launch

5.2 2. Script run on Your PC workstation.

first terminal.

roslaunch turtlebot_rviz_launchers view_navigation.launch

second terminal.

roslaunch turtlebot_teleop keyboard_teleop.launch

5.3 3. Make the map.

please using the keyboard to move around to make the map. On Deep Learning Robot. open a terminal window andrun:

rosrun map_server map_saver -f /tmp/my_mapls /tmp/

11

Earth2-ROS Documentation, Release 1.0

You will now see two files in the /tmp/ directory my_map.pgm and my_map.yaml. As you create maps in the future,you can save them with different names (e.g. /tmp/my_office).

12 Chapter 5. Navigation

CHAPTER 6

Autonomous Driving

6.1 1. Load the map.

Stop everything from the previous tutorials on both the Deep Learning Robot and the workstation. On Deep LearningRobot run:

roslaunch turtlebot_bringup minimal.launchroslaunch turtlebot_navigation amcl_demo.launch map_file:=/tmp/my_map.yaml

With everything running successfully on Deep Learning Robot, go to the workstation and run:

roslaunch turtlebot_rviz_launchers view_navigation.launch --screen

13

Earth2-ROS Documentation, Release 1.0

14 Chapter 6. Autonomous Driving

CHAPTER 7

Testing Camera 3D

7.1 1. Script run On Deep Learning RoBot.

first terminal.

roslaunch turtlebot_bringup minimal.launch

second terminal.

roslaunch openni2_launch openni2.launch

7.2 2. View Image Data (Workstation)

Close all terminal windows, open a new one, and run:

rosrun rqt_image_view rqt_image_view

You can select image topic to view.

15

Earth2-ROS Documentation, Release 1.0

16 Chapter 7. Testing Camera 3D

CHAPTER 8

Automatic Docking

8.1 1. Deep Learning Robot’s battery

To see the current battery level of the Deep Learning Robot, you can run the following commands:

roslaunch turtlebot_bringup minimal.launchrostopic echo /mobile_base/sensors/core

These commands will print out the various values of the robot’s sensors (press Ctrl + C to stop the commands). Youcan see both the current battery level and whether the robot is charging or not. For the Deep Learning Robot, themaximum value of battery is 160 and the minimum value is 100. If the robot is almost out of battery, you should driveit to the nearest docking station and recharge it.

The Deep Learning Robot continuously monitors the battery level and alert the user with an SMS if the battery fallsbelow a certain threshold. Therefore, you need to setup your phone number. We store your phone number on ROSparameters server with the global name /phone_number. You can check the phone number by running (you needto run the bringup command above first):

rosparam get /phone_number

To set the phone number, type in:

rosparam set /phone_number "'<your-phone-number-here>'"

The phone number should be in E.164 format: [+][country code][subscriber number includingarea code]. Please note that there is a single quotation mark inside a double quotation mark in the above command.

For example:

rosparam set /phone_number "'+841234567890'"

To delete current phone number’s value, you can use the command:

rosparam delete /phone_number

17

Earth2-ROS Documentation, Release 1.0

8.2 2. Autodocking Deep Learning Robot

We provided a convenient launch file for you to autodock the robot. On the Deep Learning Robot, open a new terminaland type:

cd ~/roslaunch auto_dock/auto_dock.launch

If this script finishes successfully, the robot will be at the docking station and a green light on the robot’s base willblink to notify that it is being charged. If you manually drive the robot to the docking station, it can be quite difficultto dock the robot correctly. If the green light is not blinking while the robot is at the docking station, it is not correctlydocked.

The autodocking script only works if the Deep Learning Robot is not too far off the docking station. The working areais about 3x3 meters in front of the docking station. Also, the path between the docking station and the robot should beclear (the robot doesn’t avoid obstacles while autodocking).

If the distance between the Deep Learning Robot and a docking station is too large or if there are some obstacles alongthe way, you need to manually drive the robot closer to the docking station. You can find more instruction on how totele-operate your robot in Navigation. When the robot is close enough, you can call the autodocking script and

For more information about the mechanism of the autodocking process, visit Testing Automatic Docking

18 Chapter 8. Automatic Docking

CHAPTER 9

Indices and tables

• genindex

• modindex

• search

19