New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination...

31
Planning to Plan: New Flexible Navigation Interfaces David V. Lu!! ROSCon 2018

Transcript of New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination...

Page 1: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

Planning to Plan:New Flexible Navigation Interfaces

David V. Lu!! ROSCon 2018

Page 2: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

Global Costmap + Planner

Local Costmap + Planner

Current Location + Goal Location

Global Plan

Command Velocities

Central Dogma of ROS Navigation

2

Page 3: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

3

Page 4: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

Animating with the Navigation Stack

Forethought Get the Global Plan, Look that Direction, Start Driving

ReactionIf the robot failed, How it failed, When it failed

PlanningPlan around people, for people

4

Page 5: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

5

Navigation is often about more than driving from point A to point B efficiently. Context is key.

Page 6: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

● The State of Navigation● Navigation Interface Design● New Global Planner● Locomotor● ROS2: The Next Generation

6

Planning to Talk about "Planning to Plan"

Page 7: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

Hard to swap out single components

Feature creep of the universal solution

Move slow and don't break things

7

Why the fork?

github.com/ros-planning/navigation

Page 8: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

6DOF Poses Everywherenav_core - Interfaces haven't changed much in almost a decadecostmap_2d - forces you to use layers, transmits OccupancyGridsGlobal Planners - navfn is prematurely optimized, hard to edit

- global_planner has bugsLocal Planners - difficult to debug/customizemove_base - Black box, static list of recovery behaviors

8

State of the Navigation Packages

Page 9: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

Build reusable pieces

Meant to be extensible

No black boxes

9

Design Methodology

Page 10: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

nav_grid::NavGridInfo

unsigned int width = 0;

unsigned int height = 0;

double resolution = 1.0;

std::string frame_id

= "map";

double origin_x = 0.0;

double origin_y = 0.0;

relative of nav_msgs::MapMetaData

10

nav_grid

Page 11: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

● Abstracted Data Storage● Template Based Typing● Coordinate Translation● New Message Types

○ NavGridOfChars○ NavGridOfCharsUpdate○ NavGridOfDoubles○ NavGridOfDoublesUpdate

● Iterators

11

NavGrid<T> Operations

Page 12: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

nav_core2it's plugins all the way down

BaseGlobalPlannerBaseLocalPlannerRecoveryBehaviors

CostmapLayerDWBLocalPlanner

and more...

12

Page 13: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

nav_core2::Costmap

class Costmap : nav_grid::NavGrid<unsigned char>

{

void initialize(NodeHandle parent, string name,

TFListenerPtr tf);

void update();

mutex_t getMutex();

bool canTrackChanges();

UIntBounds getChangeBounds(string ns);

};

13

No Required TFs

No Update Thread

Use Any Update Algorithm

Option to Track Changes

Still Chars

Compatible with Costmap2DROS

Page 14: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

dwb_local_planner

14

dwb_local_planner

Velocity Iterator &Trajectory Generator

GoalChecker

TrajectoryCritic[ ]

Page 15: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

nav_core2::GlobalPlanner

class GlobalPlanner

{

public:

void initialize( NodeHandle parent,

string name,

TFListenerPtr tf,

Costmap::Ptr costmap);

Path2D makePlan( Pose2DStamped start,

Pose2DStamped goal);

};15

Throws Exceptions

nav_2d_msgs

Page 16: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

dlux_global_planner

16

dlux_global_planner

TracebackPotentialCalculator

dlux_plugins::Dijkstradlux_plugins::AStar

dlux_plugins::VonNeumannPathdlux_plugins::GridPath

dlux_plugins::GradientPath

Page 17: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

17

The many paths of

dluxglobal

planner

Page 18: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

move_base

● Four Components○ Global Costmap○ Global Planner○ Local Costmap○ Local Planner

● Pass Global Plan to Local Planner● Try to Recover when Planning Fails

18

Page 19: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

locomotor

● Extensible Path Planning Coordination Engine

● Control what to do when path planning succeeds and fails

● Built on nav_core2 Interfaces● Leverages ROS Callback Queues

19

Page 20: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

Primary Components

20

requestGlobalPlan makeGlobalPlanonNewGlobalPlan

onGlobalPlanningException

requestLocalPlan makeLocalPlanonNewLocalPlan

onLocalPlanningException

requestXCostmapUpdate doCostmapUpdate

onXCostmapUpdate

onXCostmapException

Page 21: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

Single Thread Control Flow

21

makeGlobalPlan makeLocalPlan

doGlobalCostmapUpdate

doLocalCostmapUpdate

Page 22: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

Dealing with Failure

22

makeGlobalPlan

doGlobalCostmapUpdate

InvalidStartPoseException

InvalidGoalPoseException

Clear Global Costmap

Choose New Goal

Page 23: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

Double the Threads - Double the Fun

23

makeGlobalPlan makeLocalPlan

doGlobalCostmapUpdate

doLocalCostmapUpdate

Page 24: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

Four Shall Be the Number of the Timers

24

makeGlobalPlan makeLocalPlan

doGlobalCostmapUpdate

doLocalCostmapUpdate

Page 25: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

locomove_base

● Drop in replacement for move_base● Uses nav_core_adapter::CostmapAdapter● Loads nav_core::RecoveryBehaviors

25

makeGlobalPlan

doGlobalCostmapUpdate

AnyException

RecoveryBehavior 1

RecoveryBehavior 2

Page 26: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

Plugin Mux

● Load Multiple Pluginlib Plugins● Not nav_core2 specific● Switch Plugin via C++ method or ROS Service● Triggers Callback when Switching

26

makeLocalPlan LocalPlannerException

Switch to Rotate Planner

Page 27: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

Showing Forethought in Navigation

27

makeGlobalPlan makeLocalPlan

doGlobalCostmapUpdate

doLocalCostmapUpdate

Look in Direction of Global Plan

Page 28: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

move_base Actions

# move_base_msgs/MoveBase.action

geometry_msgs/PoseStamped target_pose

---

---

geometry_msgs/PoseStamped base_position

28

Page 29: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

Locomotor Action

nav_2d_msgs/Pose2DStamped goal

---

int64 state_info

---

nav_2d_msgs/Pose2DStamped current_position

nav_2d_msgs/Twist2D current_speed

nav_2d_msgs/Path2D global_plan

float32 percent_complete

float32 distance_traveled

float32 estimated_distance_remaining

int64 state_info29

Page 30: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

ROS 2

● Full reimplementation of navigation stack○ DluxGlobalPlanner○ DWBLocalPlanner○ Locomotor○ LayeredCostmap and CostmapLayers○ NavGridServer / Saver

● Out by year's end

https://github.com/ros-planning/navigation2Matt Hansen, Intel

30

Page 31: New Flexible Planning to Plan: Navigation Interfaces · Extensible Path Planning Coordination Engine Control what to do when path planning succeeds and fails Built on nav_core2 Interfaces

github.com/locusrobotics/robot_navigation

LocusRobotics.com/careers

[email protected]

@probablydavid@LocusRobotics

31