navigation2 icon indicating copy to clipboard operation
navigation2 copied to clipboard

Simple Commander Costmap API

Open SteveMacenski opened this issue 3 years ago • 42 comments

Add a costmap API for OccupancyGrid messages coming into the Simple Commander API

Basically have the basic API from https://github.com/ros-planning/navigation2/blob/main/nav2_costmap_2d/include/nav2_costmap_2d/costmap_2d.hpp + adding global frame ID and timestamp with a constructor that takes in the OccupancyGrid.

Potentially even a python collision checker too when given a footprint from the footprint topic + this new CostmapPy class

SteveMacenski avatar Aug 26 '22 02:08 SteveMacenski

For someone who is going to implement it, we have something something similar, which can be found under https://github.com/neobotix/neo_nav2_py_costmap2D ! But it would be actually nice to have it as part of the nav2 ecosystem.

(wish it was me, but unfortunately I don't have time until october to get into this)

padhupradheep avatar Aug 26 '22 05:08 padhupradheep

I would love to try it, is t possible?

stevedanomodolor avatar Aug 26 '22 19:08 stevedanomodolor

Absolutely!

SteveMacenski avatar Aug 26 '22 20:08 SteveMacenski

I would like to contribute as well, let me know what I can do!

afifswaidan avatar Aug 27 '22 07:08 afifswaidan

Same here, let me know if you need some help with it :)

igrak34 avatar Aug 27 '22 11:08 igrak34

I would love to contribute. Let me know if we can do it as a team. @SteveMacenski @afifswaidan @igrak34 @stevedanomodolor

manishsaini0901 avatar Aug 28 '22 20:08 manishsaini0901

I would love to contribute. Let me know if we can do it as a team. @SteveMacenski @afifswaidan @igrak34 @stevedanomodolor

I have no problem from my side, count me in.

afifswaidan avatar Aug 28 '22 21:08 afifswaidan

I would love to contribute. Let me know if we can do it as a team. @SteveMacenski @afifswaidan @igrak34 @stevedanomodolor

Sure me too, I don't mind

stevedanomodolor avatar Aug 29 '22 03:08 stevedanomodolor

I would like to contribute. But, I am not so familiar with ROS2, but familiar with ROS1. Can I try to contribute with as a team? @SteveMacenski @afifswaidan @igrak34 @stevedanomodolor

JacksonK9 avatar Aug 29 '22 10:08 JacksonK9

Awesome!

So the general things that need to be implemented are those in the files I linked to above, namely a class PyCostmap2D

  • A: Constructor for OccupancyGrid which stores the relevant information
  • A: getSizeInCellsX / getSizeInCellsY
  • A: getSizeInMetersX / getSizeInMetersY
  • A: getOriginX / getOriginY
  • A: getResolution
  • A: getGlobalFrameID
  • A: getCostmapTimestamp
  • B: getCost at map pixels and index
  • B: setCost at map pixels
  • B: mapToWorld
  • B: worldToMap
  • B: getIndex

That's 1 item and once that's done another person could contribute a costmap collision checker, where the object should take in this costmap object + a footprint to perform collision checking, perhaps using @padhupradheep 's line iterator: https://github.com/neobotix/neo_nav2_py_costmap2D/blob/main/neo_nav2_py_costmap2D/line_iterator.py analogous to https://github.com/ros-planning/navigation2/blob/main/nav2_costmap_2d/include/nav2_costmap_2d/footprint_collision_checker.hpp

I think there are a couple of natural roles here to help!

  • Person A: Implement the PyCostmap2D class's first few functions marked in "A"
  • Person B: Implement the methods for converting / getting information from the occupancy grid after the core API is done
  • Person C: Implement and test a line iterator to march through the costmap given 2 points and check for collision
  • Person D: Use that line iterator + costmap object + footprint input to check for collisions!

Who wants to get started with A and C? I think those can both be worked on in parallel

SteveMacenski avatar Aug 29 '22 17:08 SteveMacenski

@SteveMacenski I can get started with A

stevedanomodolor avatar Aug 29 '22 18:08 stevedanomodolor

@SteveMacenski If I can do, I want to do the role of B.

JacksonK9 avatar Aug 30 '22 00:08 JacksonK9

I just created a draft pull request https://github.com/ros-planning/navigation2/pull/3159. I should have this done by the end of tomorrow.

stevedanomodolor avatar Aug 30 '22 04:08 stevedanomodolor

Awesome!

So the general things that need to be implemented are those in the files I linked to above, namely a class PyCostmap2D

  • A: Constructor for OccupancyGrid which stores the relevant information
  • A: getSizeInCellsX / getSizeInCellsY
  • A: getSizeInMetersX / getSizeInMetersY
  • A: getOriginX / getOriginY
  • A: getResolution
  • A: getGlobalFrameID
  • A: getCostmapTimestamp
  • B: getCost at map pixels and index
  • B: setCost at map pixels
  • B: mapToWorld
  • B: worldToMap
  • B: getIndex

That's 1 item and once that's done another person could contribute a costmap collision checker, where the object should take in this costmap object + a footprint to perform collision checking, perhaps using @padhupradheep 's line iterator: https://github.com/neobotix/neo_nav2_py_costmap2D/blob/main/neo_nav2_py_costmap2D/line_iterator.py analogous to https://github.com/ros-planning/navigation2/blob/main/nav2_costmap_2d/include/nav2_costmap_2d/footprint_collision_checker.hpp

I think there are a couple of natural roles here to help!

  • Person A: Implement the PyCostmap2D class's first few functions marked in "A"
  • Person B: Implement the methods for converting / getting information from the occupancy grid after the core API is done
  • Person C: Implement and test a line iterator to march through the costmap given 2 points and check for collision
  • Person D: Use that line iterator + costmap object + footprint input to check for collisions!

Who wants to get started with A and C? I think those can both be worked on in parallel

Hello,

So I guess A is taken, you need now someone for C. I can handle C if you want.

afifswaidan avatar Aug 30 '22 05:08 afifswaidan

@SteveMacenski how do you think it's best to organize and kickoff the group work and track the progress?

afifswaidan avatar Aug 30 '22 05:08 afifswaidan

We can use something like this, @SteveMacenski @afifswaidan

Task tracking

Author Task assigned Task Completed Pull request Accepted Task Dependency
@stevedanomodolor A -
@JacksonK9 B A
@afifswaidan C -
--- D A B C

stevedanomodolor avatar Aug 30 '22 05:08 stevedanomodolor

So, A, B, and C are taken?

manishsaini0901 avatar Aug 30 '22 08:08 manishsaini0901

For D I think we have to collaborate somehow as it depends upon A,B and C.

manishsaini0901 avatar Aug 30 '22 08:08 manishsaini0901

We can use something like this, @SteveMacenski @afifswaidan

Task tracking

Author Task assigned Task Completed Pull request Accepted Task Dependency
@stevedanomodolor A -
--- B A
--- C -
--- D A B C

Sounds good, I'll take C then, please add me to the table :)

afifswaidan avatar Aug 30 '22 08:08 afifswaidan

@manishsaini0901 do you want take over the task?, Someone has to make the changes even though you might require inputs from authors of the other tasks

stevedanomodolor avatar Aug 30 '22 11:08 stevedanomodolor

Updated on task: @JacksonK9 @afifswaidan @SteveMacenski

Task tracking

Author Task assigned Task Completed Pull request Accepted Task Dependency
@stevedanomodolor A -
@JacksonK9 B A
@afifswaidan C -
--- D A B C

stevedanomodolor avatar Aug 30 '22 19:08 stevedanomodolor

@stevedanomodolor Can I start with your github repository? or Do I have to wait for the acception of Pull Request?

JacksonK9 avatar Aug 31 '22 00:08 JacksonK9

@JacksonK9 I think I would wait when my pull request is accepted. You can fork directly from navigation2 if my pull request is merged to have the current main. If we do the pull in the end of finishing the whole task, you might have to use my own fork

stevedanomodolor avatar Aug 31 '22 07:08 stevedanomodolor

@stevedanomodolor Okay, I understand.

@SteveMacenski Which is better? Can I start with official nav2 repository after the acception of Pull Request? or Just start with stevedanomodolor's nav2 repository?

JacksonK9 avatar Aug 31 '22 07:08 JacksonK9

@JacksonK9 if my pull is accepted you can use the official directly

stevedanomodolor avatar Aug 31 '22 07:08 stevedanomodolor

Task A done and merged!

SteveMacenski avatar Aug 31 '22 21:08 SteveMacenski

@SteveMacenski Thank you maybe, I can finish the task B until the end of this week.

JacksonK9 avatar Sep 01 '22 00:09 JacksonK9

https://github.com/ros-planning/navigation2/issues/3149 This is another good Python3 project if folks were interested!

SteveMacenski avatar Sep 02 '22 01:09 SteveMacenski

@SteveMacenski I can try it this weekend,

stevedanomodolor avatar Sep 02 '22 04:09 stevedanomodolor

@SteveMacenski for task C I already started implementing, but I need some more functions in the costmap_2d class(i.e MapToWorld, etc...) Should I add these as well to the costmap_2d.py file that was committed 3 days ago or @stevedanomodolor is already working/committing them? Just to know if I should wait or go ahead and implement them to continue working on Task C.

afifswaidan avatar Sep 03 '22 11:09 afifswaidan