Studio Live

class Studio

Helper class to connect and visualize trajectories and events in Jacobi Studio.

class Action

An action that can be performed in Jacobi Studio, e.g. setting a robot to a specific joint position or adding an obstacle to the environment.

class Events(dict(list))

A container that maps a specific timing to one or multiple actions. The static methods of this class do not change the visualization in Jacobi Studio immediately, but only return an action that can be executed later (e.g. alongside a trajectory).

static set_joint_position(joint_position: Config, robot: Robot = None) Action

Returns an action that sets the joint position of the given robot, or the last active robot instead.

static set_item(obstacle: Obstacle | None, robot: Robot = None) Action

Returns an action that sets the item obstacle of the given robot, or the last active robot instead.

static set_material(material: str, robot: Robot = None) Action

Returns an action that sets the material of the given robot, or the last active robot instead.

static add_robot(robot: Robot) Action

Returns an action that adds the given robot to the environment.

static add_obstacle(obstacle: Obstacle) Action

Returns an action that adds the given obstacle to the environment.

static add_waypoint(point: Point) Action

Returns an action that adds the given waypoint to the environment.

static remove_obstacle(obstacle: Obstacle) Action

Returns an action that removes the given obstacle (by name) from the environment.

static set_camera_image_encoded(image: str, camera: Camera = None) Action

Returns an action that sets an image for a camera encoded as a string.

static set_camera_depth_map(depths: list[list[float]], x: float, y: float, camera: Camera = None) Action

Returns an action that sets the depth map visualization of a camera.

__init__()

Connects to Jacobi Studio automatically. Please make sure to enable the Studio Live feature in the Jacobi Studio settings.

speedup: float = 1.0

A factor to speed up or slow down running trajectories or events.

set_joint_position(joint_position: Config, robot: Robot = None)

Sets the joint position of the given robot, or the last active robot instead.

set_item(obstacle: Obstacle | None, robot: Robot = None)

Sets the item obstacle of the given robot, or the last active robot instead.

set_material(material: str, robot: Robot = None)

Sets the material of the given robot, or the last active robot instead.

add_robot(robot: Robot)

Adds the given robot to the environment.

add_obstacle(obstacle: Obstacle)

Adds the given obstacle to the environment.

add_waypoint(point: Point)

Adds the given waypoint to the environment.

remove_obstacle(obstacle: Obstacle)

Removes the given obstacle (by name) from the environment.

set_camera_image_encoded(image: str, camera: Camera = None)

Sets an image for a camera encoded as a string.

set_camera_depth_map(depths: list[list[float]], x: float, y: float, camera: Camera = None)

Sets the depth map visualization of a camera.

run_action(action: Action)

Run the given action in Jacobi Studio.

run_trajectory(trajectory: Trajectory, events: Events = {}, loop_forever=False, robot: Robot = None)

Runs a trajectory for the given robot (or the last active robot) in Jacobi Studio, alongside the events at the specified timings. Optionally, the visualization can be looped.

run_events(events: Events)

Run the events at the specified timings in Jacobi Studio.

reset()

Resets the environment to the state before a trajectory or events were run. In particular, it removes all obstacles there were added dynamically.

get_joint_position(robot: Robot = None) Config

Return the current joint position of the given or only robot.