diff --git a/sensing/autoware_gnss_poser/README.md b/sensing/autoware_gnss_poser/README.md
index 78d4a552aa..1e5c85bae3 100644
--- a/sensing/autoware_gnss_poser/README.md
+++ b/sensing/autoware_gnss_poser/README.md
@@ -13,6 +13,20 @@ The antenna is rigidly mounted on the vehicle, so this transformation is expecte
If the transformation from `base_link` to the antenna cannot be obtained, the fix is skipped: `gnss_fixed` still reports the receiver's status, but no pose is published. Depending on the startup order, the transformation may arrive after the first fixes, so the fixes are skipped silently for the first 5 seconds, counted by the `header.stamp` of the fixes from the first fix (whatever its status). After that, a fix that cannot get the transformation makes the node log an error once, naming both frames, so that a `header.frame_id` that never gets a transformation is visible instead of silently yielding no pose. When TF has the transformations but the lookup still fails, for example because `header.frame_id` is not a frame name TF accepts (empty, or starting with `/`), waiting does not help, so it is logged as an error at once. Each of the two problems is logged once, and again only after the transformation has been obtained in between. A rosbag replayed in a loop gets the 5 seconds only on its first pass.
+### Orientation
+
+NavSatFix carries no orientation. `orientation_source` selects where the orientation of the pose comes from:
+
+| Value | Orientation | Rotation covariance (roll, pitch, yaw) |
+| -------- | ------------------------------------------------------------------------------------------------ | -------------------------------------- |
+| `ins` | the latest `autoware_orientation`. No pose is published until the first one has arrived. | its `rmse_rotation_*` squared |
+| `motion` | the heading of the displacement from the previous position to the current one (roll = pitch = 0) | 0.1, 0.1, 1.0 [rad^2] |
+| `none` | unknown: the identity, that is heading east in the map frame | 1.0, 1.0, 1.0 [rad^2] |
+
+`orientation_source` replaces `use_gnss_ins_orientation`, which is deprecated. A configuration that sets only `use_gnss_ins_orientation` still works and gets a warning at startup. `false` is read as `motion`. `true` keeps what it did: as `ins` once `autoware_orientation` has arrived, as `none` until then. No value of `orientation_source` selects that, because a pose with the stand-in orientation cannot be told apart from one with a measured orientation: use `ins` when `autoware_orientation` is published and `none` otherwise. When both are set, `use_gnss_ins_orientation` is ignored.
+
+The node logs the source in use at startup, and warns once when `autoware_orientation` arrives while the source is `none`, since it is then ignored.
+
## Inputs / Outputs
### Input
@@ -35,13 +49,14 @@ If the transformation from `base_link` to the antenna cannot be obtained, the fi
Parameters in below table
-| Name | Type | Default | Description |
-| -------------------------- | --------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
-| `base_frame` | `string` | `base_link` | frame id for base_frame |
-| `gnss_base_frame` | `string` | `gnss_base_link` | frame id for gnss_base_frame |
-| `map_frame` | `string` | `map` | frame id for map_frame |
-| `use_gnss_ins_orientation` | `boolean` | `true` | use Gnss-Ins orientation |
-| `gnss_pose_pub_method` | `integer` | `0` | 0: Instant Value 1: Average Value 2: Median Value. Any other value is rejected at startup. |
-| `buff_epoch` | `integer` | `1` | Number of positions the average / median is taken over (ignored for method 0). Range: 1~inf; smaller values are rejected at startup. |
+| Name | Type | Default | Description |
+| -------------------------- | --------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `base_frame` | `string` | `base_link` | frame id for base_frame |
+| `gnss_base_frame` | `string` | `gnss_base_link` | frame id for gnss_base_frame |
+| `map_frame` | `string` | `map` | frame id for map_frame |
+| `orientation_source` | `string` | `none` | `ins`, `motion` or `none`; see [Orientation](#orientation). Any other value is rejected at startup. |
+| `use_gnss_ins_orientation` | `boolean` | not set | Deprecated: set `orientation_source` instead. Read only when `orientation_source` is not set: `false` as `motion`; `true` as before, see [Orientation](#orientation). |
+| `gnss_pose_pub_method` | `integer` | `0` | 0: Instant Value 1: Average Value 2: Median Value. Any other value is rejected at startup. |
+| `buff_epoch` | `integer` | `1` | Number of positions the average / median is taken over (ignored for method 0). Range: 1~inf; smaller values are rejected at startup. |
All above parameters can be changed in config file [gnss_poser.param.yaml](./config/gnss_poser.param.yaml "Click here to open config file") .
diff --git a/sensing/autoware_gnss_poser/config/gnss_poser.param.yaml b/sensing/autoware_gnss_poser/config/gnss_poser.param.yaml
index 1c00b43c20..52371514c5 100644
--- a/sensing/autoware_gnss_poser/config/gnss_poser.param.yaml
+++ b/sensing/autoware_gnss_poser/config/gnss_poser.param.yaml
@@ -4,5 +4,5 @@
gnss_base_frame: gnss_base_link
map_frame: map
buff_epoch: 1
- use_gnss_ins_orientation: true
+ orientation_source: none
gnss_pose_pub_method: 0
diff --git a/sensing/autoware_gnss_poser/design/GnssPoser.node.yaml b/sensing/autoware_gnss_poser/design/GnssPoser.node.yaml
index ed9ca8c4d9..aefa8997f5 100644
--- a/sensing/autoware_gnss_poser/design/GnssPoser.node.yaml
+++ b/sensing/autoware_gnss_poser/design/GnssPoser.node.yaml
@@ -53,9 +53,9 @@ param_files:
default: config/gnss_poser.param.yaml
param_values:
- - name: use_gnss_ins_orientation
- type: bool
- default: true
+ - name: orientation_source
+ type: string
+ default: none
# processes
processes:
diff --git a/sensing/autoware_gnss_poser/package.xml b/sensing/autoware_gnss_poser/package.xml
index 8dfda8b83f..757fd44fe0 100644
--- a/sensing/autoware_gnss_poser/package.xml
+++ b/sensing/autoware_gnss_poser/package.xml
@@ -27,6 +27,7 @@
geographiclib
geometry_msgs
libexpected-dev
+ rcl_interfaces
rclcpp
rclcpp_components
sensor_msgs
diff --git a/sensing/autoware_gnss_poser/schema/gnss_poser.schema.json b/sensing/autoware_gnss_poser/schema/gnss_poser.schema.json
index 72e640df47..c960339d8b 100644
--- a/sensing/autoware_gnss_poser/schema/gnss_poser.schema.json
+++ b/sensing/autoware_gnss_poser/schema/gnss_poser.schema.json
@@ -21,10 +21,15 @@
"default": "map",
"description": "frame id for map_frame"
},
+ "orientation_source": {
+ "type": "string",
+ "enum": ["ins", "motion", "none"],
+ "default": "none",
+ "description": "Where the orientation of the pose comes from. ins: the latest autoware_orientation; no pose until the first one arrives. motion: the heading of the displacement between consecutive positions. none: unknown, the identity (heading east) with an rmse of 1.0 rad."
+ },
"use_gnss_ins_orientation": {
"type": "boolean",
- "default": "true",
- "description": "use Gnss-Ins orientation"
+ "description": "Deprecated: set orientation_source instead. Read only when orientation_source is not set: false is read as motion; true keeps what it did, which no orientation_source selects: ins once autoware_orientation has arrived, none until then."
},
"gnss_pose_pub_method": {
"type": "integer",
@@ -44,9 +49,12 @@
"base_frame",
"gnss_base_frame",
"map_frame",
- "use_gnss_ins_orientation",
"gnss_pose_pub_method",
"buff_epoch"
+ ],
+ "anyOf": [
+ { "required": ["orientation_source"] },
+ { "required": ["use_gnss_ins_orientation"] }
]
}
},
diff --git a/sensing/autoware_gnss_poser/src/gnss_poser.cpp b/sensing/autoware_gnss_poser/src/gnss_poser.cpp
index 51bc870660..9c920b2764 100644
--- a/sensing/autoware_gnss_poser/src/gnss_poser.cpp
+++ b/sensing/autoware_gnss_poser/src/gnss_poser.cpp
@@ -29,6 +29,7 @@
#include
#include
+#include
#include
#include
#include
@@ -190,6 +191,14 @@ geometry_msgs::msg::Point get_average_position(
return average_point;
}
+std::array squared_rmse(
+ const autoware_sensing_msgs::msg::GnssInsOrientation & orientation)
+{
+ return {
+ std::pow(orientation.rmse_rotation_x, 2), std::pow(orientation.rmse_rotation_y, 2),
+ std::pow(orientation.rmse_rotation_z, 2)};
+}
+
geometry_msgs::msg::Quaternion get_quaternion_by_position_difference(
const geometry_msgs::msg::Point & point, const geometry_msgs::msg::Point & prev_point)
{
@@ -212,12 +221,6 @@ GnssPoser::GnssPoser(
"buff_epoch must be at least 1, got " + std::to_string(params.buff_epoch));
}
position_buffer_.set_capacity(params.buff_epoch);
-
- // Stand-in until the first INS message arrives (not to publish zero value covariances).
- const auto placeholder_rmse = static_cast(covariance_defaults_.ins_placeholder_rmse);
- ins_orientation_.rmse_rotation_x = placeholder_rmse;
- ins_orientation_.rmse_rotation_y = placeholder_rmse;
- ins_orientation_.rmse_rotation_z = placeholder_rmse;
}
void GnssPoser::set_projector_info(const autoware_map_msgs::msg::MapProjectorInfo & projector_info)
@@ -230,6 +233,7 @@ void GnssPoser::set_ins_orientation(
const autoware_sensing_msgs::msg::GnssInsOrientation & orientation)
{
ins_orientation_ = orientation;
+ received_ins_orientation_ = true;
}
GnssPoser::Result GnssPoser::input_fix(const sensor_msgs::msg::NavSatFix & fix)
@@ -272,21 +276,46 @@ GnssPoser::Result GnssPoser::input_fix(const sensor_msgs::msg::NavSatFix & fix)
: get_median_position(position_buffer_);
}
- // calc gnss antenna orientation
- geometry_msgs::msg::Quaternion orientation;
- if (params_.use_gnss_ins_orientation) {
- orientation = ins_orientation_.orientation;
- } else {
- if (!has_prev_position_) {
+ // calc gnss antenna orientation and its roll, pitch and yaw variances. An unknown orientation is
+ // the identity (heading east) with the placeholder rmse, so that its variances are not zero.
+ geometry_msgs::msg::Quaternion & orientation = gnss_antenna_pose.orientation;
+ const double placeholder_variance = std::pow(covariance_defaults_.ins_placeholder_rmse, 2);
+ std::array rotation_variances = {
+ placeholder_variance, placeholder_variance, placeholder_variance};
+ switch (params_.orientation_source) {
+ case OrientationSource::Ins:
+ if (!received_ins_orientation_) {
+ return {Outcome::NoOrientation, make_gnss_fixed(fix.header.stamp, true)};
+ }
+ orientation = ins_orientation_.orientation;
+ rotation_variances = squared_rmse(ins_orientation_);
+ break;
+
+ case OrientationSource::InsOrNone:
+ if (received_ins_orientation_) {
+ orientation = ins_orientation_.orientation;
+ rotation_variances = squared_rmse(ins_orientation_);
+ } else {
+ orientation = tf2::toMsg(tf2::Quaternion::getIdentity());
+ }
+ break;
+
+ case OrientationSource::None:
+ orientation = tf2::toMsg(tf2::Quaternion::getIdentity());
+ break;
+
+ case OrientationSource::Motion:
+ if (!has_prev_position_) {
+ prev_position_ = gnss_antenna_pose.position;
+ has_prev_position_ = true;
+ }
+ orientation =
+ get_quaternion_by_position_difference(gnss_antenna_pose.position, prev_position_);
prev_position_ = gnss_antenna_pose.position;
- has_prev_position_ = true;
- }
- orientation = get_quaternion_by_position_difference(gnss_antenna_pose.position, prev_position_);
- prev_position_ = gnss_antenna_pose.position;
+ rotation_variances = covariance_defaults_.motion_rotation_variances;
+ break;
}
- gnss_antenna_pose.orientation = orientation;
-
// get TF from gnss_antenna to base_link.
const auto transform = lookup_antenna_to_base_link_(fix.header.frame_id);
// Drop this fix if its antenna transform is not available: the fix cannot be expressed as a
@@ -305,15 +334,6 @@ GnssPoser::Result GnssPoser::input_fix(const sensor_msgs::msg::NavSatFix & fix)
transform_lookup_failed_reported_ = false;
const geometry_msgs::msg::Transform antenna_to_base_link = transform.value();
- std::array rotation_variances{};
- if (params_.use_gnss_ins_orientation) {
- rotation_variances[0] = std::pow(ins_orientation_.rmse_rotation_x, 2);
- rotation_variances[1] = std::pow(ins_orientation_.rmse_rotation_y, 2);
- rotation_variances[2] = std::pow(ins_orientation_.rmse_rotation_z, 2);
- } else {
- rotation_variances = covariance_defaults_.motion_rotation_variances;
- }
-
geometry_msgs::msg::PoseWithCovariance gnss_base_pose_with_covariance;
gnss_base_pose_with_covariance.pose =
compose_base_link_pose(gnss_antenna_pose, antenna_to_base_link);
diff --git a/sensing/autoware_gnss_poser/src/gnss_poser.hpp b/sensing/autoware_gnss_poser/src/gnss_poser.hpp
index d467089fd4..d63a07dc5a 100644
--- a/sensing/autoware_gnss_poser/src/gnss_poser.hpp
+++ b/sensing/autoware_gnss_poser/src/gnss_poser.hpp
@@ -44,12 +44,22 @@ namespace autoware::gnss_poser
// average / component-wise median of the last `buff_epoch` ones.
enum class GnssPosePubMethod { Instant = 0, Average = 1, Median = 2 };
+/// \brief Where the orientation of the published pose comes from.
+enum class OrientationSource {
+ Ins, ///< the latest INS orientation
+ Motion, ///< the heading of the displacement between consecutive positions
+ None, ///< unknown: the identity (heading east) with the placeholder rmse
+ /// The INS orientation once one has arrived, the identity with the placeholder rmse until then.
+ /// Selected only by the deprecated use_gnss_ins_orientation = true, and goes away with it.
+ InsOrNone,
+};
+
/// \brief Configuration of GnssPoser, taken from the node parameters of the same names.
struct GnssPoserParams
{
GnssPosePubMethod gnss_pose_pub_method = GnssPosePubMethod::Instant;
int buff_epoch = 1;
- bool use_gnss_ins_orientation = true;
+ OrientationSource orientation_source = OrientationSource::None;
/// frame_id of the published pose and of the transform to broadcast.
std::string map_frame = "map";
/// child_frame_id of the transform to broadcast.
@@ -81,8 +91,9 @@ struct GnssPoserCovarianceDefaults
std::array unknown_position_variances = default_unknown_position_variances;
/// Roll, pitch and yaw variances used while the orientation is derived from motion. [rad^2]
std::array motion_rotation_variances = default_motion_rotation_variances;
- /// Stand-in rmse per axis until the first INS orientation arrives. It is squared into the
- /// rotation variances like a real one, so 1.0 rad becomes 1.0 rad^2. [rad]
+ /// Rmse per axis claimed for the identity orientation that stands for an unknown one
+ /// (OrientationSource::None, and InsOrNone before the first INS orientation). It is squared into
+ /// the rotation variances like a real one, so 1.0 rad becomes 1.0 rad^2. [rad]
double ins_placeholder_rmse = default_ins_placeholder_rmse;
};
@@ -129,6 +140,7 @@ class GnssPoser
LocalProjector, ///< the map uses a local projector, so a GNSS fix cannot be converted
NotFixed, ///< the receiver reports no fix; its status is known but no pose is computed
Buffering, ///< the position buffer is not full yet (average and median methods)
+ NoOrientation, ///< orientation_source is ins and no INS orientation has arrived yet
/// TransformLookup gave a TransformLookupError, of either kind.
TransformLookupFailed,
Published, ///< a pose was computed, see Result::gnss_pose
@@ -160,8 +172,7 @@ class GnssPoser
void set_projector_info(const autoware_map_msgs::msg::MapProjectorInfo & projector_info);
- /// \brief Latch the INS orientation used while use_gnss_ins_orientation is true. Until the first
- /// call, an identity orientation with an rmse of 1.0 rad per axis stands in for it.
+ /// \brief Latch the INS orientation, used with OrientationSource::Ins and InsOrNone.
void set_ins_orientation(const autoware_sensing_msgs::msg::GnssInsOrientation & orientation);
/// \brief Process one fix: gate, project, buffer, orient, compose with the antenna transform and
@@ -189,6 +200,7 @@ class GnssPoser
geometry_msgs::msg::Point prev_position_;
bool has_prev_position_ = false;
autoware_sensing_msgs::msg::GnssInsOrientation ins_orientation_;
+ bool received_ins_orientation_ = false;
// The header stamp of the first fix, whatever its status, from which the grace period runs. Set
// once, so a rosbag replayed in a loop gets the grace period only on its first pass.
std::optional first_fix_stamp_;
diff --git a/sensing/autoware_gnss_poser/src/gnss_poser_node.cpp b/sensing/autoware_gnss_poser/src/gnss_poser_node.cpp
index 821010d318..576d60b80d 100644
--- a/sensing/autoware_gnss_poser/src/gnss_poser_node.cpp
+++ b/sensing/autoware_gnss_poser/src/gnss_poser_node.cpp
@@ -14,12 +14,14 @@
#include "gnss_poser_node.hpp"
+#include
#include
#include
#include
#include
+#include
#include
#include
#include
@@ -43,11 +45,57 @@ GnssPosePubMethod to_gnss_pose_pub_method(const int value)
std::to_string(value));
}
}
+
+OrientationSource to_orientation_source(const std::string & value)
+{
+ if (value == "ins") {
+ return OrientationSource::Ins;
+ }
+ if (value == "motion") {
+ return OrientationSource::Motion;
+ }
+ if (value == "none") {
+ return OrientationSource::None;
+ }
+ throw std::invalid_argument("orientation_source must be ins, motion or none, got " + value);
+}
+
+const char * to_string(const OrientationSource source)
+{
+ switch (source) {
+ case OrientationSource::Ins:
+ return "ins";
+ case OrientationSource::Motion:
+ return "motion";
+ case OrientationSource::None:
+ return "none";
+ case OrientationSource::InsOrNone:
+ return "ins, the identity until the first one (use_gnss_ins_orientation: true)";
+ }
+ return "unknown";
+}
+
+// A parameter that may be left out: std::nullopt when no value is given. A value of another type
+// than T makes the node fail to start, as for a parameter declared with its type.
+template
+std::optional declare_optional_parameter(
+ autoware::agnocast_wrapper::Node & node, const std::string & name)
+{
+ rcl_interfaces::msg::ParameterDescriptor descriptor;
+ descriptor.dynamic_typing = true;
+ const rclcpp::ParameterValue & value =
+ node.declare_parameter(name, rclcpp::ParameterValue{}, descriptor);
+ if (value.get_type() == rclcpp::ParameterType::PARAMETER_NOT_SET) {
+ return std::nullopt;
+ }
+ return value.get();
+}
} // namespace
GnssPoserNode::GnssPoserNode(const rclcpp::NodeOptions & node_options)
: autoware::agnocast_wrapper::Node("gnss_poser", node_options),
base_frame_(declare_parameter("base_frame")),
+ orientation_source_(declare_orientation_source()),
gnss_poser_(
declare_gnss_poser_params(),
[this](const std::string & gnss_frame) {
@@ -56,6 +104,8 @@ GnssPoserNode::GnssPoserNode(const rclcpp::NodeOptions & node_options)
tf2_listener_(tf2_buffer_, *this),
tf2_broadcaster_(*this)
{
+ RCLCPP_INFO(this->get_logger(), "orientation_source: %s", to_string(orientation_source_));
+
// Subscribe to map_projector_info topic
sub_map_projector_info_ = create_subscription(
"/map/map_projector_info", rclcpp::QoS{1}.transient_local(),
@@ -83,13 +133,53 @@ GnssPoserParams GnssPoserNode::declare_gnss_poser_params()
GnssPoserParams params;
params.gnss_base_frame = declare_parameter("gnss_base_frame");
params.map_frame = declare_parameter("map_frame");
- params.use_gnss_ins_orientation = declare_parameter("use_gnss_ins_orientation");
+ params.orientation_source = orientation_source_;
params.gnss_pose_pub_method =
to_gnss_pose_pub_method(declare_parameter("gnss_pose_pub_method"));
params.buff_epoch = declare_parameter("buff_epoch");
return params;
}
+// orientation_source replaces use_gnss_ins_orientation. Configurations written before it set only
+// the old parameter, so either one is enough: the old one is ignored when orientation_source is
+// set. false is read as motion. true keeps what it did, OrientationSource::InsOrNone, which no
+// value of orientation_source selects: it goes away together with use_gnss_ins_orientation.
+OrientationSource GnssPoserNode::declare_orientation_source()
+{
+ const std::optional source =
+ declare_optional_parameter(*this, "orientation_source");
+ const std::optional use_gnss_ins_orientation =
+ declare_optional_parameter(*this, "use_gnss_ins_orientation");
+
+ if (!source.has_value()) {
+ if (!use_gnss_ins_orientation.has_value()) {
+ throw std::invalid_argument("orientation_source must be set");
+ }
+ if (!use_gnss_ins_orientation.value()) {
+ RCLCPP_WARN(
+ this->get_logger(),
+ "use_gnss_ins_orientation is deprecated; set orientation_source instead. "
+ "use_gnss_ins_orientation: false is read as orientation_source: motion.");
+ return OrientationSource::Motion;
+ }
+ RCLCPP_WARN(
+ this->get_logger(),
+ "use_gnss_ins_orientation is deprecated; set orientation_source instead. "
+ "use_gnss_ins_orientation: true keeps what it did, the INS orientation once one has arrived "
+ "and the identity until then, which no orientation_source selects: use ins when "
+ "autoware_orientation is published, none otherwise.");
+ return OrientationSource::InsOrNone;
+ }
+
+ // Both are set: orientation_source wins.
+ if (use_gnss_ins_orientation.has_value()) {
+ RCLCPP_WARN(
+ this->get_logger(),
+ "use_gnss_ins_orientation is deprecated and ignored because orientation_source is set.");
+ }
+ return to_orientation_source(source.value());
+}
+
void GnssPoserNode::callback_map_projector_info(
const AUTOWARE_MESSAGE_CONST_SHARED_PTR(autoware_map_msgs::msg::MapProjectorInfo) & msg)
{
@@ -127,6 +217,12 @@ void GnssPoserNode::callback_nav_sat_fix(
"Buffering Position. Output Skipped.");
break;
+ case GnssPoser::Outcome::NoOrientation:
+ RCLCPP_WARN_STREAM_THROTTLE(
+ this->get_logger(), *this->get_clock(), std::chrono::milliseconds(1000).count(),
+ "autoware_orientation has not been received yet. Output Skipped.");
+ break;
+
// A missing antenna transform is logged below, when the result says it is to be reported;
// every fix without it would be too many.
case GnssPoser::Outcome::TransformLookupFailed:
@@ -183,6 +279,12 @@ void GnssPoserNode::callback_gnss_ins_orientation_stamped(
const AUTOWARE_MESSAGE_CONST_SHARED_PTR(autoware_sensing_msgs::msg::GnssInsOrientationStamped) &
msg)
{
+ if (orientation_source_ == OrientationSource::None) {
+ RCLCPP_WARN_ONCE(
+ this->get_logger(),
+ "autoware_orientation is received but ignored because orientation_source is none. Set "
+ "orientation_source to ins to use it.");
+ }
gnss_poser_.set_ins_orientation(msg->orientation);
}
diff --git a/sensing/autoware_gnss_poser/src/gnss_poser_node.hpp b/sensing/autoware_gnss_poser/src/gnss_poser_node.hpp
index e4455df13e..9b1c38e72e 100644
--- a/sensing/autoware_gnss_poser/src/gnss_poser_node.hpp
+++ b/sensing/autoware_gnss_poser/src/gnss_poser_node.hpp
@@ -45,6 +45,7 @@ class GnssPoserNode : public autoware::agnocast_wrapper::Node
private:
GnssPoserParams declare_gnss_poser_params();
+ OrientationSource declare_orientation_source();
void callback_map_projector_info(
const AUTOWARE_MESSAGE_CONST_SHARED_PTR(autoware_map_msgs::msg::MapProjectorInfo) & msg);
@@ -70,6 +71,8 @@ class GnssPoserNode : public autoware::agnocast_wrapper::Node
// spin(), the cancel is lost and the destructor waits forever in join()
// (https://github.com/ros2/rclcpp/issues/3172).
const std::string base_frame_;
+ // Read from orientation_source, or from use_gnss_ins_orientation when only that is set.
+ const OrientationSource orientation_source_;
GnssPoser gnss_poser_;
tf2::BufferCore tf2_buffer_;
diff --git a/sensing/autoware_gnss_poser/test/test_gnss_poser.cpp b/sensing/autoware_gnss_poser/test/test_gnss_poser.cpp
index f93abccc92..442f4c662b 100644
--- a/sensing/autoware_gnss_poser/test/test_gnss_poser.cpp
+++ b/sensing/autoware_gnss_poser/test/test_gnss_poser.cpp
@@ -57,6 +57,7 @@ namespace
using autoware::gnss_poser::GnssPosePubMethod;
using autoware::gnss_poser::GnssPoser;
using autoware::gnss_poser::GnssPoserParams;
+using autoware::gnss_poser::OrientationSource;
using autoware_map_msgs::msg::MapProjectorInfo;
using autoware_sensing_msgs::msg::GnssInsOrientation;
using geometry_msgs::msg::Point;
@@ -492,6 +493,30 @@ class GnssPoserMotionHeading : public ::testing::TestWithParam
{
};
+// An orientation source that uses the INS orientation once one has arrived.
+struct InsSource
+{
+ const char * name;
+ OrientationSource source;
+};
+
+class GnssPoserInsSource : public ::testing::TestWithParam
+{
+};
+
+// An orientation source, and whether an INS orientation has arrived, that leave the orientation
+// unknown.
+struct UnknownOrientation
+{
+ const char * name;
+ OrientationSource source;
+ bool ins_orientation_arrived;
+};
+
+class GnssPoserUnknownOrientation : public ::testing::TestWithParam
+{
+};
+
struct CovarianceType
{
const char * name;
@@ -935,13 +960,16 @@ TEST(GnssPoser, Buffer_FirstFixAfterGatedFixes_FillsOnlyOneSlot)
// 4. Orientation
// =======================================================================================
-// With use_gnss_ins_orientation = true the pose carries the orientation of the latest
-// `autoware_orientation` message, and the orientation covariance diagonal is its RMSE squared
-// (float32 precision). A newer message replaces the previous one; its header is irrelevant.
-TEST(GnssPoser, InsOrientation_NewerMessage_ReplacesPrevious)
+// With OrientationSource Ins, and InsOrNone once a message has arrived, the pose carries the
+// orientation of the latest `autoware_orientation` message, and the orientation covariance
+// diagonal is its RMSE squared (float32 precision). A newer message replaces the previous one; its
+// header is irrelevant.
+TEST_P(GnssPoserInsSource, InsOrientation_NewerMessage_ReplacesPrevious)
{
// Arrange
- GnssPoser poser = make_poser_with_mgrs_projector({});
+ GnssPoserParams params;
+ params.orientation_source = GetParam().source;
+ GnssPoser poser = make_poser_with_mgrs_projector(params);
poser.set_ins_orientation(make_orientation(M_PI / 2.0, 0.1, 0.2, 0.3));
input_fixes(poser, {make_reference_fix()});
// A newer orientation message replaces the previous one; its header is irrelevant.
@@ -956,23 +984,45 @@ TEST(GnssPoser, InsOrientation_NewerMessage_ReplacesPrevious)
expect_rotation_variances_near(covariance_of(result), 0.25, 0.36, 0.49);
}
-// With use_gnss_ins_orientation = true the node does not wait for an orientation message: before
-// the first one it publishes the message-default orientation (identity, i.e. heading east in `map`)
-// with the constructor's placeholder RMSE of 1.0 squared, and the antenna position unchanged.
-//
-// NOTE(characterization): a consumer cannot tell this placeholder from a measured orientation whose
-// RMSE happens to be 1.0, and the identity heading also enters the antenna -> base_link lever-arm
-// correction. Whether to gate on the first orientation (as on projector info) is a decision for the
-// refactoring phase, not for this test.
-TEST(GnssPoser, InsOrientation_NoMessageYet_IdentityAndUnitCovariance)
+INSTANTIATE_TEST_SUITE_P(
+ InsAndInsOrNone, GnssPoserInsSource,
+ ::testing::Values(
+ InsSource{"Ins", OrientationSource::Ins}, InsSource{"InsOrNone", OrientationSource::InsOrNone}),
+ [](const ::testing::TestParamInfo & info) { return std::string(info.param.name); });
+
+// With orientation_source ins the pose waits for the INS orientation: before the first message a
+// fix yields only gnss_fixed, instead of a pose with an orientation nobody measured.
+TEST(GnssPoser, InsOrientation_NoMessageYet_PublishesOnlyGnssFixed)
+{
+ // Arrange
+ GnssPoserParams params;
+ params.orientation_source = OrientationSource::Ins;
+ GnssPoser poser = make_poser_with_mgrs_projector(params);
+
+ // Act
+ const auto result = poser.input_fix(make_reference_fix());
+
+ // Assert
+ EXPECT_EQ(result.outcome, GnssPoser::Outcome::NoOrientation);
+ expect_only_gnss_fixed(result);
+ EXPECT_TRUE(result.gnss_fixed.value().data);
+}
+
+// The orientation is unknown with OrientationSource None, which ignores the INS orientation, and
+// with InsOrNone before the first one. The pose then carries the identity orientation (heading
+// east in `map`) with the placeholder RMSE of 1.0 squared, and the antenna position unchanged.
+TEST_P(GnssPoserUnknownOrientation, UnknownOrientation_IdentityAndUnitCovariance)
{
// Arrange
GnssPoserParams params;
params.gnss_pose_pub_method = GnssPosePubMethod::Instant;
- params.use_gnss_ins_orientation = true;
+ params.orientation_source = GetParam().source;
GnssPoser poser(params, identity_lookup);
const auto projector = make_mgrs_projector_info();
poser.set_projector_info(projector);
+ if (GetParam().ins_orientation_arrived) {
+ poser.set_ins_orientation(make_orientation(M_PI / 2.0, 0.1, 0.2, 0.3));
+ }
const auto fix = make_reference_fix();
const auto expected_antenna = project_antenna(fix, projector);
@@ -984,7 +1034,7 @@ TEST(GnssPoser, InsOrientation_NoMessageYet_IdentityAndUnitCovariance)
EXPECT_TRUE(result.gnss_fixed.value().data);
expect_point_near(pose_of(result).position, expected_antenna);
expect_same_rotation(pose_of(result).orientation, yaw_to_quaternion(0.0));
- // 1.0 comes from the constructor's placeholder rmse and is squared: 1.0^2 = 1.0.
+ // 1.0 comes from the placeholder rmse and is squared: 1.0^2 = 1.0.
EXPECT_DOUBLE_EQ(covariance_of(result)[cov_roll_roll], 1.0);
EXPECT_DOUBLE_EQ(covariance_of(result)[cov_pitch_pitch], 1.0);
EXPECT_DOUBLE_EQ(covariance_of(result)[cov_yaw_yaw], 1.0);
@@ -992,7 +1042,16 @@ TEST(GnssPoser, InsOrientation_NoMessageYet_IdentityAndUnitCovariance)
EXPECT_DOUBLE_EQ(covariance_of(result)[cov_xx], 1.0);
}
-// With use_gnss_ins_orientation = false the heading comes from motion, and only from the last two
+INSTANTIATE_TEST_SUITE_P(
+ NoneAndInsOrNone, GnssPoserUnknownOrientation,
+ ::testing::Values(
+ UnknownOrientation{"None_InsOrientationArrived", OrientationSource::None, true},
+ UnknownOrientation{"InsOrNone_NoInsOrientationYet", OrientationSource::InsOrNone, false}),
+ [](const ::testing::TestParamInfo & info) {
+ return std::string(info.param.name);
+ });
+
+// With orientation_source motion the heading comes from motion, and only from the last two
// accepted positions: the first fix has no previous position and gets the identity; every later fix
// gets yaw = atan2 of its displacement from the previous fix (roll = pitch = 0), whatever the
// heading before was. The orientation covariance is the constant 0.1 / 0.1 / 1.0 regardless of the
@@ -1004,7 +1063,7 @@ TEST(GnssPoser, MotionOrientation_FirstFix_IdentityAndConstantCovariance)
{
// Arrange
GnssPoserParams params;
- params.use_gnss_ins_orientation = false;
+ params.orientation_source = OrientationSource::Motion;
GnssPoser poser = make_poser_with_mgrs_projector(params);
// INS orientation messages are ignored in this mode.
poser.set_ins_orientation(make_orientation(M_PI / 2.0, 0.1, 0.2, 0.3));
@@ -1016,7 +1075,7 @@ TEST(GnssPoser, MotionOrientation_FirstFix_IdentityAndConstantCovariance)
// Assert
expect_same_rotation(pose_of(result).orientation, yaw_to_quaternion(0.0));
- // use_gnss_ins_orientation = false always writes the constants 0.1 / 0.1 / 1.0.
+ // orientation_source motion always writes the constants 0.1 / 0.1 / 1.0.
EXPECT_DOUBLE_EQ(covariance_of(result)[cov_roll_roll], 0.1);
EXPECT_DOUBLE_EQ(covariance_of(result)[cov_pitch_pitch], 0.1);
EXPECT_DOUBLE_EQ(covariance_of(result)[cov_yaw_yaw], 1.0);
@@ -1026,7 +1085,7 @@ TEST(GnssPoser, MotionOrientation_ThirdFix_YawFromLatestStepOnly)
{
// Arrange
GnssPoserParams params;
- params.use_gnss_ins_orientation = false;
+ params.orientation_source = OrientationSource::Motion;
GnssPoser poser = make_poser_with_mgrs_projector(params);
// INS orientation messages are ignored in this mode.
poser.set_ins_orientation(make_orientation(M_PI / 2.0, 0.1, 0.2, 0.3));
@@ -1055,7 +1114,7 @@ TEST(GnssPoser, MotionOrientation_StandingStill_YawSnapsToZero)
{
// Arrange
GnssPoserParams params;
- params.use_gnss_ins_orientation = false;
+ params.orientation_source = OrientationSource::Motion;
GnssPoser poser = make_poser_with_mgrs_projector(params);
// INS orientation messages are ignored in this mode.
poser.set_ins_orientation(make_orientation(M_PI / 2.0, 0.1, 0.2, 0.3));
@@ -1082,7 +1141,7 @@ TEST(GnssPoser, MotionOrientation_PreviousPositionSurvivesNonFixedMessages)
// Arrange
GnssPoserParams params;
params.gnss_pose_pub_method = GnssPosePubMethod::Instant;
- params.use_gnss_ins_orientation = false;
+ params.orientation_source = OrientationSource::Motion;
GnssPoser poser(params, identity_lookup);
const auto projector = make_mgrs_projector_info();
poser.set_projector_info(projector);
@@ -1111,7 +1170,7 @@ TEST(GnssPoser, MotionOrientation_WithBuffer_UsesFilteredPositions)
{
// Arrange
GnssPoserParams params = make_buffer_params(1, 2);
- params.use_gnss_ins_orientation = false;
+ params.orientation_source = OrientationSource::Motion;
GnssPoser poser = make_poser_with_mgrs_projector(params);
const auto fixes = make_buffered_motion_fixes();
const auto m12 = mean_of({project_mgrs(fixes[0]), project_mgrs(fixes[1])});
@@ -1133,7 +1192,7 @@ TEST_P(GnssPoserMotionHeading, MotionOrientation_CardinalDirection_YawFromDispla
{
// Arrange
GnssPoserParams params;
- params.use_gnss_ins_orientation = false;
+ params.orientation_source = OrientationSource::Motion;
GnssPoser poser = make_poser_with_mgrs_projector(params);
const auto from = make_reference_fix();
const auto to = make_fix(
@@ -1164,12 +1223,11 @@ INSTANTIATE_TEST_SUITE_P(
// The position covariance diagonal is copied from the fix for APPROXIMATED, DIAGONAL_KNOWN and
// KNOWN, and replaced by 10.0 for UNKNOWN; off-diagonal input entries are never propagated and
-// every off-diagonal output entry stays 0. The orientation covariance is the INS RMSE squared.
+// every off-diagonal output entry stays 0.
TEST_P(GnssPoserKnownCovarianceType, Covariance_KnownType_CopiesDiagonalFromFix)
{
// Arrange
GnssPoser poser = make_poser_with_mgrs_projector({});
- poser.set_ins_orientation(make_orientation(0.0, 0.1, 0.2, 0.3));
// Act
const auto result = poser.input_fix(make_fix_with_covariance(GetParam().type));
@@ -1192,7 +1250,6 @@ TEST(GnssPoser, Covariance_UnknownType_PositionVariancesAreTen)
{
// Arrange
GnssPoser poser = make_poser_with_mgrs_projector({});
- poser.set_ins_orientation(make_orientation(0.0, 0.1, 0.2, 0.3));
// Act
const auto result = poser.input_fix(make_fix_with_covariance(NavSatFix::COVARIANCE_TYPE_UNKNOWN));
@@ -1203,7 +1260,6 @@ TEST(GnssPoser, Covariance_UnknownType_PositionVariancesAreTen)
// 10.0 is hard-coded in the node:
// https://github.com/autowarefoundation/autoware_core/blob/904b5901488f24e13ae5c3add950b2b9985e1407/sensing/autoware_gnss_poser/src/gnss_poser_node.cpp#L192-L197
expect_position_variances(cov, 10.0, 10.0, 10.0);
- expect_rotation_variances_near(cov, 0.01, 0.04, 0.09);
// Everything off the diagonal is zero.
for (std::size_t i = 0; i < cov.size(); ++i) {
if (i % 7 != 0) {
@@ -1279,7 +1335,7 @@ TEST(GnssPoser, Tf_MissingTransform_FixAdvancesMotionHeading)
// Arrange
GnssPoserParams params;
params.gnss_pose_pub_method = GnssPosePubMethod::Instant;
- params.use_gnss_ins_orientation = false;
+ params.orientation_source = OrientationSource::Motion;
// no transform until it is assigned
tl::expected available =
tl::unexpected(TransformLookupError::Unavailable);
diff --git a/sensing/autoware_gnss_poser/test/test_gnss_poser_node.cpp b/sensing/autoware_gnss_poser/test/test_gnss_poser_node.cpp
index 0453e9c5cd..c36e424409 100644
--- a/sensing/autoware_gnss_poser/test/test_gnss_poser_node.cpp
+++ b/sensing/autoware_gnss_poser/test/test_gnss_poser_node.cpp
@@ -124,16 +124,18 @@ struct NodeParams
std::string base_frame = "base_link";
std::string gnss_base_frame = "gnss_base_link";
std::string map_frame = "map";
- bool use_gnss_ins_orientation = true;
+ std::optional orientation_source = "none";
+ // Deprecated, so left out unless a case sets it.
+ std::optional use_gnss_ins_orientation;
int gnss_pose_pub_method = 0;
int buff_epoch = 1;
- // The six parameters the node declares, in declaration order.
+ // The six parameters the node requires, in declaration order.
static const std::vector & names()
{
static const std::vector parameter_names = {
- "base_frame", "gnss_base_frame", "map_frame", "use_gnss_ins_orientation",
- "gnss_pose_pub_method", "buff_epoch"};
+ "base_frame", "gnss_base_frame", "map_frame",
+ "orientation_source", "gnss_pose_pub_method", "buff_epoch"};
return parameter_names;
}
@@ -149,7 +151,12 @@ struct NodeParams
add("base_frame", base_frame);
add("gnss_base_frame", gnss_base_frame);
add("map_frame", map_frame);
- add("use_gnss_ins_orientation", use_gnss_ins_orientation);
+ if (orientation_source) {
+ add("orientation_source", *orientation_source);
+ }
+ if (use_gnss_ins_orientation) {
+ add("use_gnss_ins_orientation", *use_gnss_ins_orientation);
+ }
add("gnss_pose_pub_method", gnss_pose_pub_method);
add("buff_epoch", buff_epoch);
return options;
@@ -640,7 +647,7 @@ class GnssPoserNodeIntegration : public ::testing::Test
{
NodeParams params;
params.gnss_pose_pub_method = 0;
- params.use_gnss_ins_orientation = true;
+ params.orientation_source = "ins";
params.base_frame = "my_base";
ASSERT_NO_FATAL_FAILURE(build_node_with_mgrs_projector(params));
send_orientation(make_orientation(M_PI / 2.0));
@@ -654,7 +661,7 @@ class GnssPoserNodeIntegration : public ::testing::Test
{
NodeParams params;
params.gnss_pose_pub_method = 0;
- params.use_gnss_ins_orientation = true;
+ params.orientation_source = "ins";
params.base_frame = "my_base";
ASSERT_NO_FATAL_FAILURE(build_node_with_mgrs_projector(params));
send_orientation(make_orientation(0.0));
@@ -738,14 +745,44 @@ class GnssPoserBuffEpochBelowOne : public GnssPoserNodeIntegration,
{
};
+// Where the orientation of a published pose came from, in the scenario of
+// Construct_OrientationSourceParameters_*.
+enum class PoseYaw { Identity, Ins, Motion };
+
+// orientation_source and use_gnss_ins_orientation as given (std::nullopt: not set), and the
+// orientations of the poses the node publishes.
+struct OrientationSourceParameters
+{
+ const char * name;
+ std::optional orientation_source;
+ std::optional use_gnss_ins_orientation;
+ std::vector pose_yaws;
+};
+
+std::ostream & operator<<(std::ostream & os, const OrientationSourceParameters & parameters)
+{
+ return os << parameters.name;
+}
+
+class GnssPoserOrientationSourceParameters
+: public GnssPoserNodeIntegration,
+ public ::testing::WithParamInterface
+{
+};
+
+class GnssPoserUnknownOrientationSource : public GnssPoserNodeIntegration,
+ public ::testing::WithParamInterface
+{
+};
+
} // namespace
// =======================================================================================
// 1. Construction and ROS interface
// =======================================================================================
-// The node is named `gnss_poser` in the root namespace and declares the six parameters the README
-// documents; every override is read back unchanged.
+// The node is named `gnss_poser` in the root namespace and declares the six parameters it
+// requires; every override is read back unchanged.
TEST_F(GnssPoserNodeIntegration, Construct_WithAllParameters_DeclaresThemAndIsNamedGnssPoser)
{
// Arrange
@@ -753,7 +790,7 @@ TEST_F(GnssPoserNodeIntegration, Construct_WithAllParameters_DeclaresThemAndIsNa
params.base_frame = "my_base";
params.gnss_base_frame = "my_gnss_base";
params.map_frame = "my_map";
- params.use_gnss_ins_orientation = false;
+ params.orientation_source = "motion";
params.gnss_pose_pub_method = 2;
params.buff_epoch = 7;
@@ -767,7 +804,7 @@ TEST_F(GnssPoserNodeIntegration, Construct_WithAllParameters_DeclaresThemAndIsNa
EXPECT_EQ(node_->get_parameter("base_frame").as_string(), "my_base");
EXPECT_EQ(node_->get_parameter("gnss_base_frame").as_string(), "my_gnss_base");
EXPECT_EQ(node_->get_parameter("map_frame").as_string(), "my_map");
- EXPECT_EQ(node_->get_parameter("use_gnss_ins_orientation").as_bool(), false);
+ EXPECT_EQ(node_->get_parameter("orientation_source").as_string(), "motion");
EXPECT_EQ(node_->get_parameter("gnss_pose_pub_method").as_int(), 2);
EXPECT_EQ(node_->get_parameter("buff_epoch").as_int(), 7);
}
@@ -809,6 +846,7 @@ INSTANTIATE_TEST_SUITE_P(
WrongTypedParameter{"base_frame", rclcpp::ParameterValue(123)},
WrongTypedParameter{"gnss_base_frame", rclcpp::ParameterValue(123)},
WrongTypedParameter{"map_frame", rclcpp::ParameterValue(123)},
+ WrongTypedParameter{"orientation_source", rclcpp::ParameterValue(123)},
WrongTypedParameter{"use_gnss_ins_orientation", rclcpp::ParameterValue("not_a_bool")},
WrongTypedParameter{"gnss_pose_pub_method", rclcpp::ParameterValue("not_an_int")},
WrongTypedParameter{"buff_epoch", rclcpp::ParameterValue("not_an_int")}),
@@ -856,6 +894,96 @@ INSTANTIATE_TEST_SUITE_P(
int_param_name(std::get<1>(info.param));
});
+// orientation_source replaces use_gnss_ins_orientation, and either one is enough: the old one is
+// ignored when orientation_source is set. The source in use shows in the poses of one scenario: a
+// fix, then the INS orientation (yaw pi/4), then a fix north of the first. ins publishes only the
+// second pose, with the INS yaw; none the identity twice; motion, and the old parameter false, the
+// identity, then the heading of the step (north, turned by the MGRS grid convergence). The old
+// parameter true keeps what it did, which no orientation_source selects: the identity, then the
+// INS yaw.
+TEST_P(GnssPoserOrientationSourceParameters, Construct_OrientationSourceParameters_SelectsTheSource)
+{
+ // Arrange
+ NodeParams params;
+ params.orientation_source = GetParam().orientation_source;
+ params.use_gnss_ins_orientation = GetParam().use_gnss_ins_orientation;
+ const NavSatFix first_fix = make_reference_fix();
+ const NavSatFix second_fix =
+ make_fix(reference_latitude + 0.001, reference_longitude, reference_altitude);
+ constexpr double ins_yaw = M_PI / 4;
+ ASSERT_NO_FATAL_FAILURE(build_node_with_mgrs_projector(params));
+ // The antenna transform of the fixes: the identity, so that the pose yaw is the orientation.
+ ASSERT_NO_FATAL_FAILURE(
+ broadcast_static_tf("gnss", "base_link", make_point(0.0, 0.0, 0.0), yaw_to_quaternion(0.0)));
+ ASSERT_NO_FATAL_FAILURE(send_fixes_and_wait({first_fix}));
+ send_orientation(make_orientation(ins_yaw));
+
+ // Act
+ ASSERT_NO_FATAL_FAILURE(send_fixes_and_wait({second_fix}));
+
+ // Assert
+ const Point first = project_mgrs(first_fix);
+ const Point second = project_mgrs(second_fix);
+ const double motion_yaw = std::atan2(second.y - first.y, second.x - first.x);
+ const std::vector & pose_yaws = GetParam().pose_yaws;
+ ASSERT_EQ(peer_->poses.size(), pose_yaws.size());
+ for (std::size_t i = 0; i < pose_yaws.size(); ++i) {
+ double expected = 0.0;
+ switch (pose_yaws[i]) {
+ case PoseYaw::Identity:
+ expected = 0.0;
+ break;
+
+ case PoseYaw::Ins:
+ expected = ins_yaw;
+ break;
+
+ case PoseYaw::Motion:
+ expected = motion_yaw;
+ break;
+ }
+ EXPECT_NEAR(yaw_of(peer_->poses[i].pose.orientation), expected, angle_tolerance)
+ << "pose " << i;
+ }
+}
+
+INSTANTIATE_TEST_SUITE_P(
+ EveryWayToSetIt, GnssPoserOrientationSourceParameters,
+ ::testing::Values(
+ OrientationSourceParameters{"Ins", "ins", std::nullopt, {PoseYaw::Ins}},
+ OrientationSourceParameters{
+ "Motion", "motion", std::nullopt, {PoseYaw::Identity, PoseYaw::Motion}},
+ OrientationSourceParameters{
+ "None", "none", std::nullopt, {PoseYaw::Identity, PoseYaw::Identity}},
+ OrientationSourceParameters{
+ "LegacyTrue", std::nullopt, true, {PoseYaw::Identity, PoseYaw::Ins}},
+ OrientationSourceParameters{
+ "LegacyFalse", std::nullopt, false, {PoseYaw::Identity, PoseYaw::Motion}},
+ OrientationSourceParameters{
+ "BothSet_OrientationSourceWins", "none", true, {PoseYaw::Identity, PoseYaw::Identity}}),
+ [](const ::testing::TestParamInfo & info) {
+ return std::string(info.param.name);
+ });
+
+// orientation_source accepts exactly ins, motion and none, in lower case. Any other value makes the
+// node fail to start.
+TEST_P(GnssPoserUnknownOrientationSource, Construct_UnknownOrientationSource_FailsToStart)
+{
+ // Arrange
+ NodeParams params;
+ params.orientation_source = GetParam();
+
+ // Act & Assert
+ EXPECT_THROW(
+ std::make_shared(params.to_options()), std::exception);
+}
+
+INSTANTIATE_TEST_SUITE_P(
+ NotAValue, GnssPoserUnknownOrientationSource, ::testing::Values("Ins", "gyro", ""),
+ [](const ::testing::TestParamInfo & info) {
+ return info.param.empty() ? std::string("Empty") : info.param;
+ });
+
// The node has no built-in defaults: the values README.md and the schema document as defaults live
// in config/gnss_poser.param.yaml, which the launch file loads. That file must keep constructing
// the node and read back exactly as documented.
@@ -873,7 +1001,11 @@ TEST_F(GnssPoserNodeIntegration, Construct_WithShippedParamFile_MatchesDocumente
EXPECT_EQ(node->get_parameter("base_frame").as_string(), "base_link");
EXPECT_EQ(node->get_parameter("gnss_base_frame").as_string(), "gnss_base_link");
EXPECT_EQ(node->get_parameter("map_frame").as_string(), "map");
- EXPECT_TRUE(node->get_parameter("use_gnss_ins_orientation").as_bool());
+ EXPECT_EQ(node->get_parameter("orientation_source").as_string(), "none");
+ // The deprecated parameter is left out.
+ EXPECT_EQ(
+ node->get_parameter("use_gnss_ins_orientation").get_type(),
+ rclcpp::ParameterType::PARAMETER_NOT_SET);
EXPECT_EQ(node->get_parameter("gnss_pose_pub_method").as_int(), 0);
EXPECT_EQ(node->get_parameter("buff_epoch").as_int(), 1);
}
@@ -993,7 +1125,7 @@ TEST_F(GnssPoserNodeIntegration, Tf_StaticAntennaToBaseTransform_IsComposedAndBr
// Arrange
NodeParams params;
params.gnss_pose_pub_method = 0;
- params.use_gnss_ins_orientation = true;
+ params.orientation_source = "ins";
params.base_frame = "my_base";
params.gnss_base_frame = "my_gnss_base";
params.map_frame = "my_map";