Skip to main content
Version: 4.11.0

Interfaces

info

The Fuzzy RTOS API is aimed at developers for the purpose of developing custom programs.

The Fuzzy RTOS API (application programming interface) can be used to link Fuzzy RTOS to custom applications.

Sample codes can be found in the following git repository.

Protobuf descriptions

We rely on protobuf to format our messages, whether in binary form or serialized as JSON.

The description files are available here: api_v2.proto and api_v2_rtos.proto.

REST API

Description

From https://www.redhat.com/en/topics/api/what-is-a-rest-api

A REST API (also known as RESTful API) is an application programming interface (API or web API) that conforms to the constraints of REST architectural style and allows for interaction with RESTful web services. REST stands for representational state transfer and was created by computer scientist Roy Fielding.

Purpose

You may want to use this API to configure the system, query its state (robot, driver…), supported hardware (robots, controllers, …) and send commands.

Available resources

This is a non-exhaustive list of the resources we provide over this API:

  • Robots: query the list of available robots in this version of Fuzzy RTOS.
  • Controllers: query the list of available controllers in this version of Fuzzy RTOS.
  • MQTT: {start/stop/query the state of} a connection between Fuzzy RTOS and its MQTT broker. Optionally connect to another broker via the bridging feature of MQTT.
  • Drivers: {start/stop/query the state of} real-time robot control drivers.
  • Version: get the current version of Fuzzy RTOS.
  • License: {activate/query the state of} the Fuzzy RTOS license.
  • Jog: send jogging commands (cartesian or joints, position or velocity)
  • Trajectory: generate trajectories from a list of waypoints, play, pause, rewind, etc..
  • I/O: read/write I/Os from the robot controller. ⚠️ Warning: I/O support is currently in beta mode.

User-friendly interface

We provide a webpage with the full list of services and pre-filled queries over at:

http://fuzzy-rtos-address:8000/swagger/ui

MQTT API

What is MQTT

From https://mqtt.org/

MQTT is an OASIS standard messaging protocol for the Internet of Things (IoT). It is designed as an extremely lightweight publish/subscribe messaging transport that is ideal for connecting remote devices with a small code footprint and minimal network bandwidth. MQTT today is used in a wide variety of industries, such as automotive, manufacturing, telecommunications, oil and gas, etc.

Purpose

We use MQTT for fast data transfer between hosts. It becomes easy to send periodic payloads with little overhead/latency. Fuzzy RTOS is packaged with a MQTT broker that listens for connections on port 1885. It is possible to bridge it to Fuzzy Studio's broker running on your computer on port 1883.

Message formatting

We use protobuf internally but transmit data in clear text as a JSON string.

See https://googleapis.dev/python/protobuf/latest/google/protobuf/json_format.html for the protobuf to json documentation. Similar functions exist for other programming languages.

Topics - outputs

Click to see a list of outbound topics
  • system_state (protobuf type SystemState) describes the global state of the active driver.
  • trajectory_state (protobuf type TrajectoryState) describes the state of the current trajectory.
  • path_preview (protobuf type PathPreview) is emitted after a new trajectory becomes active.
  • trajectory_generator_state (protobuf type TrajectoryGeneratorState) describes the state of the trajectory generator and gives a history of previous generations.
  • version is a basic string containing the Fuzzy RTOS version.

Topics - inputs

Click to see a list of inbound topics
  • /fuzzy_studio/tool_command
    • Protobuf type: ToolCmd
    • Set the tool used by Fuzzy RTOS.
  • /fuzzy_studio/operational_switch_command
    • Protobuf type: OperationalSwitchCmd
    • Switch between T1 (slow mode, 250mm/s) and T2 (fast mode, full speed)
  • /fuzzy_studio/trajectory_player_command
    • Protobuf type: TrajectoryPlayerCmd
    • Poorly named; Send various actions to Fuzzy RTOS (enable jogging mode, stop, play trajectory…)
  • Jogging commands
    • /fuzzy_studio/joint_position_jogging_command
      • Protobuf type: JointPositionJoggingCmd
      • Send joint position jogging commands.
    • /fuzzy_studio/joint_velocity_jogging_command
      • Protobuf type: JointVelocityJoggingCmd
      • Send joint velocity jogging commands.
    • /fuzzy_studio/cartesian_pose_jogging_command
      • Protobuf type: CartesianPoseJoggingCmd
      • Send cartesian pose jogging commands.
    • /fuzzy_studio/cartesian_velocity_jogging_command
      • Protobuf type: CartesianVelocityJoggingCmd
      • Send cartesian velocity jogging commands.
  • Trajectory commands
    • /fuzzy_studio/trajectory_generation_command
      • Protobuf type: TrajectoryGenerationCmd
      • Send a list of waypoints to the trajectory generator.
    • /fuzzy_studio/trajectory_speed_override_command
      • Protobuf type: TrajectoryOverrideSpeedCmd
      • Add a time dilatation to the trajectory (i.e. 0.5 will make the trajectory 2x slower).

Raw socket

For a more direct link between Fuzzy RTOS and custom applications, we also provide an UDP socket interface. By default, it listens for incoming protobuf messages formatted as a Any message (see the link for documentation and examples) on port 51218.

If Fuzzy RTOS is controlling a robot, it will stream a SystemState protobuf message to the sender of the last received message.