ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Nav2 not rotating to goal

asked 2022-08-30 07:32:48 -0600

marpeja gravatar image

Hi!

I am struggling with making my robot reach the goal. I get to it easily in pose, but not in orientation. After I get to the goal in pose, the robot struggles to rotate towards the correct orientation, in fact, it rotates really slow or it doesn't even rotate.

image description

image description

I have tried playing with the parameters of the DWB controller critics, specially with the RotateToGoal one, which has an slowing_factor to reduce the angular speed. I set this parameter to 1 instead of to 5 as it is by default, but I haven't obtained anything, even after setting a huge max_vel_theta of 4.5 rad/s.

What's more, sometimes the robot reaches the goal with the correct orientation but the Controller doesn't seem to acknowledge it and keeps looking for a path. I checked the Goal Checker and it seems all the tolerances are perfectly defined and are not especially too low.

image description

image description

I also made the controller publish the cost_grid_pc, but I only get a pointcloud without any information, so I don't know whether the controller plugins are doing anything...

image description

Any idea on what I can do or on where the problem might be?

Pd: here is my Controller config:

controller_server:
  ros__parameters:
    use_sim_time: True
    odom_topic: /odom/unfiltered
    controller_frequency: 20.0
    min_x_velocity_threshold: 0.001
    min_y_velocity_threshold: 0.5
    min_theta_velocity_threshold: 0.001
    failure_tolerance: 0.3
    progress_checker_plugin: "progress_checker"
    goal_checker_plugins: ["general_goal_checker"] # "precise_goal_checker"
    controller_plugins: ["FollowPath"]

    # Progress checker parameters
    progress_checker:
      plugin: "nav2_controller::SimpleProgressChecker"
      required_movement_radius: 0.2
      movement_time_allowance: 20.0
    # Goal checker parameters
    #precise_goal_checker:
    #  plugin: "nav2_controller::SimpleGoalChecker"
    #  xy_goal_tolerance: 0.25
    #  yaw_goal_tolerance: 0.25
    #  stateful: True
    general_goal_checker:
      plugin: "nav2_controller::SimpleGoalChecker"
      xy_goal_tolerance: 0.25
      yaw_goal_tolerance: 0.25
      stateful: True
    # DWB parameters
    FollowPath:
      plugin: "dwb_core::DWBLocalPlanner"
      debug_trajectory_details: True
      min_vel_x: 0.0
      min_vel_y: 0.0
      max_vel_x: 1.5
      max_vel_y: 1.5
      max_vel_theta: 4.5
      min_speed_xy: 0.4
      max_speed_xy: 1.5
      min_speed_theta: 0.0
      # Add high threshold velocity for turtlebot 3 issue.
      # https://github.com/ROBOTIS-GIT/turtlebot3_simulations/issues/75
      acc_lim_x: 2.5
      acc_lim_y: 0.0
      acc_lim_theta: 3.2
      decel_lim_x: -2.5
      decel_lim_y: 0.0
      decel_lim_theta: -3.2
      vx_samples: 20
      vy_samples: 10
      vtheta_samples: 20
      sim_time: 1.2
      linear_granularity: 0.05
      angular_granularity: 0.025
      transform_tolerance: 0.2
      xy_goal_tolerance: 0.25
      trans_stopped_velocity: 0.5
      short_circuit_trajectory_evaluation: True
      stateful: True
      publish_cost_grid_pc: True
      critics: ["RotateToGoal", "Oscillation", "BaseObstacle", "GoalAlign", "PathAlign", "PathDist", "GoalDist"]
      BaseObstacle.scale: 5.0
      PathAlign.scale: 32.0
      PathAlign.forward_point_distance: 0.1
      GoalAlign.scale: 24.0
      GoalAlign.forward_point_distance: 0.1
      PathDist.scale: 32.0
      GoalDist.scale: 24.0
      RotateToGoal.scale: 1.0
      RotateToGoal.slowing_factor: 1.0
      RotateToGoal.lookahead_time: -1.0

Thank you!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-08-30 08:14:30 -0600

ljaniec gravatar image

Do you want to have correct orientation before next movement command? Because this can be simply solved by RotationShimController.

I suggest you to try changing value of yaw_goal_tolerance, based on this:

general_goal_checker:
      plugin: "nav2_controller::SimpleGoalChecker"
      xy_goal_tolerance: 0.25
      yaw_goal_tolerance: 0.25 <---- this is rad/4, so around 14 degrees, quite a lot!
      stateful: True
edit flag offensive delete link more

Comments

Thank you again for answering me again @ljaniec.

I don't mind not having the correct orientation before the next movement, I just want that whenever the robot reaches the pose of the goal, rotates in place to match the correct orientation.

However, I will try with the other Controller you suggested!

As regards changing the yaw_goal_tolerance on the goal checker, isn't it just to check if the tolerance to check if the robot has reached the orientation goal?, meaning that if the robot is whithin +-14 degrees about the orientation marked, its orientation would be considered as a reached goal.

14 degrees for my project is Ok, but the problem is that the robot rotates very very slowly towards the correct orientation after it has reached the pose goal, so if I could increase this speed it would be fine for me!

marpeja gravatar image marpeja  ( 2022-08-30 09:09:43 -0600 )edit

Yes, yaw_goal_toleranceworks like you wrote: https://github.com/ros-planning/navig...

The controller has more general parameters, maybe some of them would be useful to check and modify?

https://navigation.ros.org/configurat...

You critic RotateToGoal.slowing_factor: 1.0 - did you tried to change it to 0? It is 5.0 normally, you changed it to 1, maybe it should be even lower? Maybe the URDF model has something to modify accordingly (e.g. torques, velocities limits etc.)?

For the controller that is missing the goal and is trying to find a new path - maybe bigger XY tolerances could help?

ljaniec gravatar image ljaniec  ( 2022-08-30 09:46:47 -0600 )edit
1

The controller you suggested at the beginning is the solution!, Making it work along with the Regulated Pure Pursuit controller made the solution. Now it works exactly as I wanted to.

Thank you again!

marpeja gravatar image marpeja  ( 2022-08-30 10:16:39 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2022-08-30 07:32:48 -0600

Seen: 576 times

Last updated: Aug 30 '22