facontidavide / Bonxai

Fast, hierarchical, sparse Voxel Grid
Mozilla Public License 2.0
643 stars 53 forks source link

Bonxai Msgs and Rviz plugins (Plus a bit of reorganization) #23

Closed jjd9 closed 9 months ago

jjd9 commented 9 months ago

Hello,

I hope I do not come off the wrong way submitting such a large PR to your repo :sweat_smile: I saw that you had "Rviz integration" as a TODO, and I thought that would be a lot of fun to do. :smiley: If this is too much to review as one PR though, or you think some of the organizational changes are not needed, please lmk and I can break it up and revert things where necessary.

This PR:

  1. **Massages the directory structure so that the core algorithms are in Bonxai/Bonxai and can be built without any ros2 machinery, and the ros-y-ness is in Bonxai/Bonxai_ros. And Bonxai_ros is comprised of a few distinct ros packages.
    ├── 3rdparty
    ├── Bonxai
    │   ├── bonxai_core
    │   ├── bonxai_map
    │   ├── cmake
    │   ├── CMakeLists.txt
    │   ├── examples
    │   └── package.xml
    ├── Bonxai_ros
    │   ├── bonxai_msgs
    │   ├── bonxai_pub
    │   ├── bonxai_ros
    │   ├── bonxai_rviz_plugins
    │   ├── bonxai_server
    │   ├── doc
    │   └── README.md
    ├── data
    ├── doc
    ├── LICENSE
    └── README.md
  2. Renames bonxai_ros to bonxai_server.
  3. Creates a bonxai_msgs package so bonxai's can be published/subscribed to over the ros2 network.
  4. Creates an rviz plugin that allows you to visualize three common Bonxai instances: ProbabilisticMap (the one used in bonxai_server), Scalar (implemented as Bonxai::VoxelGrid), and Colored (implemented as std_msgs::msg::ColorRGBA. pcl::RGB if ColorRGB isnt popular).
    • The plugin provides the ability to modify the opacity and style (correctly-sized cube, point, square, etc...) of the bonxai visualization, and also to filter out points by a scalar threshold (E.g. min probability).
    • The plugin also implements a very simple voxel occlusion culling method.

** This change regrettably makes the PR more challenging to review, but I did not feel good about simply inserting the msg definitions and rviz_plugin into the existing bonxai_ros package (as that has burned me in the past). However, if you would prefer that approach or have other ideas about how we could reorganize the ros aspects of the repo, please let me know and I would be happy to make those changes.

facontidavide commented 9 months ago

this is great, but please, split this in two, as you suggested. Let's postpone the bonxai_rviz_plugins to a subsequent PR

jjd9 commented 9 months ago

Ok, I split the PR into 3 (they are all here if you are interested: https://github.com/jjd9/Bonxai/pulls). I will close this PR and submit these one at a time (since they depend on each other).