-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Local costmap for robot with obstacles #4138
Comments
Costmap updates are updates from the costmap to rviz. When you publish to that topic, you're not actually updating the costmap at all, you're just displaying your own message in rviz. The costmap has its values updated either by the local server that hosts the costmap object (which you don't have, by launching it independently) or via the costmap layer plugins. These are algorithm that sit inside of the costmap object that subscribe to sensor data or otherwise to update the costmap's values. So, I think you need to make a "real" config file for your costmap launching to give it your CLI settings + add in other plugins and other settings to get it behave the way you like. You could, for instance, use the StaticLayer to take in a Check out our docs:
|
Hi @SteveMacenski. Thanks for your answer. Using the plugin layers to update the actual costmap makes sense, as i will be adding more sensors afterwards. |
Obviously add / subtract settings and adjust to the appropriate node name you're using, but this is more or less what you should use as a base: https://github.com/ros-planning/navigation2/blob/main/nav2_bringup/params/nav2_params.yaml#L139-L179 |
Alright. But do i need to do this from the nav2 bringup package, or should i be able to start the layers with the default nav2_costmap_2d node included in the nav2_costmap package without modifying it? When i get back to my setup i will make my paramsfile, and launch my costmap like this: ´´´ What still confuses me is how the actual plugin layers are launched, as i don't see anything about them in the .cpp file which launches the costmap_2d node: https://github.com/ros-planning/navigation2/blob/main/nav2_costmap_2d/src/costmap_2d.cpp In my head i would need to write my own rosnode that utilizes the staticlayer plugin, and bring that up with the costmap node. |
They're just parameters, treat it as you wish using standard ROS parameter APIs in CLI or launch or what have you |
I am trying to implement a corner of the nav2 stack on a robot. What i am interested in, is using the costmap_2d package, to keep track of incoming obstacles in a local costmap, by rolling it infront of the robot.
Currently, i am using the nav2_costmap_2d node, and running it with:
ros2 run nav2_costmap_2d nav2_costmap_2d --ros-args -p rolling_window:=true -p height:=5 -p width:=5 -p resolution:=0.1 -p global_frame:=odom
This correctly spawns a costmap for me, that i can visualize in RVIZ. I can also call the /costmap/costmap_updates to insert values into the map, which then changes color of the cells in rviz. My problem is that whenever the costmap updates, all the cells that i have filled through the update topic disappears. Furthermore, when i echo the /costmap/costmap_raw it always displays 0, 0, 0, 0 etc. in data, never reflecting that i have actually updated the costmap. I have tried to enable that with setting always_send_full_costmap to true, but this does not work either.
How can i get the costmap to function properly?
The text was updated successfully, but these errors were encountered: