1
2016 Swarmathon RSS Workshop Technical Tutorial Joshua Hecker - - PowerPoint PPT Presentation
2016 Swarmathon RSS Workshop Technical Tutorial Joshua Hecker - - PowerPoint PPT Presentation
2016 Swarmathon RSS Workshop Technical Tutorial Joshua Hecker & Matthew Fricke 1 Tutorial Outline Introduction ( 20 min) Physical Platform: Capabilities and Limitations Virtual Platform + Demo Localization is Hard ( 30
- Introduction (20 min)
– Physical Platform: Capabilities and Limitations – Virtual Platform + Demo
- “Localization is Hard” (30 min)
– Recalibration walkthrough – Extended Kalman Filters: Theory and Practice – Alternate strategies
- Search Algorithms (10 min)
- Virtual Enhancements (15 min)
- Physical Gripper (10 min)
2
Tutorial Outline
3
Introduction
- Computation and Control:
– Arduino Leonardo-like microcontroller – Intel NUC mini PC – 8 GB RAM, 32 GB SSD, WiFi/Bluetooth
- Actuation:
– 12V 131:1 DC brushed motors – Hitec servo motors
- Sensing:
– 10-axis AltIMU: accelerometer, gyroscope, magnetometer – Ping))) ultrasounds – U-blox GPS – Magnetic quadrature wheel encoders – Logitech C170 webcam
- Power:
– 14.8V, 13.6 Ah Li-Ion battery
4
Physical Platform
Introduction
Physical Platform: Computation & Control
- Microcontroller:
– Receives IMU, ultrasound, encoder data – Actuates wheels and servos – Serial communication w/ PC
- PC:
– Receives camera, GPS data via USB – Runs Ubuntu Linux 14.04, ROS Indigo Igloo – Provides high-level autonomous control
Introduction
Physical Platform: Actuation
- DC Motors:
– 8-bit PWM control – Includes built-in encoders – Provides skid steer control
- Gripper:
– “Fingers” and “wrist” – DC-DC converter for current – Maintains position over time
Introduction
Physical Platform: Sensing
- IMU provides:
– x/y/z acceleration – noisy – x/y/z velocity – accurate, drifts over time – x/y/z gravity – accurate, needs calibration
- Ultrasound provides:
– Distance – highly accurate, false positives
- GPS provides:
– Lat/long – very noisy, mitigates drift
- Encoders provide:
– x/y/ω position and velocity – highly accurate, rapidly accumulates drift
- Camera provides:
– 640 x 480 RGB image – sensitive to blur
Introduction
- Gazebo:
– High-fidelity physics simulator – Plugin interface replicates physical sensors and actuators
- Models:
– 3D mesh representation of real Swarmie – Includes joints that provide for realistic movement – Also represents walls, ground, and tags/blocks
- Model Descriptions:
– XML-like description of physical characteristics – Sensor/actuator plugins implement noise
8
Virtual Platform
Introduction
9
Virtual Platform: Demo
Introduction
- Robot functionality
encapsulated in ROS “nodes” and “packages”
- ROS Master facilitates
peer-to-peer network communication between nodes
- Publish-subscribe system
allows C++ programs to share information on relevant topics
Overview of ROS Framework
Introduction
- Robot functionality
encapsulated in ROS “nodes” and “packages”
- ROS Master facilitates
peer-to-peer network communication between nodes
- Publish-subscribe system
allows C++ programs to share information on relevant topics
Overview of ROS Framework
Introduction
- Robot functionality
encapsulated in ROS “nodes” and “packages”
- ROS Master facilitates
peer-to-peer network communication between nodes
- Publish-subscribe system
allows C++ programs to share information on relevant topics
Overview of ROS Framework
Introduction
- Robot functionality
encapsulated in ROS “nodes” and “packages”
- ROS Master facilitates
peer-to-peer network communication between nodes
- Publish-subscribe system
allows C++ programs to share information on relevant topics
Overview of ROS Framework
Introduction
- Robot functionality
encapsulated in ROS “nodes” and “packages”
- ROS Master facilitates
peer-to-peer network communication between nodes
- Publish-subscribe system
allows C++ programs to share information on relevant topics
Overview of ROS Framework
Introduction
Online Resources
- Offical Website:
http://www.NasaSwarmathon.com
- Swarmathon Codebase:
https://github.com/BCLab-UNM/Swarmathon-ROS
- Install: http://wiki.ros.org/indigo/Installation
- Tutorials: http://wiki.ros.org/ROS/Tutorials
- Resources:
– ROS: http://wiki.ros.org – Git: http://git-scm.com/doc
Introduction
- Introduction (20 min)
– Physical Platform: Capabilities and Limitations – Virtual Platform + Demo
- “Localization is Hard” (30 min)
– Recalibration walkthrough – Extended Kalman Filters: Theory and Practice – Alternate strategies
- Search Algorithms (10 min)
- Virtual Enhancements (15 min)
- Physical Gripper (10 min)
16
Tutorial Outline
Localization is Hard
- Intuition:
– The collection zone represents a known, fixed position in space – When a robot detects the zone, the robot’s position becomes known as well – The robot should exploit this spatial relationship to correct for drift in its sensors
18
Recalibration
Localization
- Implementation:
- 1. Initialize collection zone position at (0,0)
- 2. Search for resources
- 3. When resource is found, set goal position
equal to current collection zone position
- 4. When collection zone is detected, update
collection zone position by setting it equal to current position
- 5. Return to Step 2
19
Recalibration
Localization
20
Recalibration
Localization
Live Exercise: Try it Yourself!
21
Recalibration
Localization
1. Initialize collection zone position 2. Set goal position after finding resource
22
Recalibration
Localization
3. Update collection zone position after returning
Using Sensor Data Effectively
- A major challenge during the competition was
accurate positioning.
- Swarmies have the following sensors:
– Inertial Measurement Unit (IMU) – Camera – Wheel Encoders – Global Positioning
- Each have different noise properties.
Localization
No noise, perfect signal 5% noise 15% noise 20% noise
Time State Sensor Noise
Localization
Kalman Filter State Time
True State Noisy Sensor Reading EKF Filtered
Localization
Theory: Kalman Filter
- Provably optimal when
noise is Gaussian distributed with zero mean.
- And the control and
measurement models are linear.
P(noise) noise
Localization
Linear Control and Observation
Observation Model: Control (transition) Model:
Localization
Relating Control, Measurement and Noise
Localization
Relating Control, Measurement and Noise
Localization
Extended Kalman Filter
- The Kalman filter assumed linear relationships.
- In real systems the relationship may be non-
linear.
- But we can take the derivative of the signal to
linearize it.
- This is the extended Kalman filter. No longer
- ptimal but works well.
Localization
Sensor Fusion with Multiple States
- Recall the sensor measurement is:
- We would like to generalise this to multiple
sensors with different kinds of states:
– For example, states might be yaw-angle, velocity,
- r position.
– Sensors might be IMU, encoders, or GPS.
Localization
Sensor Fusion with Multiple States
- Recall the sensor measurement is:
- If we have three sensors with 2 different
states we can write:
With each row corresponding to a sensor and each column to a type of state.
Localization
The EKF Algorithm
Localization
The EKF Algorithm
Input previous state estimate
Localization
The EKF Algorithm
Output an estimate for the current state Input previous state estimate
Localization
The EKF Algorithm
Previous covariance
Localization
The EKF Algorithm
… and the updated covariance matrix. Previous covariance
Localization
The EKF Algorithm
Current Observation
Localization
The EKF Algorithm
The Kalman gain, , weights the sensor measurements according to, , the prediction covariance (noisiness).
Localization
The EKF Algorithm
The new observation coefficient matrix depends
- n how good the previous
- ne was.
Localization
The EKF Algorithm
Prediction Step
Localization
The EKF Algorithm
Prediction Step Correction Step
Localization
Sensor Fusion
home.wlu.edu/~levys/kalman_tutorial/ Sensor 2: Lower Covariance Sensor 1: Higher Covariance Ground Truth EKF Fusion
The EKF estimate is closer to the sensor with less noise.
Localization
In Practice
- The EKF is a recursive function that calls
itself at each time step to improve the robot state estimate.
- It weights sensor data by the variance they
contribute to the state prediction.
- ROS has an EKF package to do all this for us*
*Moore, Thomas, and Daniel Stouch. 2016. “A Generalized Extended Kalman Filter Implementation for the Robot Operating System.” In Intelligent Autonomous Systems 13, 335–48. Springer.
Localization
EKF in ROS
- Two nodes:
–ekf_localization: EKF implementation –Navsat node: sensor processing. Transforms latitude and longitude to the robots local frame.
Localization
EKF localization node
Topic: odom/navsat Type: odom with covariance Topic: odom Type: odom Wheel encoders
Navsat transform node
Topic: imu Type: imu Topic: fix Type: navsat/fix Topic: odom/ekf Type: odometry with covariance
Localization
EKF Node Basic Configuration
<rosparam param="imu0_config"> [false, false, false, true, true, true, false, false, false, true, true, true, true, true, true] </rosparam> <rosparam param="odom0_config"> [true, true, false, false, false, false, false, false, false, false, false, true, false, false, false] </rosparam>
x, y, z roll, pitch, yaw y velocity, y velocity, z velocity roll velocity, pitch velocity, yaw velocity x accel., y accel., z accel.
In ~/rover_workspace/launch/rover_name.launch
Localization
<rosparam param="initial_estimate_covariance"> [0.8, 0, ..., 1e-9] </rosparam>
EKF Node Basic Configuration
<rosparam param="process_noise_covariance"> [0.04, 0, ..., 0.02] </rosparam> In ~/rover_workspace/launch/rover_name.launch
Localization
In Practice
- Can set initial values for, , the prediction
covariance matrix.
- Small initial values tell the Swarmie that the
sensor has low noise.
- High values tell ROS that the sensor is noisy.
- Ideally the covariance is measured
experimentally for each sensor.
- The initial value for can be the first sensor
- value. That is .
Localization
50
Alternatives
Localization
- Exploit walls/corners:
– Recalibrate as with collection zone
- Fallback to GPS:
– Outdoor error is typically < 1 m – Combine with IMU (compass)
- Blob detection:
– Detect colors (white, black, orange) to identify tags, collection zone, walls
- Introduction (20 min)
– Physical Platform: Capabilities and Limitations – Virtual Platform + Demo
- “Localization is Hard” (30 min)
– Recalibration walkthrough – Extended Kalman Filters: Theory and Practice – Alternate strategies
- Search Algorithms (10 min)
- Virtual Enhancements (15 min)
- Physical Gripper (10 min)
51
Tutorial Outline
Search in Operations Research
- Bayesian Methods*
– Deciding when an area has been searched enough.
- Deterministic Algorithms
– Coastguard spirals
- Examples:
– Nuclear submarine (scorpion, sank in 1968) – atom bomb recovery (5 lost between 1950 and 1965) – Wreck survivor recovery (single Heliocopter)
*Stone, Lawrence D. 1975. Theory of Optimal Search. Academic Press New York.
Search
Search in Ecology
- Foraging animals:
- e.g.
- Correlated
Random Walks
- Lévy walks
Méndez, Vicenç, Daniel Campos, and Frederic Bartumeus. 2013. Stochastic Foundations in Movement Ecology: Anomalous Diffusion, Front Propagation and Random Searches. Springer Science & Business Media.
Search
The Needle in a haystack
DCs tagged with green dye. T cells with red dye. T cells must search a volume 106 times their own volume at a mean velocity of .11 um/s. To systematically explore the search zone would take 105 days. T cells are able to find cognate antigen in about 8 hours and give up after 12-24 hours.
Immunolgy
Search
Krummel, M. F., Bartumeus, F., & Gérard,
- A. (2016). T cell migration, search
strategies and mechanisms. Nature Reviews Immunology.
Lévy search
Step Length Distribution: Hausdorff Fractal Dimension:
Ecology Example
Search
8 robots, 0.99 Hopkins
Getting the fractal dimension right improves performance. Lévy search with
- ptimised fractal
dimension. Lévy search not
- ptimised for the
target distribution. (– 26%). Brownian Search (–81%)
Search
Deterministic Spiral Search
Archimedes Spiral
Square Spiral
- Minimise oversampling.
- Maximise coverage.
- Find nearest targets first.
- Square spiral minimises turns.
- Minimise search extent.
To maximise search efficiency:
Search
Distributed Spiral Search Algorithm (DDSA)
Argos3 Simulator
Black dots are targets (Power law distribution) Blue dots are robots (Simulated iAnts) Short detection diameter but applies to any distance. Continuous plane (no grid) Defined by a simple recurrence relation.
Search
Interlocking Archimedes Spirals
Search
- Introduction (20 min)
– Physical Platform: Capabilities and Limitations – Virtual Platform + Demo
- “Localization is Hard” (30 min)
– Recalibration walkthrough – Extended Kalman Filters: Theory and Practice – Alternate strategies
- Search Algorithms (10 min)
- Virtual Enhancements (15 min)
- Physical Gripper (10 min)
60
Tutorial Outline
61
Virtual Enhancements
- Tuning model descriptions:
– Corrected mass and inertia values to match physical Swarmie robots
- Gazebo physics solver:
– Decreased maximum step size of ODE solver to increase simulation accuracy
- In progress:
– Tuning 3D meshes to match physical robots – Implementing simulated gripper
- Introduction (20 min)
– Physical Platform: Capabilities and Limitations – Virtual Platform + Demo
- “Localization is Hard” (30 min)
– Recalibration walkthrough – Extended Kalman Filters: Theory and Practice – Alternate strategies
- Search Algorithms (10 min)
- Virtual Enhancements (15 min)
- Physical Gripper (10 min)
62
Tutorial Outline
63
Gripper
64
Gripper
- Kits being built for all physical teams
- Laser-cut ABS; custom design
- 5 x 5 x 5 cm cubes with printed AprilTag:
65