C++

class Result : public utils::ReturnCode
class Driver

Subclassed by jacobi::drivers::ABBDriver, jacobi::drivers::DoosanDriver, jacobi::drivers::FanucDriver, jacobi::drivers::SimulatedDriver, jacobi::drivers::UniversalDriver, jacobi::drivers::YaskawaDriver

Public Functions

virtual bool reconnect()

Connect to the robot, in particular after an external disconnection. Returns reconnection success.

virtual bool disconnect()

Disconnect from the robot. Returns disconnection success.

virtual bool is_connected() const

Is the robot currently connected?

virtual ControllerStatus get_controller_status()

Get current robot controller status (e.g. Ready/Idle, Alarm, Error, E-Stop etc.)

virtual Result enable()

Enable robot’s servos (if available).

virtual Result disable()

Disable robot’s servos (if available).

virtual Config get_current_joint_position()

Get and read current joint position.

virtual RobotState get_current_state() = 0

Get and read current robot state.

bool is_running() const

Is the robot currently running?

bool is_paused() const

Is the robot currently in a paused state?

void set_speed(double speed)

Set the driver’s speed scaling. A speed of zero corresponds to the paused state.

void set_speed(double speed, double duration)

Set the driver’s speed scaling gracefully, change it linearly within the duration. If the robot is not running, set the speed immediately.

double get_speed() const

Get the driver’s speed scaling.

bool pause()

Pause along the currently executed trajectory. Driver will be in paused state afterwards, except the motion did finish while pausing.

std::shared_future<bool> pause_async()

Pause along the currently executed trajectory. Driver will be in paused state afterwards, except the motion did finish while pausing.

virtual Result run(const Trajectory &trajectory)

Run a trajectory.

virtual std::shared_future<Result> run_async(const Trajectory &trajectory) = 0

Run a trajectory asynchronously.

virtual Result move_to(const ExactPoint &goal, bool ignore_collisions = false)

Move to an exact waypoint.

virtual std::shared_future<Result> move_to_async(const ExactPoint &goal, bool ignore_collisions = false) = 0

Move to an exact waypoint asynchronously.

virtual Result move_along(const std::string &motion_name, const std::optional<ExactPoint> &goal = std::nullopt, bool ignore_collisions = false)

Move along a pre-defined motion.

virtual std::shared_future<Result> move_along_async(const std::string &motion_name, const std::optional<ExactPoint> &goal = std::nullopt, bool ignore_collisions = false) = 0

Move along a pre-defined motion asynchronously.

virtual Result blend_into(const Trajectory &trajectory, double duration)

Blend into a trajectory.

Blend into the new trajectory from the current state, so that the robot will be on the given trajectory exactly after the duration time [s].

virtual std::shared_future<Result> blend_into_async(const Trajectory &trajectory, double duration) = 0

Blend into a trajectory asynchronously.

Blend into the new trajectory from the current state, so that the robot will be on the given trajectory exactly after the duration time [s].

virtual Result stop(bool fast_stop = true)

Stop a motion as fast as possible.

virtual std::shared_future<Result> stop_async(bool fast_stop = true) = 0

Stop a motion as fast as possible asynchronously.

virtual Result resume()

Resume a paused trajectory.

virtual std::shared_future<Result> resume_async() = 0

Resume a paused trajectory asynchronously.

void add_event(const Trigger &trigger, const Action &action)

Add an event depending on the robot’s state.

void create_io_alias(const std::string &name, size_t address)

Give I/O address an alias name.

virtual std::optional<int> get_digital_input(const std::string &name)

Read a digital input.

virtual bool set_digital_output(const std::string &name, int value)

Write to a digital output. Returns whether successful.

virtual std::optional<double> get_analog_input(const std::string &name)

Read a analog input.

virtual bool set_analog_output(const std::string &name, double value)

Write to a analog output. Returns whether successful.

virtual std::optional<int> get_group_input(const std::string &name)

Read a group input.

virtual bool set_group_output(const std::string &name, int value)

Write to a group output. Returns whether successful.

Public Members

const std::string host

The host address of the robot controller.

const int port

The port of the robot controller.

const size_t degrees_of_freedom

Degrees of freedom of the robot.

const double delta_time

Control interval of the robot’s driver.

double connect_timeout = {2.0}

Timeout for reconnecting to the robot.

double pausing_duration = {0.7}

Transition duration from and to paused state.

std::shared_ptr<jacobi::Studio> studio

The underlying connection to Jacobi Studio.

bool monitor_path_deviation = {true}

Monitor the path deviation between planned and executed trajectory.

bool log_motions = {false}

Whether to log motions.

class ABBDriver : public jacobi::drivers::Driver

Public Functions

explicit ABBDriver(std::shared_ptr<Planner> planner, int port)

Starts an ABB Robot Driver using an underlying EGM server at the specified port.

explicit ABBDriver(std::shared_ptr<Planner> planner, std::shared_ptr<Robot> robot, int port)

Starts an ABB Robot Driver for a specified robot using an underlying EGM server at the specified port.

explicit ABBDriver(std::shared_ptr<Planner> planner, const std::string &host, const RapidModule &module = RapidModule(), RobotWareVersion version = RobotWareVersion::RobotWare7)

Starts an ABB Robot Driver with an underyling RWS connection.

explicit ABBDriver(std::shared_ptr<Planner> planner, std::shared_ptr<Robot> robot, const std::string &host, const RapidModule &module = RapidModule(), RobotWareVersion version = RobotWareVersion::RobotWare7)

Starts an ABB Robot Driver for a specified robot with an underyling RWS connection.

explicit ABBDriver(std::shared_ptr<Planner> planner, const std::string &host, int port, const RapidModule &module = RapidModule(), RobotWareVersion version = RobotWareVersion::RobotWare7)

Starts an ABB Robot Driver with both an EGM server and an RWS connection.

explicit ABBDriver(std::shared_ptr<Planner> planner, std::shared_ptr<Robot> robot, const std::string &host, int port, const RapidModule &module = RapidModule(), RobotWareVersion version = RobotWareVersion::RobotWare7)

Starts an ABB Robot Driver for a specified robot with both an EGM server and an RWS connection.

virtual bool reconnect() override

Connect to the robot.

virtual bool disconnect() override

Disconnect from the robot.

virtual Result enable() override

Enable robot’s servos.

virtual Result disable() override

Disable robot’s servos.

~ABBDriver()

Deconnect all connections.

virtual Config get_current_joint_position() override

Get current joint position.

virtual RobotState get_current_state() override

Get current robot state.

virtual std::shared_future<Result> run_async(const Trajectory &trajectory) override

Run a trajectory.

virtual std::shared_future<Result> move_to_async(const ExactPoint &goal, bool ignore_collisions = false) override

Move to an exact waypoint.

virtual std::shared_future<Result> move_along_async(const std::string &motion_name, const std::optional<ExactPoint> &goal = std::nullopt, bool ignore_collisions = false) override

Move along a pre-defined motion.

virtual std::shared_future<Result> blend_into_async(const Trajectory &trajectory, double duration) override

Blend into trajectory.

virtual std::shared_future<Result> stop_async(bool fast_stop = true) override

Stop a motion as fast as possible.

virtual std::shared_future<Result> resume_async() override

Resume a paused trajectory.

virtual std::optional<int> get_digital_input(const std::string &name) override

Read a digital input.

virtual bool set_digital_output(const std::string &name, int value) override

Write to a digital output. Returns whether successful.

Public Members

double velocity_gain = {0.7}

Velocity gain parameter of the internal EGM control.

int external_axis_dof = {2}

Position of a possible block of external axis. Defaults to 2 for 7-dofs ABB arms.

std::shared_ptr<abb::RWS> rws

RWS Interface.

class SimulatedDriver : public jacobi::drivers::Driver

Public Functions

explicit SimulatedDriver(std::shared_ptr<Planner> planner, bool sync_with_studio = false, bool log_stream = false, bool keep_running = false, const std::string &host = "192.168.0.1", int port = 8000)

Create a UniversalDriver with planning capabilities (with move, stop, and safety monitoring)

~SimulatedDriver()

Deconnect all connections.

virtual bool reconnect() override

Connect to the robot.

virtual bool disconnect() override

Disconnect from the robot. Returns disconnection success.

virtual Result enable() override

Enable robot’s servos.

virtual Result disable() override

Disable robot’s servos.

virtual Config get_current_joint_position() override

Get current joint position.

void set_current_joint_position(const Config &joint_position)

Set the joint position.

virtual RobotState get_current_state() override

Get current robot state.

virtual std::shared_future<Result> run_async(const Trajectory &trajectory) override

Run a trajectory.

virtual std::shared_future<Result> move_to_async(const ExactPoint &goal, bool ignore_collisions = false) override

Move to an exact waypoint.

virtual std::shared_future<Result> move_along_async(const std::string &motion_name, const std::optional<ExactPoint> &goal = std::nullopt, bool ignore_collisions = false) override

Move along a pre-defined motion.

virtual std::shared_future<Result> blend_into_async(const Trajectory &trajectory, double duration) override

Blend into trajectory.

virtual std::shared_future<Result> stop_async(bool fast_stop = true) override

Stop a motion as fast as possible.

virtual std::shared_future<Result> resume_async() override

Resume a paused trajectory.

void create_io(const std::string &name, Signal::Value default_value)

Create a simulated I/O.

virtual std::optional<int> get_digital_input(const std::string &name) override

Read a digital input.

virtual bool set_digital_output(const std::string &name, int value) override

Write to a digital output. Returns whether successful.

Public Members

double time_speed = {1.0}

Simulated time speed for the control cycle (does not affect velocities and accelerations)

Controller controller

I/O controller.

Result run_result = {Result::Success}

Result of a motion.

Result enable_result = {Result::Success}

Result of enabling/disabling.

Public Static Attributes

static bool connect_result = {true}

Result of connecting (whether it’s successful)

class UniversalDriver : public jacobi::drivers::Driver

Public Functions

explicit UniversalDriver(std::shared_ptr<Planner> planner, const std::string &host)

Starts an Universal Robot Driver using RTDE.

explicit UniversalDriver(std::shared_ptr<Planner> planner, std::shared_ptr<Robot> robot, const std::string &host)

Starts an Universal Robot Driver using RTDE. Controls the given robot only.

~UniversalDriver()

Deconnect all connections.

virtual bool reconnect() override

Connect to the robot.

virtual bool disconnect() override

Disconnect from the robot.

virtual ControllerStatus get_controller_status() override

Get current robot controller status (e.g. Ready/Idle, Alarm, Error, E-Stop etc.)

virtual Result enable() override

Enable robot’s servos.

virtual Result disable() override

Disable robot’s servos.

virtual Config get_current_joint_position() override

Get current joint position.

virtual RobotState get_current_state() override

Get current robot state.

virtual std::shared_future<Result> run_async(const Trajectory &trajectory) override

Run a trajectory.

virtual std::shared_future<Result> move_to_async(const ExactPoint &goal, bool ignore_collisions = false) override

Move to an exact waypoint.

virtual std::shared_future<Result> move_along_async(const std::string &motion_name, const std::optional<ExactPoint> &goal = std::nullopt, bool ignore_collisions = false) override

Move along a pre-defined motion.

virtual std::shared_future<Result> blend_into_async(const Trajectory &trajectory, double duration) override

Blend into trajectory.

virtual std::shared_future<Result> stop_async(bool fast_stop = true) override

Stop a motion as fast as possible.

virtual std::shared_future<Result> resume_async() override

Resume a paused trajectory.

virtual std::optional<int> get_digital_input(const std::string &name) override

Read a digital input.

virtual bool set_digital_output(const std::string &name, int value) override

Write to a digital output. Returns whether successful.

virtual std::optional<double> get_analog_input(const std::string &name) override

Read a analog input.

virtual bool set_analog_output(const std::string &name, double value) override

Write to a analog output. Returns whether successful.

Public Members

double velocity_parameter = {0.0}

Velocity parameter of the internal UR control.

double acceleration_parameter = {0.0}

Acceleration parameter of the internal UR control.

double lookahead_time = {0.04}

Lookahead time parameter of the internal UR control.

double gain = {1600}

P-gain parameter of the internal UR control.

class YaskawaDriver : public jacobi::drivers::Driver

Public Functions

explicit YaskawaDriver(std::shared_ptr<Planner> planner, const std::string &host = "192.168.1.31", int port = 50240)

Starts an Yaskawa Robot Driver connecting to the MotoPlus application running on the robot controller.

explicit YaskawaDriver(std::shared_ptr<Planner> planner, std::shared_ptr<Robot> robot, const std::string &host = "192.168.1.31", int port = 50240)

Starts an Yaskawa Robot Driver connecting to the MotoPlus application running on the robot controller. Controls the given robot only.

~YaskawaDriver()

Deconnect all connections.

virtual bool reconnect() override

Connect to the robot.

virtual Result enable() override

Enable robot’s servos.

virtual Result disable() override

Disable robot’s servos.

void set_goal_timeout(int timeout)

Set the timeout for not reaching the goal state.

virtual Config get_current_joint_position() override

Get current joint position.

virtual RobotState get_current_state() override

Get current robot state.

virtual ControllerStatus get_controller_status() override

Get current robot controller status.

virtual std::shared_future<Result> run_async(const Trajectory &trajectory) override

Run a trajectory.

virtual std::shared_future<Result> move_to_async(const ExactPoint &goal, bool ignore_collisions = false) override

Move to an exact waypoint.

virtual std::shared_future<Result> move_along_async(const std::string &motion_name, const std::optional<ExactPoint> &goal = std::nullopt, bool ignore_collisions = false) override

Move along a pre-defined motion.

virtual std::shared_future<Result> blend_into_async(const Trajectory &trajectory, double duration) override

Blend into trajectory.

virtual std::shared_future<Result> stop_async(bool fast_stop = true) override

Stop a motion as fast as possible.

virtual std::shared_future<Result> resume_async() override

Resume a paused trajectory.

virtual std::optional<int> get_digital_input(const std::string &name) override

Read a digital input.

virtual bool set_digital_output(const std::string &name, int value) override

Write to a digital output. Returns whether successful.

virtual std::optional<int> get_group_input(const std::string &name) override

Read a group input.

virtual bool set_group_output(const std::string &name, int value) override

Write to a group output. Returns whether successful.

Public Members

std::vector<std::string> joint_names

Joint names of the robot.