Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[for help] action follow_path doesn't work (humble) #4370

Closed
GoesM opened this issue May 27, 2024 · 7 comments
Closed

[for help] action follow_path doesn't work (humble) #4370

GoesM opened this issue May 27, 2024 · 7 comments
Labels
question Further information is requested

Comments

@GoesM
Copy link
Contributor

GoesM commented May 27, 2024

Bug report

Required Info:

  • Operating System:
    • ubuntu 22.04
  • ROS2 Version:
    • humble
  • Version or commit hash:
    • the latest
  • DDS implementation:
    • defaulted

Steps to reproduce issue

my command:

ros2 action send_goal /follow_path nav2_msgs/action/FollowPath "
controller_id: 'FollowPath'
goal_checker_id: 'general_goal_checker'
path:
  header:
    stamp:
      sec: 0
      nanosec: 0
    frame_id: 'map'
  poses:
    - header:
        frame_id: 'map'
      pose:
        position:
          x: -2.0
          y: 1.5
          z: 0.0
        orientation:
          x: 0.0
          y: 0.0
          z: 0.0
          w: 1.0
    - header:
        frame_id: 'map'
      pose:
        position:
          x: 1.0
          y: -1.5
          z: 0.0
        orientation:
          x: 0.0
          y: 0.0
          z: 0.0
          w: 1.0
    - header:
        frame_id: 'map'
      pose:
        position:
          x: -1.0
          y: 2.0
          z: 0.0
        orientation:
          x: 0.0
          y: 0.0
          z: 0.0
          w: 1.0 "

callback info:

Goal accepted with ID: eb1efacf83804822bc97d5bff0818820

Result:
    result: {}

Goal finished with status: ABORTED

Expected behavior

Actual behavior

the navigation2 regard my path as an empty path (following it log):

[controller_server-9] [INFO] [1716797013.770443479] [controller_server]: Received a goal, begin computing control effort.
[controller_server-9] [WARN] [1716797013.770569341] [controller_server]: Resulting plan has 0 poses in it.
[controller_server-9] [WARN] [1716797013.820611688] [controller_server]: Resulting plan has 0 poses in it.
[controller_server-9] [WARN] [1716797013.870615594] [controller_server]: Resulting plan has 0 poses in it.
[controller_server-9] [WARN] [1716797013.920622037] [controller_server]: Received plan with zero length
[controller_server-9] [WARN] [1716797013.970616956] [controller_server]: Received plan with zero length
[controller_server-9] [WARN] [1716797014.020608404] [controller_server]: Received plan with zero length
[controller_server-9] [WARN] [1716797014.070613054] [controller_server]: Received plan with zero length
[controller_server-9] [WARN] [1716797014.120619206] [controller_server]: Received plan with zero length
[controller_server-9] [ERROR] [1716797014.120640876] [controller_server]: Controller patience exceeded
[controller_server-9] [WARN] [1716797014.120653814] [controller_server]: [follow_path] [ActionServer] Aborting handle.

Additional information

I'm not sure whether my command was wrong or something went wrong in navigation2.

I'd appreciate it if anyone could help me ^_^.

@GoesM GoesM changed the title [for help] navigateThroughPoses doesn't work (humble) [for help] follow_path doesn't work (humble) May 28, 2024
@GoesM GoesM changed the title [for help] follow_path doesn't work (humble) [for help] action follow_path doesn't work (humble) May 28, 2024
@SteveMacenski SteveMacenski added the question Further information is requested label May 28, 2024
@SteveMacenski
Copy link
Member

I'm not sure whether my command was wrong

I'm pretty sure its your command since that is the same API that is used by the BT and the Python3 API to send the paths to the controller server over the action interface.

I see there's a trailing space after your last orientation - try removing that? Maybe there's a problem in serializing your path and the CLI clips the entire field that failed to serialize (i.e. the poses list) and thus is empty?

@padhupradheep
Copy link
Member

I ran the same command in the terminal and tested on our robot, seems to work fine..

@GoesM could you please share your setup and some information on how to reproduce the issue?

@GoesM
Copy link
Contributor Author

GoesM commented May 29, 2024

my steps to reproduce the issue

I setup my navigation2-humble by following steps:

install

cd ros_ws
git clone https://github.com/ros-navigation/navigation2.git -b humble

setup

export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
colcon build \
	--cmake-clean-cache \
	--cmake-args \
		-DBUILD_TESTING=OFF \
		-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} \
			-w -Wno-error -Wno-everything" \
		-DCMAKE_C_FLAGS="${CMAKE_C_FLAGS}  \
			-w -Wno-error -Wno-format-security"

launch

export ROS_LOG_DIR="ros_log"
source install/setup.bash
export TURTLEBOT3_MODEL=waffle
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/opt/ros/humble/share/turtlebot3_gazebo/models
ros2 launch nav2_bringup tb3_simulation_launch.py headless:=False use_rviz:=True use_composition:=False

my command and result

ros2 action send_goal /follow_path nav2_msgs/action/FollowPath "
controller_id: 'FollowPath'
goal_checker_id: 'general_goal_checker'
path:
  header:
    stamp:
      sec: 0
      nanosec: 0
    frame_id: 'map'
  poses:
    - header:
        frame_id: 'map'
      pose:
        position:
          x: -2.0
          y: 1.5
          z: 0.0
        orientation:
          x: 0.0
          y: 0.0
          z: 0.0
          w: 1.0
    - header:
        frame_id: 'map'
      pose:
        position:
          x: 1.0
          y: -1.5
          z: 0.0
        orientation:
          x: 0.0
          y: 0.0
          z: 0.0
          w: 1.0
    - header:
        frame_id: 'map'
      pose:
          w: 1.0 "n:
Waiting for an action server to become available...
Sending goal:
     path:
  header:
    stamp:
      sec: 0
      nanosec: 0
    frame_id: map
  poses:
  - header:
      stamp:
        sec: 0
        nanosec: 0
      frame_id: map
    pose:
      position:
        x: -2.0
        y: 1.5
        z: 0.0
      orientation:
        x: 0.0
        y: 0.0
        z: 0.0
        w: 1.0
  - header:
      stamp:
        sec: 0
        nanosec: 0
      frame_id: map
    pose:
      position:
        x: 1.0
        y: -1.5
        z: 0.0
      orientation:
        x: 0.0
        y: 0.0
        z: 0.0
        w: 1.0
  - header:
      stamp:
        sec: 0
        nanosec: 0
      frame_id: map
    pose:
      position:
        x: -1.0
        y: 2.0
        z: 0.0
      orientation:
        x: 0.0
        y: 0.0
        z: 0.0
        w: 1.0
controller_id: FollowPath
goal_checker_id: general_goal_checker

Goal accepted with ID: 9ce6b1f8b3a44dfca656fcbc8e7c2c6a

Result:
    result: {}

Goal finished with status: ABORTED

@GoesM
Copy link
Contributor Author

GoesM commented May 29, 2024

thanks for your replies and focus on the issue. ^_^

I ran the same command in the terminal and tested on our robot, seems to work fine..

@padhupradheep uh huh , i failed all the time in my environment.. Did you test also within humble branch ?

I see there's a trailing space after your last orientation - try removing that? Maybe there's a problem in serializing your path and the CLI clips the entire field that failed to serialize (i.e. the poses list) and thus is empty?

uh.... the result seems the same after removing.

@SteveMacenski
Copy link
Member

I see this too, but I can't explain it. If its not happening in the Python or BT which uses the Python and C++ Action APIs respectively, I expect its an issue with the CLI parsing (or how its populated?) and not something in Nav2. I also see this in Iron/Rolling on 22.04 (not rolling 24.04, can't test that yet). I know the CLI populating is really really finnicky, so it wouldn't surprise me if there's something just not quite formatted as it expects that is causing the issue.

I usually do the ros2 action send_goal /server msg " and tab tab to complete the message template and then fill that in since I know it can be a problem. That looks different from yours, so worth a try

@padhupradheep
Copy link
Member

padhupradheep commented May 30, 2024

Okay, now I just tested the default nav2_bringup. I noticed that the coordinates that @GoesM is giving is outside the map. That's the reason why we have a resulting plan with 0 poses.

@GoesM: I hope you are not using anyother special world. I tried the following coordinates, and it worked fine for me. Only thing is I couldn't visualize the global plan for some weird reason.

ros2 action send_goal /follow_path nav2_msgs/action/FollowPath "
controller_id: 'FollowPath'
goal_checker_id: 'general_goal_checker'
path:
  header:
    stamp:
      sec: 0
      nanosec: 0
    frame_id: 'map'
  poses:
    - header:
        frame_id: 'map'
      pose:
        position:
          x: -1.73
          y: -0.523
          z: 0.0
        orientation:
          x: 0.0
          y: 0.0
          z: 0.0
          w: 1.0
    - header:
        frame_id: 'map'
      pose:
        position:
          x: -1.18
          y: -0.59
          z: 0.0
        orientation:
          x: 0.0
          y: 0.0
          z: 0.0
          w: 1.0
    - header:
        frame_id: 'map'
      pose:
        position:
          x: -0.60
          y: -0.519
          z: 0.0
        orientation:
          x: 0.0
          y: 0.0
          z: 0.0
          w: 1.0 "

Note that, I have all the packages installed as binaries and not built from source on 22.04

@GoesM
Copy link
Contributor Author

GoesM commented May 30, 2024

@padhupradheep Thanks a lot ! You're right ! It's because some poses are outside the map so that nav2 drop it.

Greatly thanks for all of your reply. No problem about this issue anymore.

@GoesM GoesM closed this as completed May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants