Skip to content

Commit 96a2d96

Browse files
committed
Merge branch 'main' into feature/eskf-landmark-valve
2 parents 963afcf + 8a0f2e8 commit 96a2d96

File tree

4 files changed

+21
-32
lines changed

4 files changed

+21
-32
lines changed

mission/landmark_server/config/landmark_server_config.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
/**:
22
ros__parameters:
3-
target_frame: "odom"
3+
target_frame: "orca/odom"
44
timer_rate_ms: 200
5-
enu_ned_rotation: true
65

76
track_config:
87
default:

mission/landmark_server/include/landmark_server/landmark_server_ros.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,6 @@ class LandmarkServerNode : public rclcpp::Node {
170170
std::shared_ptr<tf2_ros::Buffer> tf2_buffer_;
171171
std::shared_ptr<tf2_ros::TransformListener> tf2_listener_;
172172

173-
bool enu_ned_rotation_{false};
174-
175173
std::shared_ptr<LandmarkPollingGoalHandle> active_landmark_polling_goal_;
176174
std::shared_ptr<LandmarkConvergenceGoalHandle>
177175
active_landmark_convergence_goal_;

mission/landmark_server/src/landmark_server_convergence.cpp

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <spdlog/spdlog.h>
22
#include <rclcpp_action/client.hpp>
33
#include <vortex/utils/ros/ros_conversions.hpp>
4+
#include <vortex/utils/waypoint_utils.hpp>
45
#include <vortex_msgs/msg/waypoint.hpp>
56
#include <vortex_msgs/msg/waypoint_mode.hpp>
67
#include "landmark_server/landmark_server_ros.hpp"
@@ -464,27 +465,13 @@ geometry_msgs::msg::Pose LandmarkServerNode::compute_target_pose(
464465
const vortex::filtering::Track& track,
465466
const geometry_msgs::msg::Pose& convergence_offset) {
466467
const auto landmark_pose = track.to_pose();
467-
468-
const Eigen::Vector3d p_landmark = landmark_pose.pos_vector();
469-
const Eigen::Quaterniond q_landmark =
470-
landmark_pose.ori_quaternion().normalized();
471-
472-
const Eigen::Vector3d p_offset(convergence_offset.position.x,
473-
convergence_offset.position.y,
474-
convergence_offset.position.z);
475-
476-
const Eigen::Quaterniond q_offset =
477-
Eigen::Quaterniond(
478-
convergence_offset.orientation.w, convergence_offset.orientation.x,
479-
convergence_offset.orientation.y, convergence_offset.orientation.z)
480-
.normalized();
481-
482-
const Eigen::Vector3d p_target = p_landmark + p_offset;
483-
484-
const Eigen::Quaterniond q_target = (q_landmark * q_offset).normalized();
485-
486-
return vortex::utils::ros_conversions::eigen_to_pose_msg(p_target,
487-
q_target);
468+
const auto base = vortex::utils::types::Pose::from_eigen(
469+
landmark_pose.pos_vector(), landmark_pose.ori_quaternion());
470+
const auto offset =
471+
vortex::utils::ros_conversions::ros_pose_to_pose(convergence_offset);
472+
const auto target =
473+
vortex::utils::waypoints::apply_pose_offset(base, offset);
474+
return vortex::utils::ros_conversions::to_pose_msg(target);
488475
}
489476

490477
} // namespace vortex::mission

mission/landmark_server/src/landmark_server_ros.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ void LandmarkServerNode::create_reference_publisher() {
6565
void LandmarkServerNode::create_pose_subscription() {
6666
std::string landmark_topic =
6767
this->declare_parameter<std::string>("topics.landmarks");
68-
enu_ned_rotation_ = this->declare_parameter<bool>("enu_ned_rotation");
6968
target_frame_ = this->declare_parameter<std::string>("target_frame");
7069
auto qos_sensor_profile =
7170
vortex::utils::qos_profiles::sensor_data_profile(1);
@@ -98,12 +97,6 @@ void LandmarkServerNode::create_pose_subscription() {
9897
}
9998

10099
auto new_measurements = ros_msg_to_landmarks(pose_tf);
101-
if (enu_ned_rotation_) {
102-
std::ranges::for_each(new_measurements, [](auto& m) {
103-
m.pose.set_ori(vortex::utils::math::enu_ned_rotation(
104-
m.pose.ori_quaternion()));
105-
});
106-
}
107100
{
108101
std::lock_guard<std::mutex> lock(measurements_mtx_);
109102
measurements_ = std::move(new_measurements);
@@ -273,6 +266,15 @@ void LandmarkServerNode::timer_callback() {
273266

274267
convergence_update();
275268

269+
if (active_landmark_polling_goal_ &&
270+
active_landmark_polling_goal_->is_canceling()) {
271+
auto result =
272+
std::make_shared<vortex_msgs::action::LandmarkPolling_Result>();
273+
active_landmark_polling_goal_->canceled(result);
274+
active_landmark_polling_goal_ = nullptr;
275+
return;
276+
}
277+
276278
if (active_landmark_polling_goal_ &&
277279
active_landmark_polling_goal_->is_active()) {
278280
const auto goal = active_landmark_polling_goal_->get_goal();
@@ -294,6 +296,9 @@ void LandmarkServerNode::timer_callback() {
294296
if (!found) {
295297
return;
296298
}
299+
spdlog::info(
300+
"LandmarkPolling: found landmark(s) for type={}, subtype={}", type,
301+
subtype);
297302
vortex_msgs::msg::LandmarkArray landmarks =
298303
tracks_to_landmark_msgs(type, subtype);
299304
auto polling_result =

0 commit comments

Comments
 (0)