diff --git a/pronto_ros/include/pronto_ros/ros_frontend.hpp b/pronto_ros/include/pronto_ros/ros_frontend.hpp index 965c34e..a5daa1c 100644 --- a/pronto_ros/include/pronto_ros/ros_frontend.hpp +++ b/pronto_ros/include/pronto_ros/ros_frontend.hpp @@ -265,7 +265,6 @@ void ROSFrontEnd::initCallback(std::shared_ptr msg, const SensorId& sensor } if(initialized_list_.count(sensor_id) > 0 && !initialized_list_[sensor_id]) { - msg->header.set__stamp(nh_->get_clock()->now()); initialized_list_[sensor_id] = static_cast*>(init_modules_[sensor_id])->processMessageInit( msg.get(), initialized_list_, @@ -311,7 +310,6 @@ void ROSFrontEnd::callback(std::shared_ptr msg, const SensorId& sensor_id) // appropriate casting to the right type and call to the process message // function to get the update // Record start time - msg->header.set__stamp(nh_->get_clock()->now()); #if DEBUG_MODE auto start = std::chrono::high_resolution_clock::now(); #endif @@ -451,7 +449,6 @@ void ROSFrontEnd::callback(std::shared_ptr msg, const SensorId& sensor_id) template void ROSFrontEnd::secondaryCallback(std::shared_ptr msg, const SensorId& sensor_id) { - msg->header.set__stamp(nh_->get_clock()->now()); auto a = dynamic_cast*>(static_cast*>(active_modules_[sensor_id])); a->processSecondaryMessage(*msg); } diff --git a/pronto_ros2_node/src/pronto_ros2_node.cpp b/pronto_ros2_node/src/pronto_ros2_node.cpp index 3d37783..2e5d9f7 100755 --- a/pronto_ros2_node/src/pronto_ros2_node.cpp +++ b/pronto_ros2_node/src/pronto_ros2_node.cpp @@ -17,8 +17,11 @@ #include "pi3hat_moteus_int_msgs/msg/joints_states.hpp" #include "sensor_msgs/msg/imu.hpp" +#include #include #include +#include +#include #include "pinocchio/algorithm/model.hpp" @@ -36,7 +39,6 @@ namespace pronto class Pronto_Ros2 : public rclcpp::Node { using SensorList = std::vector; - using SensorSet = std::unordered_set; public: Pronto_Ros2(): Node("Pronto_ROS2_Node") @@ -69,13 +71,17 @@ namespace pronto RCLCPP_INFO_STREAM(get_logger(),init_sensors_.size()<<" "<(this->shared_from_this(),true); - for (SensorSet::iterator it = all_sensors_.begin(); it != all_sensors_.end(); ++it) + for (SensorList::iterator it = all_sensors_.begin(); it != all_sensors_.end(); ++it) { RCLCPP_INFO(get_logger(),"allocate sensor %s",it->c_str()); declare_parameter(*it + ".roll_forward_on_receive",false); @@ -341,7 +347,7 @@ namespace pronto private: SensorList init_sensors_; SensorList active_sensors_; - SensorSet all_sensors_; + SensorList all_sensors_; std::string urdf_file_; //declare the mammal utils stuff and the ros_frontend