gkouros / waypoint-global-planner

A global planner that generates a path using manually inserted waypoints. Compatible with move_base.
BSD 3-Clause "New" or "Revised" License
171 stars 58 forks source link

syntax error near unexpected token 'waypoint_global_planner::WaypointGlobalPlanner' #5

Closed arunekk closed 2 years ago

arunekk commented 3 years ago

Hi , I clone the package to my workspace and added <rosparam file="$(find waypoint_global_planner)/config/base_global_planner_params.yaml" command="load"/> to my move_base launch file

and made the waypoint_global_planner.cpp file executable

but when I ran rosrun waypoint_global_planner waypoint_global_planner.cpp

it shows me the following error

/home/npd-agv/catkin_ws/src/waypoint-global-planner/src/waypoint_global_planner.cpp: line 6: syntax error near unexpected token `waypoint_global_planner::WaypointGlobalPlanner,'
/home/npd-agv/catkin_ws/src/waypoint-global-planner/src/waypoint_global_planner.cpp: line 6: `PLUGINLIB_EXPORT_CLASS(waypoint_global_planner::WaypointGlobalPlanner, nav_core::BaseGlobalPlanner)'

What should I change in the .cpp file?? Help me to solve out.

Regards, Arunkumar

gkouros commented 3 years ago

The only thing I can suggest is to re-source your workspace and if that doesn't work rebuild the entire workspace from scratch.

Can you share the executable you created? Maybe I can spot a potential mistake, if the issue is in your implementation.

arunekk commented 3 years ago

Thanks for the reply, I didn't created a new executable I just made the waypoint_global_planner..cpp file in the /src directory to be executable. Also you can tell me the proper steps of implementation.

Regards, Arunkumar

gkouros commented 3 years ago

The cpp file in the repo is a plugin, not an executable. You have to load it through move_base. Look into the ros navigation tutorials to get a better understanding about how everything fits together.

arunekk commented 3 years ago

okay so I should not run the cpp file right?? (ie) rosrun waypoint_global_planner waypoint_global_planner.cpp

I loaded in my move_base launch file ,

<launch>
    <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
        <rosparam file="$(find robot)/param/navigation/costmap_common_params.yaml" command="load" ns="global_costmap" />
        <rosparam file="$(find robot)/param/navigation/costmap_common_params.yaml" command="load" ns="local_costmap" />
        <rosparam file="$(find robot)/param/navigation/local_costmap_params.yaml" command="load" />
        <rosparam file="$(find robot)/param/navigation/global_costmap_params.yaml" command="load" />
        <rosparam file="$(find robot)/param/navigation/base_local_planner_default_params.yaml" command="load" />
        <rosparam file="$(find robot)/param/navigation/move_base_params.yaml" command="load" />
    <rosparam file="$(find waypoint_global_planner)/config/base_global_planner_params.yaml" command="load"/>
    </node>
</launch>

okay so can you list out the steps that need to followed to implement in a proper way.

Regards, Arunkumar

gkouros commented 3 years ago

Yes, you don't need to run the cpp file. If it's built and linked properly, it will be loaded by move_base based on your config file. You don't have to do anything else.

arunekk commented 3 years ago

Yeah I have runned successfully. But now I am facing new issues (i.e)

  1. I am able to click the publish point only on the lines of the grid
  2. I created multiple points and line is also drawn but my robot goes to the final position directly by using its own path. Help me to solve those

Regards, Arunkumar

gkouros commented 3 years ago

Maybe read the discussion on issue https://github.com/gkouros/waypoint-global-planner/issues/3 . It seems you have the same problem.

arunekk commented 3 years ago

Hi , Sorry for the Late response

Yeah I saw that discussion already. I am using DWAplanner as my local planner.

Here is my move_base_params.yaml file


base_global_planner: waypoint_global_planner/WaypointGlobalPlanner
base_local_planner: dwa_local_planner/DWAPlannerROS

shutdown_costmaps: false

controller_frequency: 5.0 #before 5.0
controller_patience: 3.0

planner_frequency: 0.5
planner_patience: 5.0

oscillation_timeout: 10.0
oscillation_distance: 0.2

conservative_reset_dist: 0.1 #distance from an obstacle at which it will unstuck itself

cost_factor: 1.0
neutral_cost: 66
lethal_cost: 255

So what are the parameters that I need to change in Order to achieve the Exact output .

Regards, Arunkumar