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

pose_cov_msg.pose.covariance calculated value #32

Open
szepilot opened this issue Sep 16, 2023 · 0 comments
Open

pose_cov_msg.pose.covariance calculated value #32

szepilot opened this issue Sep 16, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request ROS2 ROS2 related issues

Comments

@szepilot
Copy link
Member

pose_cov_msg.pose.pose = pose_msg.pose;
pose_cov_msg.header = pose_msg.header;
pose_cov_msg.pose.covariance[0] = 0.01;
pose_cov_msg.pose.covariance[7] = 0.01;
pose_cov_msg.pose.covariance[14] = 0.01;
pose_cov_msg.pose.covariance[21] = 0.01;
pose_cov_msg.pose.covariance[28] = 0.01;
pose_cov_msg.pose.covariance[35] = 0.01;

// covariance matrix
double h_covariance = pow(latlonmsg->h_accuracy * 1e-3, 2); // Convert mm to m and take the ^2 for going from std to cov
double v_covariance = pow(latlonmsg->v_accuracy * 1e-3, 2); // Convert mm to m and take the ^2 for going from std to cov
navsatfix_msg.position_covariance[0] = h_covariance; // x = 0, 0
navsatfix_msg.position_covariance[4] = h_covariance; // y = 1, 1
navsatfix_msg.position_covariance[8] = v_covariance; // z = 2, 2
navsatfix_msg.position_covariance_type = sensor_msgs::msg::NavSatFix::COVARIANCE_TYPE_DIAGONAL_KNOWN;

@szepilot szepilot added enhancement New feature or request ROS2 ROS2 related issues labels Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ROS2 ROS2 related issues
Projects
None yet
Development

No branches or pull requests

3 participants