Skip to content

Commit 469f1e7

Browse files
committed
Merge branch 'main' into codex/deprecate-ros-1-and-prepare-ros-2-for-kilted-release
2 parents acc79b3 + 73cd0de commit 469f1e7

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ bridge:
270270
271271
As seen in the [Quick Start](#quick-start), the *mqtt_client* can not only exchange arbitrary ROS messages with other *mqtt_clients*, but it can also exchange primitive message data with other non-*mqtt_client* MQTT clients. This allows ROS-based devices to exchange primitive messages with devices not based on ROS. The `primitive` parameter can be set for both ROS-to-MQTT (`bridge/ros2mqtt`) and for MQTT-to-ROS (`bridge/mqtt2ros`) transmissions.
272272

273-
If a ROS-to-MQTT transmission is configured as `primitive` and the ROS message type is one of the supported primitive ROS message types, the raw data is published as a string. The supported primitive ROS message types are [`std_msgs/String`](http://docs.ros.org/en/api/std_msgs/html/msg/String.html), [`std_msgs/Bool`](http://docs.ros.org/en/api/std_msgs/html/msg/Bool.html), [`std_msgs/Char`](http://docs.ros.org/en/api/std_msgs/html/msg/Char.html), [`std_msgs/UInt8`](http://docs.ros.org/en/api/std_msgs/html/msg/UInt8.html), [`std_msgs/UInt16`](http://docs.ros.org/en/api/std_msgs/html/msg/UInt16.html), [`std_msgs/UInt32`](http://docs.ros.org/en/api/std_msgs/html/msg/UInt32.html), [`std_msgs/UInt64`](http://docs.ros.org/en/api/std_msgs/html/msg/UInt16.html), [`std_msgs/Int8`](http://docs.ros.org/en/api/std_msgs/html/msg/Int8.html), [`std_msgs/Int16`](http://docs.ros.org/en/api/std_msgs/html/msg/Int16.html), [`std_msgs/Int32`](http://docs.ros.org/en/api/std_msgs/html/msg/Int32.html), [`std_msgs/Int64`](http://docs.ros.org/en/api/std_msgs/html/msg/Int64.html), [`std_msgs/Float32`](http://docs.ros.org/en/api/std_msgs/html/msg/Float32.html), [`std_msgs/Float32`](http://docs.ros.org/en/api/std_msgs/html/msg/Float64.html).
273+
If a ROS-to-MQTT transmission is configured as `primitive` and the ROS message type is one of the supported primitive ROS message types, the raw data is published as a string. The supported primitive ROS message types are [`std_msgs/String`](http://docs.ros.org/en/api/std_msgs/html/msg/String.html), [`std_msgs/Bool`](http://docs.ros.org/en/api/std_msgs/html/msg/Bool.html), [`std_msgs/Char`](http://docs.ros.org/en/api/std_msgs/html/msg/Char.html), [`std_msgs/UInt8`](http://docs.ros.org/en/api/std_msgs/html/msg/UInt8.html), [`std_msgs/UInt16`](http://docs.ros.org/en/api/std_msgs/html/msg/UInt16.html), [`std_msgs/UInt32`](http://docs.ros.org/en/api/std_msgs/html/msg/UInt32.html), [`std_msgs/UInt64`](http://docs.ros.org/en/api/std_msgs/html/msg/UInt64.html), [`std_msgs/Int8`](http://docs.ros.org/en/api/std_msgs/html/msg/Int8.html), [`std_msgs/Int16`](http://docs.ros.org/en/api/std_msgs/html/msg/Int16.html), [`std_msgs/Int32`](http://docs.ros.org/en/api/std_msgs/html/msg/Int32.html), [`std_msgs/Int64`](http://docs.ros.org/en/api/std_msgs/html/msg/Int64.html), [`std_msgs/Float32`](http://docs.ros.org/en/api/std_msgs/html/msg/Float32.html), [`std_msgs/Float64`](http://docs.ros.org/en/api/std_msgs/html/msg/Float64.html).
274274

275275
If an MQTT-to-ROS transmission is configured as `primitive`, the MQTT message is interpreted and published as a primitive data type, if possible. The message is probed in the following order: `bool` ([`std_msgs/Bool`](http://docs.ros.org/en/api/std_msgs/html/msg/Bool.html)), `int` ([`std_msgs/Int32`](http://docs.ros.org/en/api/std_msgs/html/msg/Int32.html)), `float` ([`std_msgs/Float32`](http://docs.ros.org/en/api/std_msgs/html/msg/Float32.html)), `string` ([`std_msgs/String`](http://docs.ros.org/en/api/std_msgs/html/msg/String.html)).
276276

mqtt_client/include/mqtt_client/MqttClient.ros2.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ class MqttClient : public rclcpp::Node,
199199
const Ros2MqttInterface& ros2mqtt) const;
200200

201201
/**
202-
* @brief Get the candiate topic endpoints for subscription matching
202+
* @brief Get the candidate topic endpoints for subscription matching
203203
*
204204
* @param ros2mqtt the ROS to MQTT interface spec
205205
*

mqtt_client/src/MqttClient.ros2.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ T mqtt2float(mqtt::const_message_ptr mqtt_msg) {
6767
std::size_t pos;
6868
const T v = std::stold(str_msg, &pos);
6969

70-
if (pos != str_msg.size())
71-
throw std::invalid_argument ("not all charaters processed");
70+
if (pos != str_msg.size())
71+
throw std::invalid_argument ("not all characters processed");
7272

7373
return v;
7474
}
@@ -79,8 +79,8 @@ T mqtt2int(mqtt::const_message_ptr mqtt_msg) {
7979
std::size_t pos;
8080
const T v = std::stoll(str_msg, &pos);
8181

82-
if (pos != str_msg.size())
83-
throw std::invalid_argument ("not all charaters processed");
82+
if (pos != str_msg.size())
83+
throw std::invalid_argument ("not all characters processed");
8484

8585
return v;
8686
}
@@ -150,9 +150,9 @@ bool fixedMqtt2PrimitiveRos(mqtt::const_message_ptr mqtt_msg,
150150
msg.data = mqtt2int<int32_t>(mqtt_msg);
151151

152152
serializeRosMessage(msg, serialized_msg);
153-
} else if (msg_type == "std_msgs/msg/Int64") {
154-
std_msgs::msg::Int32 msg;
155-
msg.data = mqtt2int<int32_t>(mqtt_msg);
153+
} else if (msg_type == "std_msgs/msg/Int64") {
154+
std_msgs::msg::Int64 msg;
155+
msg.data = mqtt2int<int64_t>(mqtt_msg);
156156

157157
serializeRosMessage(msg, serialized_msg);
158158
} else if (msg_type == "std_msgs/msg/Float32") {

0 commit comments

Comments
 (0)