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 : public std::multimap<double, Action>

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 Action set_joint_position(const Config &joint_position, const std::shared_ptr<Robot> robot = nullptr) const

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

static Action set_item(const std::optional<Obstacle> &obstacle, const std::shared_ptr<Robot> robot = nullptr) const

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

static Action set_material(const std::string &material, const std::shared_ptr<Robot> robot = nullptr) const

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

static Action add_robot(const std::shared_ptr<Robot> &robot) const

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

static Action add_obstacle(const Obstacle &obstacle) const

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

static Action add_waypoint(const Point &point) const

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

static Action remove_obstacle(const Obstacle &obstacle) const

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

Studio()

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

double speedup = 1.0

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

void set_joint_position(const Config &joint_position, const std::shared_ptr<Robot> robot = nullptr) const

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

void set_item(const std::optional<Obstacle> &obstacle, const std::shared_ptr<Robot> robot = nullptr) const

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

void set_material(const std::string &material, const std::shared_ptr<Robot> robot = nullptr) const

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

void add_robot(const std::shared_ptr<Robot> &robot) const

Adds the given robot to the environment.

void add_obstacle(const Obstacle &obstacle) const

Adds the given obstacle to the environment.

void add_waypoint(const Point &point) const

Adds the given point to the environment.

void remove_obstacle(const Obstacle &obstacle) const

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

void run_action(const Action &action) const

Run the given action in Jacobi Studio.

void run_trajectory(const Trajectory &trajectory, const Events &events = {}, bool loop_forever = false, const std::shared_ptr<Robot> robot = nullptr) const

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.

void run_events(const Events &events) const

Run the events at the specified timings in Jacobi Studio.

void reset() const

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

Config get_joint_position(const std::shared_ptr<Robot> robot = nullptr)

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