Skip to content

Commit 755e422

Browse files
authored
Merge pull request #1263 from tier4/chore/gnss_poser/cherry-pick
fix(gnss_poser): cherry pick
2 parents 932579d + 5d38b9a commit 755e422

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

sensing/gnss_poser/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
The `gnss_poser` is a node that subscribes gnss sensing messages and calculates vehicle pose with covariance.
66

7+
This node subscribes to NavSatFix to publish the pose of **base_link**. The data in NavSatFix represents the antenna's position. Therefore, it performs a coordinate transformation using the tf from `base_link` to the antenna's position. The frame_id of the antenna's position refers to NavSatFix's `header.frame_id`.
8+
(**Note that `header.frame_id` in NavSatFix indicates the antenna's frame_id, not the Earth or reference ellipsoid.** [See also NavSatFix definition.](https://docs.ros.org/en/noetic/api/sensor_msgs/html/msg/NavSatFix.html))
9+
10+
If the transformation from `base_link` to the antenna cannot be obtained, it outputs the pose of the antenna position without performing coordinate transformation.
11+
712
## Inner-workings / Algorithms
813

914
## Inputs / Outputs

sensing/gnss_poser/config/gnss_poser.param.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
ros__parameters:
33
base_frame: base_link
44
gnss_base_frame: gnss_base_link
5-
gnss_frame: gnss
65
map_frame: map
76
buff_epoch: 1
87
use_gnss_ins_orientation: true

sensing/gnss_poser/include/gnss_poser/gnss_poser_core.hpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,9 @@ class GNSSPoser : public rclcpp::Node
8989
rclcpp::Publisher<tier4_debug_msgs::msg::BoolStamped>::SharedPtr fixed_pub_;
9090

9191
MapProjectorInfo::Message projector_info_;
92-
std::string base_frame_;
93-
std::string gnss_frame_;
94-
std::string gnss_base_frame_;
95-
std::string map_frame_;
92+
const std::string base_frame_;
93+
const std::string gnss_base_frame_;
94+
const std::string map_frame_;
9695
bool received_map_projector_info_ = false;
9796
bool use_gnss_ins_orientation_;
9897

sensing/gnss_poser/schema/gnss_poser.schema.json

-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111
"default": "base_link",
1212
"description": "frame id for base_frame"
1313
},
14-
"gnss_frame": {
15-
"type": "string",
16-
"default": "gnss",
17-
"description": "frame id for gnss_frame"
18-
},
1914
"gnss_base_frame": {
2015
"type": "string",
2116
"default": "gnss_base_link",

sensing/gnss_poser/src/gnss_poser_core.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ GNSSPoser::GNSSPoser(const rclcpp::NodeOptions & node_options)
3131
tf2_listener_(tf2_buffer_),
3232
tf2_broadcaster_(*this),
3333
base_frame_(declare_parameter<std::string>("base_frame")),
34-
gnss_frame_(declare_parameter<std::string>("gnss_frame")),
3534
gnss_base_frame_(declare_parameter<std::string>("gnss_base_frame")),
3635
map_frame_(declare_parameter<std::string>("map_frame")),
3736
use_gnss_ins_orientation_(declare_parameter<bool>("use_gnss_ins_orientation")),
@@ -142,8 +141,9 @@ void GNSSPoser::callbackNavSatFix(
142141
// get TF from gnss_antenna to base_link
143142
auto tf_gnss_antenna2base_link_msg_ptr = std::make_shared<geometry_msgs::msg::TransformStamped>();
144143

144+
const std::string gnss_frame = nav_sat_fix_msg_ptr->header.frame_id;
145145
getStaticTransform(
146-
base_frame_, gnss_frame_, tf_gnss_antenna2base_link_msg_ptr, nav_sat_fix_msg_ptr->header.stamp);
146+
gnss_frame, base_frame_, tf_gnss_antenna2base_link_msg_ptr, nav_sat_fix_msg_ptr->header.stamp);
147147
tf2::Transform tf_gnss_antenna2base_link{};
148148
tf2::fromMsg(tf_gnss_antenna2base_link_msg_ptr->transform, tf_gnss_antenna2base_link);
149149

0 commit comments

Comments
 (0)