ros-navigation / navigation2

ROS 2 Navigation Framework and System
https://nav2.org/
Other
2.57k stars 1.29k forks source link

MPPI generates undesirable paths #4172

Closed atinfinity closed 7 months ago

atinfinity commented 8 months ago

Bug report

Required Info:

Steps to reproduce issue

I used https://github.com/atinfinity/megarover_samples_ros2.

$ mkdir -p ~/dev_ws/src
$ cd ~/dev_ws/src
$ git clone https://github.com/atinfinity/megarover_samples_ros2.git
$ cd ..
$ rosdep install -y -i --from-paths src/megarover_samples_ros2
$ colcon build --symlink-install
$ source ~/dev_ws/install/setup.bash
$ ros2 launch megarover_samples_ros2 vmegarover_with_sample_world.launch.py
$ ros2 launch megarover_samples_ros2 vmegarover_navigation.launch.py

And, I set a goal in front of the robot via RViz2.

Expected behavior

I expect the robot to go straight.

Actual behavior

In fact, the robot moves around in a slight curve. I referred to https://navigation.ros.org/configuration/packages/configuring-mppic.html#example.

mppi

Additional information

I tried to use DWB. The robot to go straight.

dwb

SteveMacenski commented 7 months ago

I believe I know the root cause and this was actually fixed some weeks ago but just hasn't made it out to the Humble binaries yet.

If you apply this patch https://github.com/ros-planning/navigation2/commit/b489f5b79baea6c9f6b91ecb23c5a2725317c140 does that fix your issue? If so, it'll be out in binaries in the next sync.

atinfinity commented 7 months ago

@SteveMacenski Thank you for your help! After applying this patch, this problem was resolved.

SteveMacenski commented 7 months ago

My favorite kind of problem: the one I already solved 🙂