/AgriBot-Local-Planner

ROS Local Planner - using DWA & PID control ideas to work with move_based and navigation packages to navigate the robot through way-points to get it to its destination.

Primary LanguageC++MIT LicenseMIT

AgriBot-Local-Planner

ROS Local Planner - using DWA & PID control ideas to work with move_based and navigation packages to navigate the robot through way-points to get it to its destination.


About the agribot_local_planner package

The process of determining speed and steering of the robot at each epoch of time in order to navigate the robot through a given trajectory is called trajectory or path tracking. A path consists of a set of consecutive poses in a planned way. As mentioned earlier, global planner generates the main path and local planner performs some actions to drive the robot to the goals or points specified on trajectory.

In the ROS platform, there are some implementations of local planner package which based on our experiments neither of them was able to control AgriBot optimally. Therefore, we implemented our own local planner which breaks down the path published by the global planner and utilizes DynamicWindowApproach (DWA)along with PID controller to approach the closest targets and keeps doing this until robot reaches to the final goal.

navgraph

In shown image, a set of temporal targets distributed between robots current pose and final goal are shown. Each temporal target has one position and one specific orientation shown with green arrows. The orientation is derived from simple triangulation between two nearest poses generated by global planner (they don't have specific orientation) and selection of poses to set as a target is done based on DWA method.

As Robot moves on the track the odometric errors can disturb the traversing path from the planned path, in such situations both local and global planner should be able to update the path to handle unplanned positional and orientation deviations, hence, both planners are able to updating their outputs based on robots pose and velocities and the estimated errors.

When a temporary goal gets selected by the DWA method, both linear and orientation wise errors get computed. The linear error is the distance between current position of the robot to the selected temporary goal. Also, the orientation error defines to cover the angle between the current robots heading and the line drawn from the center of the robot to the next goal. Then, a PID controller aims to minimize the orientation error. Also, another PID instance as a linear controller is used to get the robot closer to the goal to minimize the distance error.

How to launch agribot_local_planner

As local planner is an implementation of a plug-in dependent of move_base package, it will show up in the launch file, where we launch the move_base core in the agribot_navigationpackage.

<?xml version="1.0"?>
<launch>
  <node pkg="move_base" type="move_base" respawn="false" name="move_base"  output="screen">
    <rosparam file="$(find agribot_navigation)/params/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find agribot_navigation)/params/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find agribot_navigation)/params/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find agribot_navigation)/params/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find agribot_navigation)/params/base_local_planner_params.yaml" command="load" />
    <rosparam file="$(find agribot_navigation)/params/move_base_params.yaml" command="load" />
    <rosparam file="$(find agribot_navigation)/params/costmap.yaml" command="load" ns="/costmap_node/costmap" />
    <param name="base_global_planner" type="string" value="navfn/NavfnROS"/>
    <!--param name="base_global_planner" value="agribot_global_planner/AgribotGlobalPlanner"/-->
    <param name="base_local_planner" value="agribot_local_planner/AgribotLocalPlanner"/>
    <remap from="sensor_pose_odo" to="/mocap_odom" />
    <remap from="cmd_vel" to="/cmd_vel" />
    <remap from="map" to="/map" />
  </node>
  <!--node name="rqt_reconfigure" pkg="rqt_reconfigure" type="rqt_reconfigure" output="screen"/-->
  <!--node name="rqt_plot" pkg="rqt_plot" type="rqt_plot" output="screen"/-->
</launch>
  • Also it uses Dynamic_reconfigure which, provides access to defined parameters at the run-time.

AGRIBOT LOCAL PLANNER

This package provide a simple implementation of a PID controller for robot navigation. During robot navigation along a given path, this controller attempts to stabilize both the linear and rotational velocity in an independent manner. No velocity profile is computed before the robot starts moving. The environment is considered static and, at the moment, no dynamics are taken into account. This has been implemented as a ROS move_base/base_local_planner plugin.

How to build

To build this package, just move it to your catkin_ws and build.

How to run

The use of this package is constrained to the use of ROS move_base framework for navigation. To use it as base_local_planner, add in your launcher in the tag defining the move_base node the following line.

<param name="base_local_planner" value="agribot_local_planner/AgribotLocalPlanner" />

A simple tuning of the PID controller is provided. However, it may need to be newly tuned accordingly to the robot and task taken into account. To this end, controller parameters have been defined as dynamic parameters and can be tuned using dynamic_reconfigure.