Skip to content

Commit

Permalink
Define _frd frames in odom plugin based on parent/child frame parametrs
Browse files Browse the repository at this point in the history
  • Loading branch information
mzahana committed Oct 11, 2023
1 parent a54cb99 commit 3b3804f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions mavros/src/mavros_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ int main(int argc, char * argv[])
node->declare_parameter("gcs_url", gcs_url);
node->declare_parameter("tgt_system", tgt_system);
node->declare_parameter("tgt_component", tgt_component);
node->declare_parameter("base_link_frame_id", base_link_frame_id);
node->declare_parameter("map_frame_id", map_frame_id);
node->declare_parameter("odom_frame_id", odom_frame_id);
node->declare_parameter("base_link_frame", base_link_frame_id);
node->declare_parameter("map_frame", map_frame_id);
node->declare_parameter("odom_frame", odom_frame_id);

node->get_parameter("fcu_url", fcu_url);
node->get_parameter("gcs_url", gcs_url);
node->get_parameter("tgt_system", tgt_system);
node->get_parameter("tgt_component", tgt_component);
node->get_parameter("base_link_frame_id", base_link_frame_id);
node->get_parameter("map_frame_id", map_frame_id);
node->get_parameter("odom_frame_id", odom_frame_id);
node->get_parameter("base_link_frame", base_link_frame_id);
node->get_parameter("map_frame", map_frame_id);
node->get_parameter("odom_frame", odom_frame_id);

uas_url = mavros::utils::format("/uas%d", tgt_system);

Expand Down
8 changes: 4 additions & 4 deletions mavros_extras/src/plugins/odom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ class OdometryPlugin : public plugin::Plugin
Eigen::Affine3d tf_parent2parent_des;
Eigen::Affine3d tf_child2child_des;

lookup_static_transform(fcu_odom_parent_id_des, "map_ned", tf_parent2parent_des);
lookup_static_transform(fcu_odom_child_id_des, "base_link_frd", tf_child2child_des);
lookup_static_transform(fcu_odom_parent_id_des, fcu_odom_parent_id_des+"_ned", tf_parent2parent_des);
lookup_static_transform(fcu_odom_child_id_des, fcu_odom_child_id_des+"_frd", tf_child2child_des);

//! Build 6x6 pose covariance matrix to be transformed and sent
Matrix6d cov_pose = Matrix6d::Zero();
Expand Down Expand Up @@ -235,8 +235,8 @@ class OdometryPlugin : public plugin::Plugin
Eigen::Affine3d tf_parent2parent_des;
Eigen::Affine3d tf_child2child_des;

lookup_static_transform("odom_ned", odom->header.frame_id, tf_parent2parent_des);
lookup_static_transform("base_link_frd", odom->child_frame_id, tf_child2child_des);
lookup_static_transform(odom->header.frame_id+"_ned", odom->header.frame_id, tf_parent2parent_des);
lookup_static_transform(odom->child_frame_id+"_frd", odom->child_frame_id, tf_child2child_des);

//! Build 6x6 pose covariance matrix to be transformed and sent
ftf::Covariance6d cov_pose = odom->pose.covariance;
Expand Down

0 comments on commit 3b3804f

Please sign in to comment.