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

base PCD map location? #70

Open
lonlonago opened this issue Sep 6, 2024 · 2 comments
Open

base PCD map location? #70

lonlonago opened this issue Sep 6, 2024 · 2 comments

Comments

@lonlonago
Copy link

If we have a PCD map, can we use this code to make a location based on the PCD map?

If possible, how do we need to modify this code

@kennyjchen
Copy link
Contributor

You can essentially edit the code so that it loads in a PCD, sets it as the first (and only) keyframe, and disables tracking of subsequent keyframes.

@lonlonago
Copy link
Author

lonlonago commented Sep 12, 2024

Thank you very much for your reply!
Yes, I did, but the odometer kept jumping and reported an error after running for a short period of time. The error message:

Terminate called after throwing an instance of 'ros::serialization::StreamOverrunException'

here is my code change:

`

void dlio::OdomNode::buildSubmap(State vehicle_state) {
// submap to whole map test
pcl::PointCloud::Ptr tmp_map_cloud (boost::make_shared<pcl::PointCloud>());

pcl::io::loadPCDFile("/home/lan/ouster_zijin.pcd", *tmp_map_cloud);
this->gicp_temp.setInputTarget(tmp_map_cloud);

this->submap_kdtree = this->gicp_temp.target_kdtree_;
this->submap_cloud = tmp_map_cloud;
this->submap_normals = this->gicp_temp.getTargetCovariances(); // getTargetCovariances
this->submap_kf_idx_prev = this->submap_kf_idx_curr;
}

`

only build submap use once here

`

// Set initial frame as first keyframe
if (this->keyframes.size() == 0) {
this->initializeInputTarget();
this->main_loop_running = false;
this->submap_future =
std::async( std::launch::async, &dlio::OdomNode::buildKeyframesAndSubmap, this, this->state );
this->buildSubmap(this->state); // only build submap use once here

this->submap_future.wait(); // wait until completion
return;

}
`

Thank you very much for taking the time to review this code and problem

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

No branches or pull requests

2 participants