Class TrajectoryPointInterface

Inheritance Relationships

Base Type

Class Documentation

class TrajectoryPointInterface : public urcl::control::ReverseInterface

The TrajectoryPointInterface class handles trajectory forwarding to the robot. Full trajectories are forwarded to the robot controller and are executed there.

Public Functions

TrajectoryPointInterface() = delete
TrajectoryPointInterface(uint32_t port)

Creates a TrajectoryPointInterface object including a TCPServer.

Parameters:

port – Port the Server is started on

virtual ~TrajectoryPointInterface() = default

Disconnects possible clients so the reverse interface object can be safely destroyed.

bool writeTrajectoryPoint(const vector6d_t *positions, const float goal_time, const float blend_radius, const bool cartesian)

Writes needed information to the robot to be read by the URScript program.

Parameters:
  • positions – A vector of joint or cartesian targets for the robot

  • goal_time – The goal time to reach the target

  • blend_radius – The radius to be used for blending between control points

  • cartesian – True, if the written point is specified in cartesian space, false if in joint space

Returns:

True, if the write was performed successfully, false otherwise.

bool writeTrajectoryPoint(const vector6d_t *positions, const float acceleration = 1.4, const float velocity = 1.05, const float goal_time = 0, const float blend_radius = 0, const bool cartesian = false)

Writes information for a robot motion to the robot to be read by the URScript program.

Parameters:
  • positions – A vector of joint or cartesian targets for the robot

  • acceleration – Joint acceleration of leading axis [rad/s^2] / tool acceleration [m/s^2] for Cartesian motions

  • velocity – Joint speed of leading axis [rad/s] / tool speed [m/s] for Cartesian motions

  • goal_time – The goal time to reach the target. When a non-zero goal time is specified, this has priority over speed and acceleration settings.

  • blend_radius – The radius to be used for blending between control points

  • cartesian – True, if the written point is specified in Cartesian space, false if in joint space

Returns:

True, if the write was performed successfully, false otherwise.

bool writeTrajectorySplinePoint(const vector6d_t *positions, const vector6d_t *velocities, const vector6d_t *accelerations, const float goal_time)

Writes needed information to the robot to be read by the URScript program including velocity and acceleration information. Depending on the information given the robot will do quadratic (positions only), cubic (positions and velocities) or quintic (positions, velocities and accelerations) interpolation.

Parameters:
  • positions – A vector of joint or Cartesian target positions for the robot.

  • velocities – A vector of joint or Cartesian target velocities for the robot.

  • accelerations – A vector of joint or Cartesian target accelerations for the robot.

  • goal_time – The goal time to reach the target point.

Returns:

True, if the write was performed successfully, false otherwise.

bool writeMotionPrimitive(const std::shared_ptr<control::MotionPrimitive> primitive)

Writes a motion primitive to the robot to be read by the URScript program.

Parameters:

primitive – A shared pointer to a motion primitive object. This can contain any motion primitive type that is supported. Currently, that is MoveJ, MoveL, MoveP and MoveC.

Returns:

True, if the write was performed successfully, false otherwise.

void setTrajectoryEndCallback(std::function<void(TrajectoryResult)> callback)
uint32_t addTrajectoryEndCallback(const std::function<void(TrajectoryResult)> &callback)
void removeTrajectoryEndCallback(const uint32_t callback_id)

Public Static Attributes

static const int32_t MULT_TIME = 1000
static const int MESSAGE_LENGTH = 21

Protected Functions

virtual void connectionCallback(const socket_t filedescriptor) override
virtual void disconnectionCallback(const socket_t filedescriptor) override
virtual void messageCallback(const socket_t filedescriptor, char *buffer, int nbytesrecv) override