ai-winter / ros_motion_planning

Motion planning and Navigation of AGV/AMR:ROS planner plugin implementation of A*, JPS, D*, LPA*, D* Lite, Theta*, RRT, RRT*, RRT-Connect, Informed RRT*, ACO, PSO, Voronoi, PID, LQR, MPC, DWA, APF, Pure Pursuit etc.
GNU General Public License v3.0
1.92k stars 278 forks source link

Real Robot #5

Closed tugbakara closed 6 months ago

tugbakara commented 1 year ago

Is it applicable for real robot and how? Can I test them especially RRTs in real robot, also user_config.yaml have world parameter , this is for gazebo.

ZhanyuGuo commented 1 year ago

Hello @tugbakara, and thanks for your supporting!

For now, getting the reposity to work on a real robot is a bit of a hassle:

  1. You need to disable the gazebo, which occupies the localization module.
  2. Input your own /odom and /map (maybe something else) to the system.
  3. Get the output like /cmd_vel and input to your robot's driver.

Obviously, the aforementioned approach is cumbersome and prone to problems.😥 Therefore, we plan to complete and test a pipeline running on real robots in the near future (about a month).

If you have enough time, you are welcome to come back and support our reposity later, and we will remind you once we finish the update. If not, we hope you can share your experiences in the real robot application, or even contribute to our reposity. That would be a wonderful thing for everyone!😀

We will make it as soon as possible, and we are sorry that we haven't been able to give you what you need so far.

ZhanyuGuo commented 1 year ago

We are back with an instruction! @tugbakara

Application on a Real Robot

In a word, compile our repository and make it visible to the robot, and then replace it just like other planner in ROS navigation.

Example

We use another gazebo simulation as an example, like we have a robot which has the capacity of localization, mapping and navigation (using move_base).

  1. Download and compile this repository.

    cd <your_workspace>/
    git clone https://github.com/ai-winter/ros_motion_planning.git
    
    cd ros_motion_planning/
    catkin_make
  2. Download and compile the 'real robot' software.

    cd <your_workspace>/
    git clone https://github.com/ZhanyuGuo/ackermann_ws.git
    
    cd ackermann_ws/
    # ---- IMPORTANT HERE, reasons in NOTE ----
    source <your_workspace>/ros_motion_planning/devel/setup.bash
    
    catkin_make

    NOTE: Sourcing other workspaces before catkin_make will make the current setup.bash contain former sourced workspaces, i.e. they are also included when you only source this current workspace later. REMEMBER to remove the old build/ and devel/ of current workspace before doing this, otherwise it will not work.

  3. Change the base_global_planner and base_local_planner in real robot's move_base as you need.

    <?xml version="1.0"?>
    <launch>
        <!-- something else ... -->
        <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
            <!-- something else ... -->
    
            <!-- Params -->
            <!-- for graph_planner -->
            <rosparam file="$(find sim_env)/config/planner/graph_planner_params.yaml" command="load" />
            <!-- for sample_planner -->
            <rosparam file="$(find sim_env)/config/planner/sample_planner_params.yaml" command="load" />
            <!-- for dwa_planner -->
            <rosparam file="$(find sim_env)/config/planner/dwa_planner_params.yaml" command="load" />
            <!-- for pid_planner -->
            <rosparam file="$(find sim_env)/config/planner/pid_planner_params.yaml" command="load" />
    
            <!-- Default Global Planner -->
            <!-- <param name="base_global_planner" value="global_planner/GlobalPlanner" /> -->
            <!-- GraphPlanner -->
            <param name="base_global_planner" value="graph_planner/GraphPlanner" />
            <!-- options: a_star, jps, gbfs, dijkstra, d_star, lpa_star, d_star_lite -->
            <param name="GraphPlanner/planner_name" value="a_star" />
            <!-- SamplePlanner -->
            <!-- <param name="base_global_planner" value="sample_planner/SamplePlanner" /> -->
            <!-- options: rrt, rrt_star, informed_rrt, rrt_connect -->
            <!-- <param name="SamplePlanner/planner_name" value="rrt_star" /> -->
    
            <!-- Default Local Planner -->
            <!-- <param name="base_local_planner" value="teb_local_planner/TebLocalPlannerROS" /> -->
            <param name="base_local_planner" value="pid_planner/PIDPlanner" />
            <!-- <param name="base_local_planner" value="dwa_planner/DWAPlanner" /> -->
    
            <!-- something else ... -->
        </node>
        <!-- something else ... -->
    </launch>
  4. Run! But maybe there are still some details that you have to deal with...