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

ROS2 plan a trajectory without mapping (without lidar)

asked 2022-05-17 04:19:16 -0500

Bastian2909 gravatar image

updated 2022-05-17 06:35:56 -0500

Hello, first of all, for a little bit of context, i'm using ros2 foxy with ubuntu 20.04 and gazebo 11. I'm still learning how everything works together so, if i'm saying something wrong, i would really appreciate to be corrected !

I have a robot defined within a urdf file, with plugins to work properly in gazebo. My robot spawn correctly, i can control it with teleop_twist_keyboard and the /tf odom -> base_link and base_link -> [other parts of my robot] are published correctly. As odometry sources I am using differential drive encoder and an absolute location plugin in gazebo (gazebo_ros_p3d) and I have an IMU. My robot spawn in a gazebo world that is just a planar ground with no obstacles

Now I just want to be able to say to my robot something like "go to x=10 and y=12" in an empty map, I don't need to map my environment (as i believe it will be hard with my available sensors anyway). The problem I am facing is that in tutorial like they tends to use lidars which i can't use. From what i understood I have to publish the map -> Odom transform in order to go further but everything i found used lidars to publish it.

Now if anyone could give me some hints in where to look at, that would be wonderful !

On a side note, my robot have a trailer (for now i'm doing as if it wasn't here) but if you happens to have some documentation on path planning with a trailer I would greatly appreciate !

Thank you anyone who took the time to ream me, if you want me to add anything just tell me !

Would you have a tutorial I could follow with

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2022-05-18 03:16:05 -0500

Per Edwardsson gravatar image

The map->odom is responsible for compensating for sensor drift, and also for locating the robot starting location in a map. If you have no drift and do not care about absolute coordinates, feel free to provide a static identity transform between map and odom (ros2 run tf2_ros static_transform_publisher 0.0 0.0 0.0 0.0 0.0 0.0 map odom).

edit flag offensive delete link more


This is exactly what i needed, thank you !

Bastian2909 gravatar image Bastian2909  ( 2022-05-18 04:31:29 -0500 )edit

answered 2022-05-17 07:22:28 -0500

If you do not have a map and obstacles then there isn't really a need for planner but just a controller ?

A while ago I was working on exactly same thing as you described, given current pose, navigate to pose X. I wrote a ROS2 action server and client named navigate_to_pose, check it out here. From the README of the repo ;

It is suggested you get grasp of ROS Actions in order to test and understand navigate_to_pose action interface provided in ros2_demo_python_nodes/ros2_demo_python_nodes/
THe purpose of this action node is to drive a robot to a certain pose (hence navigate_to_pose), It is required that you have a valid tf tree, depending on your localization setup you should have either in map or odom frame to base_link transforms, modify ros2_demo_python_nodes/ros2_demo_python_nodes/ with correct frame id (either map or odom) in the get_curr_robot_pose function.
To test the actions, source your workspace and do;
ros2 launch ros2_demo_python_nodes
In a separate terminal;
ros2 run ros2_demo_python_nodes nav_to_pose_action_client
For this to succeed, you do need a complete tf transform from odom/map to base_link so that robot can know its current position and navigate itself towards the goal. You can change the goal pose in ros2_demo_python_nodes/ros2_demo_python_nodes/ to send robot to different pose.
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2022-05-17 04:19:16 -0500

Seen: 834 times

Last updated: May 18 '22