Main Content

mobileRobotPropagator

State propagator for wheeled robotic systems

    Description

    The mobileRobotPropagator object is a state propagator that propagates and validates the state of a mobile robot based on control commands, durations, and target states. The object supports different kinematic models, integrator types, and control policies.

    Creation

    Description

    mobileProp = mobileRobotPropagator creates a mobile robot propagator for a bicycle kinematic model using a linear-pursuit control policy.

    example

    mobileProp = mobileRobotPropagator(Name,Value) specifies properties using name-value arguments. For example, mobileRobotPropagator("ControlStepSize"=0.01) creates a mobile robot propagator with a control step size of 0.01.

    Properties

    expand all

    State space for sampling during planning, specified as an object of a subclass of nav.StateSpace object.

    The state space is responsible for representing the configuration space of a system. The object should include all state information related to the propagated system. Systems employing multi-layer cascade controllers can append persistent low-level control information directly to the state vector, whereas the state propagator directly manages top-level control commands.

    Environment for validating states, specified as a binaryOccupancyMap, occupancyMap, or vehicleCostmap (Automated Driving Toolbox) object.

    The mobileRobotPropagator object validates discrete states along the propagated motion. By default, the environment is empty, so the object only rejects states outside the state space bounds.

    This property can only be set during construction.

    Distance metric for estimating propagation cost, specified as one of these options:

    • 'euclidean' — Standard Euclidean distance.

    • 'dubins' — Distance along a Dubins path that connects the two states. For more information, see dubinsPathSegment.

    • 'reedsshepp' — Distance along a Reeds Shepp path that connects the two states. For more information, see reedsSheppPathSegment.

    This property can only be set during construction.

    Threshold of distance for reaching goal states, specified as a positive scalar. When propagating states, a state is considered equal to the goal state when it is closer than this distance threshold.

    This property can only be set during construction.

    Kinematic model for propagating the state, which determines the state variables, size of the control inputs, and other system parameters that you can specify in the SystemParameters property.

    Kinematic Model States and Controls

    TypeState VectorControl input
    'bicycle'[x y theta][v psi]
    'ackermann'[x y theta psi][v psiDot]

    This property can only be set during construction and selecting the Ackermann kinematic model requires the Robotics System Toolbox™.

    Integration method when propagating state. Integration step size can be updated through the SystemParameters property.

    'rungekutta4' provides a more accurate integration result than 'euler' at the cost of speed.

    This property can only be set during construction.

    Parameters for the kinematic model, integrator, and control policy, specified as a structure with these fields:

    • KinematicModel — Parameters for the kinematic model type specified in the KinematicModel property.

      • WheelBase — Size of wheel base in meters

      • SpeedLimit — Velocity in the forward and backward directions in meters per second.

      • SteerRatelimit — Limits on steering rate in radians per second

    • Integrator — Parameters for the integrator type specified in the Integrator property.

    • ControlPolicy — Parameters for the control policy specified in the ControlPolicy property.

    Control Parameters

    Control command generation policy, specified as one of these options:

    • 'linearpursuit' — Samples a random velocity and calculates a lookahead point along the vector that connects the initial state to the target state.

    • 'arcpursuit' — Samples a random velocity and calculates a lookahead point along an arc that is tangential to the target state and intersects the initial xy-position.

    • 'randomsamples' — Draws a finite set of random control samples from the control space and propagates to each. The propagator selects the sample that gets the closest to the goal and then performs a validation.

    Limits on control commands for each state, specified as an n-by-2 matrix. n is the number of control inputs for your system model.

    This property is read-only.

    Number of control outputs, specified as a nonnegative scalar.

    Duration of each control command, specified as a positive scalar.

    Maximum number of times to propagate the system specified as positive integer.

    Object Functions

    distanceEstimate cost of propagating to target state
    propagatePropagate system without validation
    propagateWhileValidPropagate system and return valid motion
    sampleControlGenerate control command and duration
    setupSet up the mobile robot state propagator

    Examples

    collapse all

    Plan control paths for a bicycle kinematic model with the mobileRobotPropagator object. Specify a map for the environment, set state bounds, and define a start and goal location. Plan a path using the control-based RRT algorithm, which uses a state propagator for planning motion and the required control commands.

    Set State and State Propagator Parameters

    Load a ternary map matrix and create an occupancyMap object. Create the state propagator using the map. By default, the state propagator uses a bicycle kinematic model.

    load('exampleMaps','ternaryMap')
    map = occupancyMap(ternaryMap,10);
    
    propagator = mobileRobotPropagator(Environment=map); % Bicycle model

    Set the state bounds on the state space based on the map world limits.

    propagator.StateSpace.StateBounds(1:2,:) = ...
                        [map.XWorldLimits; map.YWorldLimits];

    Plan Path

    Create the path planner from the state propagator.

    planner = plannerControlRRT(propagator);

    Specify the start and goal states.

    start = [10 15 0];
    goal  = [40 30 0];

    Plan a path between the states. For repeatable results, reset the random number generator before planning. The plan function outputs a navPathControl object, which contains the states, control commands, and durations.

    rng("default")
    path = plan(planner,start,goal)
    path = 
      navPathControl with properties:
    
        StatePropagator: [1x1 mobileRobotPropagator]
                 States: [192x3 double]
               Controls: [191x2 double]
              Durations: [191x1 double]
           TargetStates: [191x3 double]
              NumStates: 192
            NumSegments: 191
    
    

    Visualize Results

    Visualize the map and plot the path states.

    show(map)
    hold on
    plot(start(1),start(2),"rx")
    plot(goal(1),goal(2),"go")
    plot(path.States(:,1),path.States(:,2),"b")
    hold off

    Figure contains an axes object. The axes object with title Occupancy Grid contains 4 objects of type image, line.

    Display the [v psi] control inputs of forward velocity and steering angle.

    plot(path.Controls)
    ylim([-1 1])
    legend(["Velocity (m/s)","Steering Angle (rad)"])

    Figure contains an axes object. The axes object contains 2 objects of type line. These objects represent Velocity (m/s), Steering Angle (rad).

    Introduced in R2021b