Closing of the client's port automatically unregisters the client from the server.
See bsproxy_if.h for the message API.
The BotSense Proxy client-server messages can be partitioned in several sets. Table 1 lists these groups.
The application messages contain a header and (optionally) a body. The header and body contain message fields. Fields are packed big-endian, with the most significant byte sent first. The maximum length (number of bytes) of messages is 256 (BSPROXY_MSG_MAX_LEN) bytes.
| type | description |
| byte | uninterpreted 8-bit octet |
| char | 1 byte ASCII character |
| u8 | 1 byte unsigned integer |
| u16 | 2 byte unsigned integer |
| u32 | 4 byte unsigned integer |
| zstr | zero-terminated ASCII string |
| Table 2: Field Data Types | |
| field | type | description |
| msg_id | u8 | request message id |
| tid | u8 | client generated transaction id |
| blen | u8 | length of request message body (number of bytes) |
| Table 3: Client Request Header Fields | ||
| field | type | description |
| msg_id | u8 | echoed client's request message id |
| tid | u8 | echoed client's transaction id |
| pf | char | client request result: passed ('P') or failed ('F') |
| blen | u8 | length of response message body (number of bytes) |
| Table 4: Server Response Header Fields | ||
| field | type | description |
| msg_id | u8 | echoed client's request message id |
| tid | u8 | echoed client's transaction id |
'F' | char | request failed |
| blen | u8 | strlen(error_msg)+1 |
| error_msg | zstr | error message with trailing 0 |
| Table 5: Server Fail Response Message | ||
The exception to the above fail response is when the recieved request is completely undecipherable by bsproxy. In this case msg_id = BSPROXY_MSGID_ERROR, and tid = 0. Otherwise, the format is identical.
| Loopback - Loopback client request. The request's message body is looped back without any interpretation. msg_id: BSPROXY_MSGID_LOOPBACK | ||||
| client request body | ||||
| ||||
| server pass response body | ||||
|
| Server Log - Set bsproxy's diagnostics logging level. Logging messages are written to the log file on the target server. Default output stream is stderr. msg_id: BSPROXY_MSGID_LOG | ||||
| client request body | ||||
| ||||
| server pass response body | ||||
|
| Server Version - Get bsproxy's version string. msg_id: BSPROXY_MSGID_VERSION | ||||
| client request body | ||||
| ||||
| server pass response body | ||||
|
| Proxied Device Info - Get list of server supported proxied device types. See proxied_devices for list of device types. msg_id: BSPROXY_MSGID_PROXY_INFO | ||||
| client request body | ||||
| ||||
| server pass response body | ||||
|
The I2C proxied device operator semantics provide raw access to target I2C Bus. Since the BrainPack I2C devices are attached to a target I2C Bus, clients with opened BrainPack proxied devices may also take advantage of the raw I/O operations.
The RS-232 proxied device operator semantics provide raw access to the target point-to-point serial connection. Since the RCB-3 Controller is an RS-232 device (over USB), clients with opened RCB-3 proxied devices may also take advantage of the raw I/O operations.
| Open Proxied Device - Open a bsproxy supported proxied device. Client access to a proxied device is through the opened proxied device handle returned in the response message. The client must keep track of its opened device handles. msg_id: BSPROXY_MSGID_DEV_OPEN | ||||||||||||
| client request body | ||||||||||||
| ||||||||||||
| server pass response body | ||||||||||||
|
| Close Proxied Device - Close a bsproxy proxied device. The close operation frees up the resource for the client. The client may then reuse resource for a new proxied device. The server actually only closes a proxied device when the device's reference count is zero. That is, when no other opened proxied devices from all clients reference the underlining system resource. msg_id: BSPROXY_MSGID_DEV_CLOSE | ||||
| client request body | ||||
| ||||
| server pass response body | ||||
|
| Proxied Device Read - Read data from a proxied device. The bytes read are uninterpreted and simply passed back to the client. msg_id: BSPROXY_MSGID_DEV_READ | ||||||||||||
| client request body | ||||||||||||
| ||||||||||||
| server pass response body | ||||||||||||
|
| Proxied Device Write - Write data to a proxied device. The bytes written are uninterpreted. msg_id: BSPROXY_MSGID_DEV_WRITE | ||||||||||||
| client request body | ||||||||||||
| ||||||||||||
| server pass response body | ||||||||||||
|
| Proxied Device Transaction - Perform a transaction with a proxied device. A transaction is a write/read operation. All device bytes are uninterpreted. msg_id: BSPROXY_MSGID_DEV_TRANS | ||||||||||||||||
| client request body | ||||||||||||||||
| ||||||||||||||||
| server pass response body | ||||||||||||||||
|
| Proxied Device IOCTL - Issue a device control call to a proxied device. msg_id: BSPROXY_MSGID_DEV_IOCTL | ||||||||||||||||||||||||||||
| RS-232 client request body | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
| other client request body | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
| server pass response body | ||||||||||||||||||||||||||||
|
| Proxied Device Scan - Scan for attach resources on the proxied device. msg_id: BSPROXY_MSGID_DEV_SCAN | ||||||||
| client request body | ||||||||
| ||||||||
| I2C server pass response body | ||||||||
|
| Proxied Device Command - Execute a proxied device specific command. See the following BrainPack and RCB-3 message sections for the specific, higher-level proxied devices messages. msg_id: BSPROXY_MSGID_DEV_CMD | ||||||||||||
| client request body | ||||||||||||
| ||||||||||||
| server pass response body | ||||||||||||
|
| Get Foot IDs - Get the BrainPack device identifiers. dev_cmd_id: BSPROXY_BPFOOT_CMDID_GET_IDS | ||||||||
| client device command body | ||||||||
| ||||||||
| server pass response body | ||||||||
|
| Calibrate Foot - Calibrate BrainPack Foot sensors. Currently, the calibration sets the zero mark at the current pressure readings. To calibarate: lift the robot up so that the feet are unloaded, issue this calibrate command, and the sensors are calibrated. Note: calibration could change. dev_cmd_id: BSPROXY_BPFOOT_CMDID_CAL | |
| client device command body | |
| |
| server pass response body | |
|
| Get Raw Foot Data - Get the BrainPack Foot raw sensor readings. There are 8 (BSPROXY_BPFOOT_NUMOF_SENSORS) pressure sensors, 6 on the sole and 2 on the toe. Sensor order is left to right, top to bottom, starting at the front of the sole to the back of the heel, then the left and right toe sensors. dev_cmd_id: BSPROXY_BPFOOT_CMDID_GET_RAW | ||||
| client device command body | ||||
| ||||
| server pass response body | ||||
|
| Get Calibrated Foot Data - Get the BrainPack Foot calibrated sensor readings. There are 8 (BSPROXY_BPFOOT_NUMOF_SENSORS) pressure sensors, 6 on the sole and 2 on the toe. Sensor order is left to right, top to bottom, starting at the front of the sole to the back of the heel, then the left and right toe sensors. dev_cmd_id: BSPROXY_BPFOOT_CMDID_GET_COOKED | ||||
| client device command body | ||||
| ||||
| server pass response body | ||||
|
| Get IMU IDs - Get the BrainPack device identifiers. dev_cmd_id: BSPROXY_BPIMU_CMDID_GET_IDS | ||||||||
| client device command body | ||||||||
| ||||||||
| server pass response body | ||||||||
|
| Set IMU Orientation - Set the BrainPack IMU x-y-z orientation. The sensor read-out is always x-y-z order. However, the labeling of the axes are set by the orientation which specifies a set of coordinate rotations. dev_cmd_id: BSPROXY_BPIMU_CMDID_SET_ORIENT | ||||
| client device command body | ||||
| ||||
| server pass response body | ||||
|
| Calibrate IMU - Calibrate BrainPack IMU sensors. Currently this is not defined and needs investigation. dev_cmd_id: BSPROXY_BPIMU_CMDID_CAL | |
| client device command body | |
| |
| server pass response body | |
|
| Get Raw IMU Data - Get the BrainPack IMU raw sensor readings. There are 3 (BSPROXY_BPIMU_NUMOF_SENSORS) orthogonal acceleration sensors in the x-y-z direction. Sensor order is x, y, z, rotated by orientation. dev_cmd_id: BSPROXY_BPIMU_CMDID_GET_RAW | ||||
| client device command body | ||||
| ||||
| server pass response body | ||||
|
| Get Calibrated IMU Data - Get the BrainPack IMU calibrated sensor readings. There are 3 (BSPROXY_BPIMU_NUMOF_SENSORS) orthogonal acceleration sensors in the x-y-z direction. Sensor order is x, y, z, rotated by orientation. dev_cmd_id: BSPROXY_BPIMU_CMDID_GET_COOKED | ||||
| client device command body | ||||
| ||||
| server pass response body | ||||
|
See the RoadNarrows Robotics RCB3 package for more information.
The RCB-3 API header files are rcb3/rcb3prot.h and rcb3/rcb3lib.h
| Get RCB-3 Version - Get the version of the RCB-3 controller. dev_cmd_id: RCB3CmdIdGetVersion | ||||
| client device command body | ||||
| ||||
| server pass response body | ||||
|
| Get Servo Positions - Get the robot current servo positions. Get the current angular positions of all 24 (RCB3_PORT_NUM_MAX) servos. The order is relative to the robotic platform. dev_cmd_id: RCB3CmdIdGetCurPos | ||||
| client device command body | ||||
| ||||
| server pass response body | ||||
|
| Move Servo - Move a servo. The servo is rotated to the given end angular position at the give speed. The specified servo number is relative the specific robotic platform. dev_cmd_id: RCB3CmdIdMoveServo | ||||||||||||
| client device command body | ||||||||||||
| ||||||||||||
| server pass response body | ||||||||||||
|
| Playback - Play a motion or scenario. The motion or scenario is stored in the RCB-3 controller's EEPROM. dev_cmd_id: RCB3CmdIdPlay | ||||
| client device command body | ||||
| ||||
| server pass response body | ||||
|
| Motion Stop - Stop all servos. dev_cmd_id: RCB3CmdIdStop | |
| client device command body | |
| |
| server pass response body | |
|
1.4.6