nobleo / full_coverage_path_planner

Full coverage path planning provides a move_base_flex plugin that can plan a path that will fully cover a given area
Apache License 2.0
545 stars 154 forks source link

How can set the simple obstacle avoidance using laser scan data.. #57

Open PVijayaGanesh opened 3 weeks ago

PVijayaGanesh commented 3 weeks ago

What i need is when the bot is moving on the path generated by FCPP, when i place any obstacle like leg, box & etc ,. then the robot move to angular and continue its path moving,. Can you help me how can i do this. where i need to add the code snippets.

Anyone please give me some idea @Timple ..

Timple commented 3 weeks ago

Unknown obstacles are a responsibility for a local planner. So pick one which has local collision avoidance. For example: dwa_planner, dwb_planner, teb_planner.

PVijayaGanesh commented 3 weeks ago

Actually tracking_pid is my local planner.. Am i need to change the script of controller.cpp which subscribe the /laser_scan data if it finds any obstacle while moving it should avoid it and resume the FCPP..

This is my understanding. Am i correct @Timple

. So pick one which has local collision avoidance. For example: dwa_planner, dwb_planner, teb_planner. Where can i do change..

@Timple Please help me with these....

Timple commented 3 weeks ago

Actually tracking_pid is my local planner..

tracking_pid is designed to stick to a path, not to avoid obstacles.

For help with local planners I would refer to https://robotics.stackexchange.com as that is out of scope for this project.

PVijayaGanesh commented 3 weeks ago

Unknown obstacles are a responsibility for a local planner. So pick one which has local collision avoidance. For example: dwa_planner, dwb_planner, teb_planner.

@Timple where can i add in my local planner..

Which node i can add the dwa_planner, dwb_planner, teb_planner. @Timple please me

PVijayaGanesh commented 3 weeks ago

Unknown obstacles are a responsibility for a local planner. So pick one which has local collision avoidance. For example: dwa_planner, dwb_planner, teb_planner.

@Timple where can i add in my local planner..

`<?xml version="1.0"?>

` Which node i can add the dwa_planner, dwb_planner, teb_planner. @Timple @rokusottervanger @MCFurry @cesar-lopez-mar please me
PVijayaGanesh commented 3 weeks ago

Besed on the dynamic obstacle can i change the global plan generated by the FCPP @Timple is it possible..? if not which node i need to change to change to add this feature @Timple

please reply.. @Timple

Timple commented 3 weeks ago

As mentioned, local obstacle avoidance is out of scope for this package. So please refer to https://robotics.stackexchange.com/

rokusottervanger commented 2 weeks ago

@Timple where can i add in my local planner..

<arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
<!-- AMCL -->
<include file="$(find robot_navigation)/launch/amcl.launch"/>

<node pkg="robot_navigation" type="intial_pose_estimation.py" name="intial_pose_estimator"/>
<!--Move base flex, using the full_coverage_path_planner-->
<node pkg="mbf_costmap_nav" type="mbf_costmap_nav" respawn="false" name="move_base_flex" output="screen" required="true">
    <param name="tf_timeout" value="1.5"/>
    <rosparam file="$(find full_coverage_path_planner)/test/full_coverage_path_planner/param/planners.yaml" command="load" />
    <rosparam file="$(find full_coverage_path_planner)/test/full_coverage_path_planner/param/local_costmap_params.yaml" command="load" />
    <param name="SpiralSTC/robot_radius" value="$(arg robot_footprint_size)"/>
    <param name="SpiralSTC/tool_radius" value="$(arg sweeper_size)"/>
    <param name="global_costmap/robot_radius" value="$(arg robot_footprint_size)"/>
    <remap from="odom" to="/odom"/>
    <remap from="scan" to="/scan"/>

    <remap from="/move_base_flex/SpiralSTC/plan" to="/move_base/SpiralSTC/plan"/>
    <remap from="/move_base_flex/tracking_pid/interpolator" to="/move_base/TrackingPidLocalPlanner/interpolator"/>
</node>

<!-- Move Base backwards compatibility -->
<node pkg="mbf_costmap_nav" type="move_base_legacy_relay.py" name="move_base" >
    <param name="base_global_planner" value="SpiralSTC" />
</node>

<!--We need a map to fully cover-->
<node name="grid_server" pkg="map_server" type="map_server" args="$(arg map)">
    <param name="frame_id" value="map"/>
</node>

<!--Tracking_pid cannot just accept a nav_msgs/Path, it can only go to a PoseStamped,
   so the path_interpolator drags a PoseStamped over a Path at a given speed-->
<node name="interpolator" pkg="tracking_pid" type="path_interpolator">
    <param name="target_x_vel" value="$(arg target_x_vel)"/>
    <param name="target_x_acc" value="$(arg target_x_acc)"/>
    <param name="target_yaw_vel" value="$(arg target_yaw_vel)"/>
    <param name="target_yaw_acc" value="$(arg target_yaw_acc)"/>
    <remap from="path" to="/move_base/SpiralSTC/plan"/>
</node>

<!--Tracking_pid tries to get the robot as close to it's goal point as possible-->
<node name="controller" pkg="tracking_pid" type="controller" output="screen">
    <remap from="move_base/cmd_vel" to="/cmd_vel"/>
    <remap from="local_trajectory" to="trajectory"/>
    <param name="controller_debug_enabled" value="True"/>
    <param name="track_base_link" value="true"/>
    <param name="l" value="0.2"/>
    <param name="Ki_long" value="0.0"/>
    <param name="Kp_long" value="1.0"/>
    <param name="Kd_long" value="0.5"/>
    <param name="Ki_lat" value="0.0"/>
    <param name="Kp_lat" value="2.0"/>
    <param name="Kd_lat" value="0.3"/>
    <param name="Kd_lat" value="0.3"/>
</node>

<!-- Launch coverage progress tracking -->
<node pkg="tf" type="static_transform_publisher" name="map_to_coveragemap" args="$(arg coverage_area_offset) map coverage_map 100" />
<node pkg="full_coverage_path_planner" type="coverage_progress" name="coverage_progress">
    <param name="~target_area/x" value="$(arg coverage_area_size_x)" />
    <param name="~target_area/y" value="$(arg coverage_area_size_y)" />
    <param name="~coverage_radius" value="$(arg sweeper_size)" />
    <remap from="reset" to="coverage_progress/reset" />
    <param name="~map_frame" value="coverage_map"/>
</node>

<!-- rviz -->
    <node name="rviz" pkg="rviz" type="rviz" args="-d $(find robot_navigation)/rviz/fcpp.rviz" />

`

Which node i can add the dwa_planner, dwb_planner, teb_planner. @Timple @rokusottervanger @MCFurry @cesar-lopez-mar please me

A local planner can be configured in the configuration for mbf_costmap_nav from the move_base_flex package. Please refer to that package to learn more: https://github.com/magazino/move_base_flex

If you add a local planner to the move base flex configuration, that would mean you don't need this part of the launch file:

<!--Tracking_pid cannot just accept a nav_msgs/Path, it can only go to a PoseStamped,
   so the path_interpolator drags a PoseStamped over a Path at a given speed-->
<node name="interpolator" pkg="tracking_pid" type="path_interpolator">
    <param name="target_x_vel" value="$(arg target_x_vel)"/>
    <param name="target_x_acc" value="$(arg target_x_acc)"/>
    <param name="target_yaw_vel" value="$(arg target_yaw_vel)"/>
    <param name="target_yaw_acc" value="$(arg target_yaw_acc)"/>
    <remap from="path" to="/move_base/SpiralSTC/plan"/>
</node>

<!--Tracking_pid tries to get the robot as close to it's goal point as possible-->
<node name="controller" pkg="tracking_pid" type="controller" output="screen">
    <remap from="move_base/cmd_vel" to="/cmd_vel"/>
    <remap from="local_trajectory" to="trajectory"/>
    <param name="controller_debug_enabled" value="True"/>
    <param name="track_base_link" value="true"/>
    <param name="l" value="0.2"/>
    <param name="Ki_long" value="0.0"/>
    <param name="Kp_long" value="1.0"/>
    <param name="Kd_long" value="0.5"/>
    <param name="Ki_lat" value="0.0"/>
    <param name="Kp_lat" value="2.0"/>
    <param name="Kd_lat" value="0.3"/>
    <param name="Kd_lat" value="0.3"/>
</node>

Replanning can be configured in move_base_flex too, as this is behavior of the governing behavior tree or state machine implementation calling the get_plan and exe_path actions. I'm not sure if the FCPP plans on the global costmap or on the map served by the map server, though. If it uses the global costmap, replanning around an obstacle would be trivial. If it uses the plain map, that map would have to be updated before any obstacle would be taken into account. I would have to dig into the code, but maybe @Timple knows more about this?