From af764d1da734381dc27506068696ddd0fc4ea5de Mon Sep 17 00:00:00 2001 From: kevilex Date: Tue, 30 Jul 2024 15:16:37 +0200 Subject: [PATCH] fixes for comiling on ubuntu 22.04 ros2 humble --- omni_common/src/omni.cpp | 1 - omni_common/src/omni_state.cpp | 13 ++++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/omni_common/src/omni.cpp b/omni_common/src/omni.cpp index 06d0881..2dd8c1e 100644 --- a/omni_common/src/omni.cpp +++ b/omni_common/src/omni.cpp @@ -28,7 +28,6 @@ #include "geometry_msgs/msg/pose_stamped.hpp" #include "tf2_ros/transform_broadcaster.h" #include "geometry_msgs/msg/wrench_stamped.hpp" -#include #include "sensor_msgs/msg/joint_state.hpp" #include diff --git a/omni_common/src/omni_state.cpp b/omni_common/src/omni_state.cpp index 2e64bd1..7aef3b2 100644 --- a/omni_common/src/omni_state.cpp +++ b/omni_common/src/omni_state.cpp @@ -26,7 +26,6 @@ #include "rclcpp/rclcpp.hpp" #include "geometry_msgs/msg/pose_stamped.hpp" #include "geometry_msgs/msg/wrench_stamped.hpp" -#include #include "sensor_msgs/msg/joint_state.hpp" #include @@ -113,36 +112,36 @@ class PhantomROS stream1 << omni_name << "/button"; std::string button_topic = std::string(stream1.str()); button_publisher = node_->create_publisher(button_topic.c_str(), 100); - RCLCPP_INFO(node_->get_logger(), "Publishing button events on: " + button_topic); + RCLCPP_INFO(node_->get_logger(), "Publishing button events on: %s", button_topic.c_str()); // Publish on NAME/state std::ostringstream stream2; stream2 << omni_name << "/state"; std::string state_topic_name = std::string(stream2.str()); state_publisher = node_->create_publisher(state_topic_name.c_str(), 1); - RCLCPP_INFO(node_->get_logger(), "Publishing omni state on: " + state_topic_name); + RCLCPP_INFO(node_->get_logger(), "Publishing omni state on: %s", state_topic_name.c_str()); // Subscribe to NAME/force_feedback std::ostringstream stream3; stream3 << omni_name << "/force_feedback"; std::string force_feedback_topic = std::string(stream3.str()); haptic_sub = node_->create_subscription(force_feedback_topic.c_str(), 1, std::bind(&PhantomROS::force_callback, this, std::placeholders::_1)); - RCLCPP_INFO(node_->get_logger(), "listening to: " + force_feedback_topic + " for haptic info"); + RCLCPP_INFO(node_->get_logger(), "listening to: %s for haptic info", force_feedback_topic.c_str() ); // Publish on NAME/pose std::ostringstream stream4; stream4 << omni_name << "/pose"; std::string pose_topic_name = std::string(stream4.str()); pose_publisher = node_->create_publisher(pose_topic_name.c_str(), 1); - RCLCPP_INFO(node_->get_logger(), "Publishing pose on: " + pose_topic_name); + RCLCPP_INFO(node_->get_logger(), "Publishing pose on: %s", pose_topic_name.c_str() ); // Publish on NAME/joint_states std::ostringstream stream5; stream5 << omni_name << "/joint_states"; std::string joint_topic_name = std::string(stream5.str()); joint_publisher = node_->create_publisher(joint_topic_name.c_str(), 1); - RCLCPP_INFO(node_->get_logger(), "Publishing joint state on: " + joint_topic_name); - + RCLCPP_INFO(node_->get_logger(), "Publishing joint state on: %s", joint_topic_name.c_str() ); + state = s; state->buttons[0] = 0; state->buttons[1] = 0;