Example: Joint position streaming

This page contains a step by step guide to run the joint position streaming example. The example will:

  • Set up feedback messages and receiver to obtain the initial pose of the robot

  • Calculate a joint pose trajectory using the Ruckig package

  • Setup a UDP sender to send streaming messages to the controller

  • Publish the pre-calculated joint trajectory at the desired frequency

To find the example, please visit the RobCo GitLab: Joint Streaming Example

1. Setting up

The first step is to connect to the control unit, as explained in the getting started section.

Afterwards, open a browser and open RobFlow via the IP address, as obtained from the previous step. If this is the first connection to the robot, please set a password. Otherwise use the existing credentials to login.

After completing these two steps, you’ve defined:

  • username: The username used to login to RobFlow

  • password: The password used to login to RobFlow

  • robot-ip-robflow: The IP at which the Robot (specifically RobFlow) can be found

  • robot-ip-robcontrol: The IP at which the Robot (specifically RobControl) can be found, generally identical to robot-ip-robflow

  • robot-port-robcontrol: The port, at which RobControl expects streaming messages, generally fixed to 28000 (can only be adjusted by RobCo support if necessary)

2. Define receiving endpoint

The example needs to fetch the initial position from the feedback messages. Hence, the next step is to define where the controller should send the feedback messages. Depending on the connection mode chosen in 1. your host will either have a static or dynamic IP assigned for the respective network adapter.

The port at which feedback messages are received is free to chose. There should be no other traffic expected at the given port.

After completing this step, you’ve defined:

  • host-ip-feedback: The IP of the host that should receive the feedback messages

  • host-port-feedback: The Port at which the host should receive the feedback messages

3. Define streaming endpoint

The controller will only accept streaming messages from the IP defined in the start_streaming API message. Therefore, the IP of the host that sends the streaming message to the robot needs to be defined to run this example. Similar to the receiving endpoint, this IP depends on the chosen mode of connection. Generally, it will be identical to the host-ip-feedback defined above.

After completing this step, you’ve defined:

  • host-ip-streaming: The IP of the host that should receive the feedback messages

4. Define trajectory

Note

⚠️ This step is essential! Otherwise, there is a risk of damage to the robot and its surroundings!

Open the example script and edit the POSES variable. It should contain the joint poses in [deg] the robot should traverse.

It is suggested to use RobFlow to program a sequence of joint poses and ensure the sequence is safe to execute.

Make sure to also adapt the `N_JOINTS` variable to reflect the number of joints of the robot you are working with.

5. Run the example

After completing all steps above, everything is setup to run the example.

Download the RobFlow SDK and install according to the readme.

Note

⚠️ For the first tests, we suggest to:

  • Reduce the robot speed, by setting the DQ_FACTOR and DDQ_FACTOR to for example 0.2 (i.e. 20%)

  • Hold the emergency stop to be able to stop the robot from moving at any time

Again, before starting this example, please double check the defined trajectory from 4. is feasible and safe!

Also, before running the example, release the robot’s brakes via RobFlow.

Finally, the example can be run (inserting the respective arguments obtained in the steps above):

python -m streaming.examples.publisher_joint_values \
    --username my_user \
    --password my_password \
    --robot-ip-robflow 192.168.1.1 \
    --robot-port-robflow 80 \
    --host-ip-feedback 192.168.1.99 \
    --host-port-feedback 28001 \
    --robot-ip-robcontrol 192.168.1.1 \
    --robot-port-robcontrol 28000 \
    --host-ip-streaming 192.168.1.99

6. (Optional) Additional settings

In the “Settings” section of the example script, you’ll find several options to adapt the streaming mode for your use case. Please refer to the in-code documentation for information on what these parameters influence.

Worth mentioning are:

  • T_TRANSITION_STREAM: Pause in second between the user confirmation to start streaming and the first message being sent

  • VERBOSE: Enables printing debug information to the console

  • PLOT: Shows a plot of the joint trajectory prior to starting streaming