diff --git a/MbedHardware.h b/MbedHardware.h index 94d8fc0..e036006 100644 --- a/MbedHardware.h +++ b/MbedHardware.h @@ -13,7 +13,7 @@ class MbedHardware { public: - MbedHardware(PinName tx, PinName rx, long baud = 57600) + MbedHardware(PinName tx, PinName rx, long baud = ROSSERIAL_BAUDRATE) :iostream(tx, rx){ baud_ = baud; t.start(); @@ -21,7 +21,7 @@ class MbedHardware { MbedHardware() :iostream(ROSSERIAL_TX, ROSSERIAL_RX) { - baud_ = 57600; + baud_ = ROSSERIAL_BAUDRATE; t.start(); } diff --git a/README.md b/README.md index 7c1a25c..fe98057 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # rosserial-mbed-lib -This repository is a slightly modified content of `ros_lib` directory created accordingly to [rosserial MBED Setup](http://wiki.ros.org/rosserial_mbed/Tutorials/rosserial_mbed%20Setup) tutorial from official ros documentation. Modification involves changing default Serial pins used by library to fit CORE2 RPI connector. You can adjust them in `mbed_app.json` under "target_overrides" tag. +This repository is a slightly modified content of `ros_lib` directory created accordingly to [rosserial MBED Setup](http://wiki.ros.org/rosserial_mbed/Tutorials/rosserial_mbed%20Setup) tutorial from official ros documentation. Condensed, step by step recipe: 1. `$ mkdir -p ~/ros_workspace/src && cd ros_workspace/src && catkin_init_workspace` @@ -9,6 +9,20 @@ Condensed, step by step recipe: 4. `$ source devel/setup.bash` 5. `$ rosrun rosserial_mbed make_libraries.py ~/workspace/ros/lib` +This library is compatible with Mbed CLI tools. You can change default Serial pins and baudrate used by rosserial in `mbed_app.json`. +Example: + +```json +{ + "target_overrides":{ + "*": { + "mbed-rosserial-lib.tx_pin": "MY_TX_PIN", + "mbed-rosserial-lib.rx_pin": "MY_RX_PIN", + "mbed-rosserial-lib.baudrate": "230400" + } + } +} +``` diff --git a/actionlib_msgs/GoalID.h b/actionlib_msgs/GoalID.h index 160ca8a..cb553fd 100644 --- a/actionlib_msgs/GoalID.h +++ b/actionlib_msgs/GoalID.h @@ -5,7 +5,7 @@ #include #include #include "ros/msg.h" -#include "ros/time.h" +#include "ros/ros_time.h" namespace actionlib_msgs { diff --git a/control_msgs/QueryTrajectoryState.h b/control_msgs/QueryTrajectoryState.h index aef19a8..d23f60d 100644 --- a/control_msgs/QueryTrajectoryState.h +++ b/control_msgs/QueryTrajectoryState.h @@ -4,7 +4,7 @@ #include #include #include "ros/msg.h" -#include "ros/time.h" +#include "ros/ros_time.h" namespace control_msgs { diff --git a/gazebo_msgs/ApplyBodyWrench.h b/gazebo_msgs/ApplyBodyWrench.h index e7af6bb..bd6c4b4 100644 --- a/gazebo_msgs/ApplyBodyWrench.h +++ b/gazebo_msgs/ApplyBodyWrench.h @@ -6,7 +6,7 @@ #include "ros/msg.h" #include "ros/duration.h" #include "geometry_msgs/Wrench.h" -#include "ros/time.h" +#include "ros/ros_time.h" #include "geometry_msgs/Point.h" namespace gazebo_msgs diff --git a/gazebo_msgs/ApplyJointEffort.h b/gazebo_msgs/ApplyJointEffort.h index 636084f..07b750b 100644 --- a/gazebo_msgs/ApplyJointEffort.h +++ b/gazebo_msgs/ApplyJointEffort.h @@ -5,7 +5,7 @@ #include #include "ros/msg.h" #include "ros/duration.h" -#include "ros/time.h" +#include "ros/ros_time.h" namespace gazebo_msgs { diff --git a/laser_assembler/AssembleScans.h b/laser_assembler/AssembleScans.h index 7aa8745..7607289 100644 --- a/laser_assembler/AssembleScans.h +++ b/laser_assembler/AssembleScans.h @@ -4,7 +4,7 @@ #include #include #include "ros/msg.h" -#include "ros/time.h" +#include "ros/ros_time.h" #include "sensor_msgs/PointCloud.h" namespace laser_assembler diff --git a/laser_assembler/AssembleScans2.h b/laser_assembler/AssembleScans2.h index ae2f6b7..535af6d 100644 --- a/laser_assembler/AssembleScans2.h +++ b/laser_assembler/AssembleScans2.h @@ -5,7 +5,7 @@ #include #include "ros/msg.h" #include "sensor_msgs/PointCloud2.h" -#include "ros/time.h" +#include "ros/ros_time.h" namespace laser_assembler { diff --git a/mbed_lib.json b/mbed_lib.json index ffaf062..db2a8c1 100644 --- a/mbed_lib.json +++ b/mbed_lib.json @@ -1,15 +1,20 @@ { "name": "mbed-rosserial-lib", "config": { - "default_tx_pin": { - "help": "Default library's Serial TX pin.", + "tx_pin": { + "help": "Default library Serial TX pin.", "macro_name": "ROSSERIAL_TX", - "value": "RPI_SERIAL_TX" + "value": "USBTX" }, - "default_rx_pin": { - "help": "Default library's Serial RX pin.", + "rx_pin": { + "help": "Default library Serial RX pin.", "macro_name": "ROSSERIAL_RX", - "value": "RPI_SERIAL_RX" + "value": "USBRX" + }, + "rx_baudrate": { + "help": "Default library Serial baudrate.", + "macro_name": "ROSSERIAL_BAUDRATE", + "value": "115200" } } } \ No newline at end of file diff --git a/nav_msgs/MapMetaData.h b/nav_msgs/MapMetaData.h index 5ac655b..3052ccf 100644 --- a/nav_msgs/MapMetaData.h +++ b/nav_msgs/MapMetaData.h @@ -5,7 +5,7 @@ #include #include #include "ros/msg.h" -#include "ros/time.h" +#include "ros/ros_time.h" #include "geometry_msgs/Pose.h" namespace nav_msgs diff --git a/polled_camera/GetPolledImage.h b/polled_camera/GetPolledImage.h index b062405..0b38504 100644 --- a/polled_camera/GetPolledImage.h +++ b/polled_camera/GetPolledImage.h @@ -6,7 +6,7 @@ #include "ros/msg.h" #include "sensor_msgs/RegionOfInterest.h" #include "ros/duration.h" -#include "ros/time.h" +#include "ros/ros_time.h" namespace polled_camera { diff --git a/ros/time.h b/ros/ros_time.h similarity index 97% rename from ros/time.h rename to ros/ros_time.h index 441d952..dda5d8b 100644 --- a/ros/time.h +++ b/ros/ros_time.h @@ -32,10 +32,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef ROS_TIME_H_ -#define ROS_TIME_H_ +#ifndef __ROS_TIME_H__ +#define __ROS_TIME_H__ -#include "ros/duration.h" +#include "duration.h" #include #include diff --git a/rosgraph_msgs/Clock.h b/rosgraph_msgs/Clock.h index febd870..aa64200 100644 --- a/rosgraph_msgs/Clock.h +++ b/rosgraph_msgs/Clock.h @@ -5,7 +5,7 @@ #include #include #include "ros/msg.h" -#include "ros/time.h" +#include "ros/ros_time.h" namespace rosgraph_msgs { diff --git a/rosgraph_msgs/TopicStatistics.h b/rosgraph_msgs/TopicStatistics.h index a11f784..43bd508 100644 --- a/rosgraph_msgs/TopicStatistics.h +++ b/rosgraph_msgs/TopicStatistics.h @@ -5,7 +5,7 @@ #include #include #include "ros/msg.h" -#include "ros/time.h" +#include "ros/ros_time.h" #include "ros/duration.h" namespace rosgraph_msgs diff --git a/sensor_msgs/TimeReference.h b/sensor_msgs/TimeReference.h index dbb8a02..70826c3 100644 --- a/sensor_msgs/TimeReference.h +++ b/sensor_msgs/TimeReference.h @@ -6,7 +6,7 @@ #include #include "ros/msg.h" #include "std_msgs/Header.h" -#include "ros/time.h" +#include "ros/ros_time.h" namespace sensor_msgs { diff --git a/std_msgs/.mbedignore b/std_msgs/.mbedignore new file mode 100644 index 0000000..8f4295a --- /dev/null +++ b/std_msgs/.mbedignore @@ -0,0 +1,32 @@ +Bool.h +Byte.h +ByteMultiArray.h +Char.h +ColorRGBA.h +Duration.h +Empty.h +Float32.h +Float32MultiArray.h +Float64.h +Float64MultiArray.h +Header.h +Int16.h +Int16MultiArray.h +Int32.h +Int32MultiArray.h +Int64.h +Int64MultiArray.h +Int8.h +Int8MultiArray.h +MultiArrayDimension.h +MultiArrayLayout.h +String.h +Time.h +UInt16.h +UInt16MultiArray.h +UInt32.h +UInt32MultiArray.h +UInt64.h +UInt64MultiArray.h +UInt8.h +UInt8MultiArray.h diff --git a/std_msgs/Header.h b/std_msgs/Header.h index f7b0944..7ba5515 100644 --- a/std_msgs/Header.h +++ b/std_msgs/Header.h @@ -5,7 +5,7 @@ #include #include #include "ros/msg.h" -#include "ros/time.h" +#include "ros/ros_time.h" namespace std_msgs { diff --git a/std_msgs/Time.h b/std_msgs/Time.h index c1ca708..2fba3cb 100644 --- a/std_msgs/Time.h +++ b/std_msgs/Time.h @@ -5,7 +5,7 @@ #include #include #include "ros/msg.h" -#include "ros/time.h" +#include "ros/ros_time.h" namespace std_msgs { diff --git a/tf2_msgs/LookupTransformGoal.h b/tf2_msgs/LookupTransformGoal.h index 11cc856..d001db4 100644 --- a/tf2_msgs/LookupTransformGoal.h +++ b/tf2_msgs/LookupTransformGoal.h @@ -5,7 +5,7 @@ #include #include #include "ros/msg.h" -#include "ros/time.h" +#include "ros/ros_time.h" #include "ros/duration.h" namespace tf2_msgs diff --git a/time.cpp b/time.cpp index 86221f9..2482e5d 100644 --- a/time.cpp +++ b/time.cpp @@ -32,7 +32,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include "ros/time.h" +#include "ros/ros_time.h" namespace ros {