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
2.3k stars 348 forks source link

robot not moving through service call #52

Closed Aak02ash closed 9 months ago

Aak02ash commented 9 months ago

Hi, I am using RRT* as my global planner and apf as my local planner. When I use 2dNavGoal in rviz, the robot is moving but when i do a service call using _rosservice call /move_base/SamplePlanner/make_plan "start: {header: {stamp: now, frame_id: 'map'}, pose: {position: {x: 0.0, y: 0.0, z: 0.0}, orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}}} goal: {header: {stamp: now, frameid: 'map'}, pose: {position: {x: -6.4, y: 0.3, z: 0.0}, orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}}}"

I am getting the plan and tree in rviz but the robot is not moving. I am not sure whether the goal is passed to move_base. Also I can't find the section of the code where the goal is passed to move_base. Some help is very much appreciated. Thanks in advance.

ai-winter commented 9 months ago

@Aak02ash In fact, you need to pass the goal data to move_base through the move_base_simple/goal topic.

Aak02ash commented 9 months ago

Can you tell me in which part of the code? Do I need to make a new function in rrt_star.cpp?

ai-winter commented 9 months ago

@Aak02ash

No source code modification is required. Using the 2D Nav in Rviz will automatically publish the move_base_simple/goal topic and achieve navigation without any additional operations.

Aak02ash commented 9 months ago

@ai-winter I want to navigate without 2D Nav in Rviz. I wanted to enter a custom goal through terminal. That's why I was doing the service call. But the robot is not moving when I give the goal through service call. Ca you tell me whether there is any other way to give custom goal through terminal?

ai-winter commented 9 months ago

@Aak02ash

Like this

rostopic pub move_base_simple/goal ...
Aak02ash commented 9 months ago

Thanks