Skip to content

SerialPortBridgeGeneric

Send data (ex: force, displacement, pressure…) through the usb port. Usually used to send data to an Arduino card to control the real robot.

Target: SoftRobots

namespace: softrobots::controller

parents:

  • Controller

Data

Name Description Default value
name object name unnamed
printLog if true, emits extra messages at runtime. 0
tags list of the subsets the objet belongs to
bbox this object bounding box
componentState The state of the component among (Dirty, Valid, Undefined, Loading, Invalid). Undefined
listening if true, handle the events, otherwise ignore the events 0
handleEventTriggersUpdate Event handling frequency controls the controller update frequency 0
port Serial port name
baudRate Transmission speed
packetOut Data to send: vector of unsigned char, each entry should be an integer between 0 and header-1 <= 255. The value of 'header' will be sent at the beginning of the sent data, enabling to implement a header research in the 'receiving' code, for synchronization purposes.
packetIn Data received: vector of unsigned char, each entry should be an integer between 0 and header-1 <= 255.
header Vector of unsigned char. Only one value is espected, two values if splitPacket = 1. 255 254
size Size of the arrow to send. Use to check sentData size. Will return a warning if sentData size does not match this value. 0
precise If true, will send the data in the format [header[0],[MSB,LSB]*2*size] 0
splitPacket If true, will split the packet in two for lower error rate (only in precise mode), data will have the format [header[0],[MSB,LSB]*size],[header[1],[MSB,LSB]*size] 0
redundancy Each packet will be send that number of times (1=default) 1
receive If true, will read from serial port (timeOut = 10ms) 0
Name Description Destination type name
context Graph Node containing this object (or BaseContext::getDefault() if no graph is used) BaseContext
slaves Sub-objects used internally by this object BaseObject
master nullptr for regular objects, or master object for which this object is one sub-objects BaseObject