Studio Live#

The Studio Live feature allows to communicate between the Jacobi motion library or Jacobi drivers (or any other C++ or Python code) and the Studio web-application. This way, we can visualize robot motions, object manipulation, or any other events easily!

Enable in Settings

First, you need to enable the Live feature inside the Studio settings. Then, an icon appears in the top navbar to indicate whether there is a live connection with the motion library. Currently, Studio Live is only supported in Chrome and Firefox.

Connect to Studio#

To connect the the Studio running in the browser, just create a Studio object.

from jacobi import Studio

studio = Studio()

The studio class has a speedup parameter (default is 1.0) that helps to quickly visualize all motions at a glance.

Run a Trajectory#

Assuming we have a planned trajectory, we can let Studio visualize the motion by running

studio.run_trajectory(trajectory)

Of course, you would need at least one robot with the matching degrees of freedom defined in your Studio project. In case you have multiple robots, you can also specify the robot which should execute the trajectory. Studio Live matches the robots in Studio and your local code based on the robot name - so make sure that they are equal if needed.

studio.run_trajectory(trajectory, loop_forever=True, robot=robot)

Moreover, you can repeat the trajectory in a loop.

Other Actions#

Studio Live supports a range of actions to visualize object manipulation:

studio.set_joint_position([0.5, 0.2, -0.3, 0.2, 0.2, 0.5])  # Sets the current joint position of the robot
studio.set_item(Box(0.3, 0.3, 0.3))  # Set the current item obstacle of the robot

obstacle = Obstacle(
    Box(0.5, 0.2, 0.2),  # [m]
    origin=Frame.from_translation(0, 0.4, 0.6),  # [m]
    color='0044aa',  # Color in #hex format
)
studio.add_obstacle(obstacle)
studio.remove_obstacle(obstacle)

studio.reset()  # Removes all dynamically added obstacles

Every action specific to a robot (e.g. set_joint_position or set_item) can also take a robot input parameter similar to run_trajectory.

Events alongside a Trajectory#

Oftentimes, it is useful to run actions at a specific time during a trajectory. For this, you can create an Events collection that maps times to actions.

events = Studio.Events()

events[0.0] = Studio.Events.set_item(object_to_grasp)  # Set the robot's item obstacle at [s]
events[trajectory.duration] = Studio.Events.set_item(None)  # Remove the robot's item obstacle at [s]

Similarly, you can define events for all other actions above. You can then run these events either alongside a trajectory

studio.run_trajectory(trajectory, events)

or also indenpendently via

studio.run_events(events)