File tree Expand file tree Collapse file tree
vortex_utils_ros/include/vortex/utils/ros Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313#include < geometry_msgs/msg/pose_stamped.hpp>
1414#include < geometry_msgs/msg/pose_with_covariance.hpp>
1515#include < geometry_msgs/msg/pose_with_covariance_stamped.hpp>
16+ #include < geometry_msgs/msg/twist_with_covariance_stamped.hpp>
1617#include < vortex_msgs/msg/landmark_array.hpp>
1718#include < vortex_msgs/msg/operation_mode.hpp>
1819
@@ -201,6 +202,25 @@ inline std::vector<vortex::utils::types::Pose> ros_to_pose_vec(
201202 return poses;
202203}
203204
205+ /* *
206+ * @brief Converts a ROS geometry_msgs::msg::TwistWithCovarianceStamped to an
207+ * internal Twist type.
208+ * @param twist_msg geometry_msgs::msg::TwistWithCovarianceStamped
209+ * @return vortex::utils::types::Twist Internal twist representation
210+ */
211+ inline vortex::utils::types::Twist ros_twist_cov_msg_to_twist (
212+ const geometry_msgs::msg::TwistWithCovarianceStamped& twist_msg) {
213+ const auto & t = twist_msg.twist .twist ;
214+ return vortex::utils::types::Twist{
215+ .u = t.linear .x ,
216+ .v = t.linear .y ,
217+ .w = t.linear .z ,
218+ .p = t.angular .x ,
219+ .q = t.angular .y ,
220+ .r = t.angular .z ,
221+ };
222+ }
223+
204224/* *
205225 * @brief Converts a ROS vortex_msgs::msg::OperationMode to an internal Mode
206226 * enum.
You can’t perform that action at this time.
0 commit comments