diff --git a/wrp_sdk_msgs/CMakeLists.txt b/wrp_sdk_msgs/CMakeLists.txt index 9076f4d..fea33d1 100644 --- a/wrp_sdk_msgs/CMakeLists.txt +++ b/wrp_sdk_msgs/CMakeLists.txt @@ -26,7 +26,6 @@ set(message_files "msg/mobile_base/MotorState.msg" "msg/mobile_base/RangeData.msg" "msg/mobile_base/RangeDataArray.msg" - "msg/mobile_base/RcState.msg" "msg/mobile_base/SystemState.msg" # peripheral diff --git a/wrp_sdk_msgs/msg/mobile_base/RcState.msg b/wrp_sdk_msgs/msg/mobile_base/RcState.msg deleted file mode 100644 index 22cdb90..0000000 --- a/wrp_sdk_msgs/msg/mobile_base/RcState.msg +++ /dev/null @@ -1,3 +0,0 @@ -std_msgs/Header header -float32[8] axes -int32[8] buttons \ No newline at end of file diff --git a/wrp_sdk_robot/README.md b/wrp_sdk_robot/README.md index d6a65ea..d37ccf3 100644 --- a/wrp_sdk_robot/README.md +++ b/wrp_sdk_robot/README.md @@ -56,7 +56,7 @@ Legend: Y - Supported, N - Not Supported, P - Partially Supported | `~/actuator_state` | wrp_sdk_msgs::msg::ActuatorStateArray | Outputs robot's actuator states | | `~/odom` | nav_msgs::msg::Odometry | Outputs robot's wheel odometry | | `~/battery_state` | sensor_msgs::msg::BatteryState | Outputs robot's battery state | -| `~/rc_state` | wrp_sdk_msgs::msg::RcState | Outputs robot's rc state (if applicable) | +| `~/rc_state` | sensor_msgs::msg::Joy | Outputs robot's rc state (if applicable) | | Subscribed Topic | Type | Description | | ---------------- | ------------------------- | ------------------------ | diff --git a/wrp_sdk_robot/include/wrp_sdk_robot/mobile_base_node.hpp b/wrp_sdk_robot/include/wrp_sdk_robot/mobile_base_node.hpp index cc8046a..e455c63 100644 --- a/wrp_sdk_robot/include/wrp_sdk_robot/mobile_base_node.hpp +++ b/wrp_sdk_robot/include/wrp_sdk_robot/mobile_base_node.hpp @@ -21,14 +21,12 @@ #include #include #include +#include #include "wrp_sdk_msgs/msg/system_state.hpp" #include "wrp_sdk_msgs/msg/motion_state.hpp" #include "wrp_sdk_msgs/msg/actuator_state_array.hpp" #include "wrp_sdk_msgs/msg/actuator_state.hpp" -#include "wrp_sdk_msgs/msg/range_data.hpp" -#include "wrp_sdk_msgs/msg/range_data_array.hpp" #include "wrp_sdk_msgs/msg/motion_command.hpp" -#include "wrp_sdk_msgs/msg/rc_state.hpp" #include "wrp_sdk_msgs/srv/access_control.hpp" #include "wrp_sdk_msgs/srv/assisted_mode_control.hpp" @@ -94,13 +92,9 @@ class MobileBaseNode : public rclcpp::Node { actuator_state_publisher_; rclcpp::Publisher::SharedPtr battery_state_publisher_; - rclcpp::Publisher::SharedPtr rc_state_publisher_; + rclcpp::Publisher::SharedPtr rc_state_publisher_; rclcpp::Publisher::SharedPtr odom_publisher_; - rclcpp::Publisher::SharedPtr - tof_data_publisher_; - rclcpp::Publisher::SharedPtr - ultrasonic_data_publisher_; rclcpp::Service::SharedPtr access_control_service_; diff --git a/wrp_sdk_robot/src/mobile_base_node.cpp b/wrp_sdk_robot/src/mobile_base_node.cpp index 23e0f8a..0198049 100644 --- a/wrp_sdk_robot/src/mobile_base_node.cpp +++ b/wrp_sdk_robot/src/mobile_base_node.cpp @@ -145,7 +145,7 @@ bool MobileBaseNode::SetupInterfaces() { this->create_publisher("~/battery_state", 10); rc_state_publisher_ = - this->create_publisher("~/rc_state", 10); + this->create_publisher("~/rc_state", 10); odom_publisher_ = this->create_publisher("~/odom", 50); @@ -153,12 +153,6 @@ bool MobileBaseNode::SetupInterfaces() { // setup tf broadcaster tf_broadcaster_ = std::make_shared(this); } - ultrasonic_data_publisher_ = - this->create_publisher( - "~/ultrasonic_data", 10); - tof_data_publisher_ = - this->create_publisher("~/tof_data", - 10); // setup services access_control_service_ = @@ -375,16 +369,16 @@ void MobileBaseNode::PublishActuatorState() { void MobileBaseNode::PublishRcState() { auto rc_state = robot_->GetRcState(); - wrp_sdk_msgs::msg::RcState rc_state_msg; + sensor_msgs::msg::Joy rc_state_msg; rc_state_msg.header.stamp = this->now(); rc_state_msg.header.frame_id = base_frame_; for (size_t i = 0; i < 8; i++) { - rc_state_msg.axes[i] = rc_state.axes[i]; + rc_state_msg.axes.push_back(rc_state.axes[i]); } for (size_t i = 0; i < 8; i++) { - rc_state_msg.buttons[i] = rc_state.buttons[i]; + rc_state_msg.buttons.push_back(rc_state.buttons[i]); } rc_state_publisher_->publish(rc_state_msg);