/rbcpp

A C++ library for interacting with ROS from non-ROS machines using the rosbridge_suite protocol.

Primary LanguageC++

rbcpp Build Status

rosbridgeclient + cpp = rbcpp

A rosbridge v2.0 client.

rosbridge provides a JSON interface to ROS, allowing any client to send JSON to publish or subscribe to ROS topics, call ROS services, and more.

It allows you to work with ROS on not officially supported hardware or operating systems.

DEPRECATED, USE AT YOUR OWN RISK. This will eventually be rewritten with https://github.com/target/libdart

Important Note: as of now, tornado >= 4.5.3 breaks the websocket connection with rosbridge. See issue. If your connection is dropped at the fist send attempt, check your tornado version with pip show tornado.

TOC

  1. install, Build
  2. Status
  3. Usage

Build, Install

Minimum Requirements: clang-6.0, g++-6 or xcode9.1

To use librbc, you need to install cpprestsdk. If you want to run the tests, as well, you need to additionally install Catch2

Set compiler, e.g g++-8, for entire session

export CXX=/usr/bin/g++-8

or do so in the cmake command: cmake -DCMAKE_CXX_COMPILER=/usr/bin/g++-7 .., see below

Build only the client api

mkdir build && cd build
cmake -DCMAKE_CXX_COMPILER=/path/to/compiler ..
make

Install with

sudo make install

Build all tests, as well

mkdir build && cd build
cmake -DCMAKE_CXX_COMPILER=/path/to/compiler -DCOMPILE_TEST=ON ..
make 

Note: On Mac, you may need to adjust OPENSSL_ROOT_DIR and OPENSSL_INCLUDE_DIR, if your openssl installation is not located in /usr/local/opt/openssl

Status: very early development

ROS Services

  • Support for basic ROS services

Implement your own serializer (class to json) and deserializer (json to class) for more complex use cases

Publisher, Subscriber

All messages that are checked below can be used already. Examples can be found here

Type Messages Subscriber Status Publisher Status
geometry_msgs orientation
orientation stamped
vector3
vector3 stamped
pose
pose 2d
pose array
pose stamped
pose with covariance
pose with covariance stamped
point
point32
point stamped
accel
accel stamped
accel with covariance
accel with covariance stamped
inertia
inertia stamped
wrench
wrench stamped
polygon
polygon stamped
transform
transform stamped
twist
twist stamped
twist with covariance
twist with covariance stamped
nav_msgs GridCells
Odometry
Path
OccupancyGrid
MapMetaData
sensor_msgs BatteryState
CameraInfo
ChannelFloat32
CompressedImage
FluidPressure
Illuminance
Image
  • (rosbrigde error?)
Imu
JointState
Joy
JoyFeedback
JoyFeedbackArray
LaserEcho
LaserScan
MagneticField
MultiDOFJointState
MultiEchoLaserScan
NavSatFix
NavSatStatus
PointCloud
PointCloud2
PointField
Range
RegionOfInterest
RelativeHumidity
Temperature
TimeReference
SetCameraInfo
std_msgs String
Header
Int8
Int8MultiArray
Int16
Int16MultiArray
Int32
Int32MultiArray
Int64
Int64MultiArray
UInt8
UInt16
UInt16MultiArray
UInt32
UInt32MultiArray
UInt64
UInt64MultiArray
MultiArrayDimension
MultiArrayLayout
Time
Byte
ByteMultiArray
Char
ColorRGBA
Duration
Empty
Bool
Float32
Float32MultiArray
Float64
Float64MultiArray
UInt8MultiArray

Usage

TODO

  • cmake install
  • make web value json call safer
  • test all wrench stamped constructors
  • overload operators for Int/Float std_msgs
  • check incoming received_message for validity
  • Instructions for custom service