-
Notifications
You must be signed in to change notification settings - Fork 2.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
Understanding how to get the cartographer maps #1951
Comments
Still don't know how to do this but I have moved to 3D so I am very desperately needing some help since the code that I found previously likely doesn't work with 3D. I guess my new (ish kind of same thing) question is how I can get all the 3D points positions. I found this cartographer-project/cartographer_ros#1168 issue and one of the people says that you can call PoseGraphInterace::GetTrajectoryNodes() to render the 3d stuff. I'm not sure what this returns. Could someone explain to me, please? |
Hi @lolhol I am trying to get 3d maps as well. I started from #720 ad added a publisher for the 3d map. You can find the code at my fork https://github.com/graiola/cartographer_ros/tree/submap_cloud_query If you set in your .lua |
Ok! This is a very big help! I coded a sample function thing based on your map_builder_bridge code. If it is not hard for you, could you please explain what a HybridGrid is and how it relates to min_probability? Because I am very new to cartographer and I have no clue on how it works. Here is my code for the function. `std::vector<std::vector> CreatePCLPointCloudFromHybridGrid( double resolution = hybrid_grid.resolution(); for (int i = 0; i < hybrid_grid.values_size(); i++) {
} return point_cloud; Also, is there possibly a way to get a specific part of a submap and only like get those points? because I plan to update the map pretty often and I can imagine that it will take significant time to iterate over each point in a map (especially if there is a big map). Is there a way to possibly get the map from the pose update callback you pass into the Trajectory builder? |
Also, I forgot to mention that I am not using ROS. |
Ok @graiola, so the code kinda works. Unfortunately, though it returns values like [-1.14080808E8, 0.0, 3218.45, 6.25] (x, y, z, i). I don't understand how that is possible since the resolution is set to 0.1 (I made it print the resolution and it outputted "resolution: 0.1"), and since I am feeding it data like -4.4900255 0.9554584 0.103424944 152.0 (x, y, z, i). Any idea of what is going on? I don't really understand much here especially when it comes to actually rendering the map. Sorry if this is a stupid question. :/ If you are interested in my code, here is my github link. I will apologize in advance for possibly bad C++ code. I don't usually code in this lang and I still getting to know it. At any rate, the files for 3D stuff are in ./util/util3D |
Still no progress :/ any help? Please...? |
Hi!
Basically I have this port of cartographer and I would like to understand how to get the maps more efficiently and prep them for like pathfinding and other stuff. Right now all I am doing is getting all of the submaps and making one big map. I am assuming that that is VERY inefficient in the way that I am using it right now (requesting it every like 0.5 sec).
My code right now that I run to get the map:
`void CartoModule::paint_map(std::vector *output) {
if (isAdded) {
current_map->to_char_array(output);
return;
}
};`
I noticed that the "LocalSlamResult" has this thing called "const std::unique_ptr insertion_result." I don't quite understand what that is but my hypothesis is that it is like the submap to which change was made. Am I correct? If so, how can I use it to not have to run the whole rendering of the map many times per second and only run it for a specific submap [that was changed].
My goal is to make a robot that auto-pathfinds around the room and stuff. Although I got the cartographer to work, the only way I can get the map is through that massive function that is (I am assuming) very slow and is not how you are supposed to do it. Is there a proper way to get the map in a 1D vector format with the ints (chars/bytes whatever) representing the color / obstructed not obstructed?
The text was updated successfully, but these errors were encountered: