Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes for comiling on ubuntu 22.04 ros2 humble #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion omni_common/src/omni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <urdf/model.h>
#include "sensor_msgs/msg/joint_state.hpp"

#include <string.h>
Expand Down
13 changes: 6 additions & 7 deletions omni_common/src/omni_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "rclcpp/rclcpp.hpp"
#include "geometry_msgs/msg/pose_stamped.hpp"
#include "geometry_msgs/msg/wrench_stamped.hpp"
#include <urdf/model.h>
#include "sensor_msgs/msg/joint_state.hpp"

#include <string.h>
Expand Down Expand Up @@ -113,36 +112,36 @@ class PhantomROS
stream1 << omni_name << "/button";
std::string button_topic = std::string(stream1.str());
button_publisher = node_->create_publisher<omni_msgs::msg::OmniButtonEvent>(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<omni_msgs::msg::OmniState>(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<omni_msgs::msg::OmniFeedback>(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<geometry_msgs::msg::PoseStamped>(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<sensor_msgs::msg::JointState>(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;
Expand Down