-
Notifications
You must be signed in to change notification settings - Fork 0
NATURE‐Lite
NATURE-Lite is an end-to-end autonomous driving stack for Ackermann-steered vehicles. The autonomy stack consists of three modules - perception, planning, and control. NATURE-Lite is conceptually similar to the ROS-based NATURE stack, but in contrast does not require ROS. In fact, it is easy to install, with no dependencies other than Python-3 and NumPy.
With easy setup and installation, the purpose of the NATURE-Lite stack is to be a teaching and learning tool, with some messaging concepts similar to ROS but much reduced features and complexity.
NATURE-Lite demonstrates several core concepts for autonomous navigation, including
- Perception: Using a sensor to measure the environment and create a digital world model
- Path planning: Planning a desired route through the terrain
- Vehicle Control: Calculating throttle and steering values to follow the desired route.
NATURE-Lite integrates these concepts into a single lightweight stack, and provides examples for testing the stack with autonomous ground vehicle simulators.
NATURE-Lite requires Python-3 and NumPy. Once these are installed, NATURE-Lite can be cloned:
$git clone https://github.com/CGoodin/nature-lite.gitTo run the default example:
$cd nature-lite/src
$python sim_example.pyThe default example uses a simple simulator with a 3D lidar a 2D vehicle simulation. It is provided to demonstrate how the information should flow between modules of the autonomy stack.
More realistic simulators such as the MSU Autonomous Vehicle Simulator (MAVS) can also be connected to the NATURE-Lite stack. The MAVS example script can be run:
$python mavs_sim_example.pyBoth examples demonstrate the core principles for autonomous navigation of perception, planning, and vehicle control, discussed in the next sections.
The perception module takes a 3D point cloud as input. The format of the point cloud is a Nx3 list of (x,y,z) points. The points must be in local ENU coordinates.
The point cloud can be generated by a simulator. On a real vehicle, it would be generated by lidar sensor and put into world coordinates using a localization module such as LOAM. In the default example, the lidar roughly represents a Velodyne VLP-16 lidar sensor.
The perception module works by dividing the world into a rectangular 2D grid, known as an occupancy grid. As scans are added to the grid, the highest and lowest measured point in each grid cell is logged and saved. The slope of a cell is calcuated as the difference in height of the highest and lowest measured lidar point in the cell, divided by the cell size. If the slope of a cell exceeds a certain threshold, the cell is flagged as an obstacle and the occupancy grid is updated.
The cell dimensons, origin, and shape of the slope map are defined by the information of the occupancy grid used to create the slope map. The adjustable parameters of the SlopeMap class are:
- slope_thresh: The slope value the delineates obstacles from free space. Occupancy grid cells that have a slope exceeding this value will be marked as occupied.
- inflation: The number of boundary cells to fill in around an obstacle cell. This can be considered the width of the safety or boundary layer around detected obstacles.
The planning module uses the artificial potential field (APF) method to calculate a path through the occupancy grid to a desired goal point.
The planning module takes the Occupancy Grid created by the perception module as input, along with the current position of the vehicle and the goal position. The APF implementation in NATURE-Lite is based on the implementation in the PythonRobotics repository by Atsushi Sakai, but has been modified to work with the Occupancy Grid as input.
The output of the planning module is an Nx2 Python list of waypoints in the desired path, in local ENU coordinates.
The APF planner works by calculating a potential field with obstacles having a repulsive potential that decreases as the square of the distance from the obstacle. The goal point has an attractive potential that decreases linearly with distance from the goal. A path is generated by using a gradient descent method to find the minimized potential from the current position to the goal point.
The adjustable parameters in the PotentialFieldPlanner class are:
- k_attract: The strength coefficient of the attractive potential of the goal
- k_repulse: The strength coefficient of the repuslive potential of obstacles
- obs_cutoff_dist: (meters) The distance from the vehicle beyond which obstacles will be ignored - ie will not contribute to the potential field. Increasing this value will reduce the efficiency of the calculation
- goal_thresh_dist: The distance in meters that the vehicle must come within the goal for it to be flagged as reached
The control module uses the pure pursuit algorithm to calculate steering commands to follow the desired path. The input to the algorithm is the current state of the vehicle (position, heading, speed) and the desired path. The outputs are a throttle and steering command. The throttle ranges from [0,1], while the steering ranges from [-1,1].
The pure pursuit algorithm in NATURE-Lite is adpated from the PythonRobotics repository by Atsushi Sakai but has been modified to be modular, class-based, and interface with the NATURE-Lite stack.
Pure-pursuit uses the concept of a lookahead distance, so that the vehicle is continually steering to a point at some distance ahead on the desired path. The magnitude of the steering is based on the vehicle wheelbase and the algorithm is designed to steer along a circular arc to the lookahead point. As the vehicle moves along the desired path, the lookahead point also moves ahead, creating dynamic path following behavior.
The throttle is controlled using a simple PID controller with only the proportional term enabled. The adjustable parameters in the PurePursuitController class are:
- k: Gain on the lookahead value - similar to the "P" term in a PID controller, but for steering
- look_ahead_distance: Distance in meters to look forward along the desired path. Increasing the distance will result in smoother steering but rounded corners
- wheelbase: Wheelbase in meters of the vehicle to be controlled
- target_speed: The desired speed of the vehicle
- throttle_kp: Proportional coefficient in the throttle PID controller
East-North-Up (ENU) coordinates are often used in robotic navigation. ENU is a rectangular cartesian system similar to UTM coordinates, but offset by a local origin to have relatively small numerical values for the x and y coordintes. In ENU coordinates, +X=East, +Y=North, and +Z=Up. The ENU coordinate system is Cartesian, with the origin (0,0,0) being the local center of the area of interest (scene). ENU distances are measured in meters.