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

Add amcl3 demo #9

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

Add amcl3 demo #9

wants to merge 19 commits into from

Conversation

pvela2017
Copy link

Proposed changes

Added a demo for the AMCL3 algorithm based on the likelihood sensor model 3D (Ekumen-OS/beluga#440)

Type of change

  • 🐛 Bugfix (change which fixes an issue)
  • 🚀 Feature (change which adds functionality)
  • 📚 Documentation (change which fixes or extends documentation)

Checklist

Put an x in the boxes that apply. This is simply a reminder of what we will require before merging your code.

  • Lint and unit tests (if any) pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • All commits have been signed for DCO

Additional comments

Signed-off-by: Pablo Vela <pablovela@naver.com>
Signed-off-by: Pablo Vela <pablovela@naver.com>
Signed-off-by: Pablo Vela <pablovela@naver.com>
Signed-off-by: Pablo Vela <pablovela@naver.com>
Signed-off-by: Pablo Vela <pablovela@naver.com>
Signed-off-by: Pablo Vela <pablovela@naver.com>
@hidmic hidmic self-requested a review November 25, 2024 11:30
Copy link
Collaborator

@hidmic hidmic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First pass

repositories:
beluga:
type: git
url: https://github.com/pvela2017/beluga.git
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pvela2017 this needs to change before merging.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can now point to the main repository.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in 623f842

libopenvdb-dev \
python3-pip \
mc \
ros-jazzy-pcl-ros \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pvela2017 why adding this here instead of in the corresponding package.xml?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in 150be6e

]

return LaunchDescription(nodes)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pvela2017 nit: missing EOF newline, here and elsewhere.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in b15a8cc and 471d716

@@ -0,0 +1,63 @@
#!/usr/bin/env python3

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pvela2017 meta: I wonder if it wouldn't be simpler to modify the dataset (which we have already modified) to include odom to base_link transforms.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we do this or not @pvela2017?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to implement this on an other project. But there when playing the bag there was a warning about the timestamp. I dont know if it is a bug or I did something wrong. I will try again for this project

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its working! How can I send you the new rosbag?
Updated in 5978183


// Initial position
const auto pose = Sophus::SE3d{
Sophus::SO3d{/*kInitialPoseYaw, kInitialPosePitch, kInitialPoseRoll*/},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pvela2017 nit: remove commented out code.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in 64e5615

point_color.b = 1.0;
point_color.a = 1.0;

for (openvdb::FloatGrid::ValueOnCIter iter = grid->cbeginValueOn(); iter; ++iter) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pvela2017 the condition expression is unusual, is there no cendValueOn()?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed in the meeting it is ok.

OpenVDB iterators are not STL-compatible in that one can always request an iterator that points to the beginning of a collection of elements (nodes, voxels, etc.), but one usually cannot request an iterator that points to the end of the collection. (This is because finding the end might require a full tree traversal.)

Reference

visualization_msgs::msg::Marker marker_msg;
std_msgs::msg::ColorRGBA point_color;
openvdb::CoordBBox bbox = grid->evalActiveVoxelBoundingBox();
double min_z, max_z;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pvela2017 nit: better define and assign on the same line, then it can be const

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in 64e5615

marker_msg.colors.push_back(point_color);
}

double size = grid->transform().voxelSize()[0];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pvela2017 nit: can be const

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in 64e5615

"localization/beluga_demo_bearing_localization"
"localization/beluga_demo_fiducial_localization"
"localization/beluga_demo_lidar_localization"
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pvela2017 I'm a bit ambivalent about this, but I can't think of a better solution. CC @glpuga for thoughts.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping @glpuga

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like it. I'm assuming these don't build or have missing dependencies in Jazzy.

Why supporting anything other than Humble, if this is a demos repository and we provide a docker to run it?

Copy link
Collaborator

@hidmic hidmic Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why supporting anything other than Humble, if this is a demos repository and we provide a docker to run it?

Because OpenVDB packaging is broken in Ubuntu 22.04, see https://bugs.launchpad.net/ubuntu/+source/openvdb/+bug/1970108.

Nav2 folks realized about this and vendored it (see openvdb_vendor) but depending on their vendored version means we are (again) subject to their own release timeline to release ourselves. There is no good solution.

I'm assuming these don't build or have missing dependencies in Jazzy.

Thinking out loud, and this is out of scope for this PR but, Humble is the old LTS distro. Jazzy is new LTS distro. Having some our demos be incompatible with the latest LTS distro of ROS 2 is not good.

Copy link
Collaborator

@glpuga glpuga Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I remember now.

Jazzy is new LTS distro. Having some our demos be incompatible with the latest LTS distro of ROS 2 is not good.

I'm not so absolute. People are still by far mostly using Humble, while Jazzy is at best "up-and-coming" right now. Core stuff should support both already, but leaf-stuff -like this self-contained demos repo- does not need to.

In any case, there's no reason I can think off the top of my head why these would not build in Jazzy. Is there any external dependency not available?

Looking at the package.xml files, everything seems either standard packages or packages with code we wrote ourselves. Indirect dependencies might be gazebo (classic?) and apriltag_ros which we use the "foxy-devel" branch (because there's no other).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, https://github.com/ROBOTIS-GIT/turtlebot3_simulations has not seen a release since Humble and it doesn't look like it will ever do. Nav2 folks spinned up https://github.com/ros-navigation/nav2_minimal_turtlebot_simulation in place for it. Some of our demos already depend on Nav2 code, so I'll go ahead and use this for both Humble and Jazzy. It's source distributed anyways.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In any case, there's no reason I can think off the top of my head why these would not build in Jazzy. Is there any external dependency not available?

@pvela2017 ? I think it was Gazebo related, though my memory might be failing me. Isn't Gazebo Classic gone?

Edit: https://discourse.ros.org/t/gazebo-classic-end-of-life-ros-2-jazzy/36239 indeed.

I dont remember if I reached that step were Gazebo was an issue.

So, https://github.com/ROBOTIS-GIT/turtlebot3_simulations has not seen a release since Humble and it doesn't look like it will ever do. Nav2 folks spinned up https://github.com/ros-navigation/nav2_minimal_turtlebot_simulation in place for it. Some of our demos already depend on Nav2 code, so I'll go ahead and use this for both Humble and Jazzy. It's source distributed anyways.

I remember this was one of the issues. Also, I removed a lot of dependencies so the rosdep wouldn't pop errors.

So, Should we update everything to Gazebo ignition?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we update everything to Gazebo ignition?

@pvela2017 indeed. I'm on it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we update everything to Gazebo ignition?

@pvela2017 indeed. I'm on it.

Can I help?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! I'll tag you on the PR as soon as it is up for review. If you can then adjust this PR for it, that'd be amazing.

Signed-off-by: Pablo Vela <pablovela@naver.com>
Signed-off-by: Pablo Vela <pablovela@naver.com>
Signed-off-by: Pablo Vela <pablovela@naver.com>
Signed-off-by: Pablo Vela <pablovela@naver.com>
Signed-off-by: Pablo Vela <pablovela@naver.com>
Signed-off-by: Pablo Vela <pablovela@naver.com>
Signed-off-by: Pablo Vela <pablovela@naver.com>
@hidmic
Copy link
Collaborator

hidmic commented Jan 28, 2025

@pvela2017 Ekumen-OS/beluga#440 got merged. Are you still up for wrapping this up?

@pvela2017
Copy link
Author

@pvela2017 Ekumen-OS/beluga#440 got merged. Are you still up for wrapping this up?

Yep! I'm here

Copy link
Collaborator

@hidmic hidmic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job. Left a couple final comments but I'm overall satisfied with this PR.

@@ -0,0 +1,63 @@
#!/usr/bin/env python3

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we do this or not @pvela2017?

Comment on lines 475 to 477
const std::string kMapFile =
"/home/developer/ws/src/beluga_demo/localization/"
"beluga_demo_amcl3_localization/maps/map.vdb";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pvela2017 consider installing map.vdb under share. Then you can use ament_index_cpp::get_package_share_directory to find it instead of hard-coding the path.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in 8d7f101

Signed-off-by: Pablo Vela <pablovela@naver.com>
Signed-off-by: Pablo Vela <pablovela@naver.com>
Signed-off-by: Pablo Vela <pablovela@naver.com>
Signed-off-by: Pablo Vela <pablovela@naver.com>
Signed-off-by: Pablo Vela <pablovela@naver.com>
Signed-off-by: Pablo Vela <pablovela@naver.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants