Struct robot_fingers::NJointBlmcRobotDriver::Config

struct Config

Configuration of the robot that can be changed by the user.

Public Types

typedef std::array<std::string, N_MOTOR_BOARDS> CanPortArray
typedef std::array<std::string, N_MOTOR_BOARDS> CanPortArray

Public Functions

bool is_within_hard_position_limits(const Vector &position) const

Check if the given position is within the hard limits.

Parameters:

position – Joint positions.

Returns:

True if hard_position_limits_lower <= position <= hard_position_limits_upper.

void print() const

Print the given configuration in a human-readable way.

bool is_within_hard_position_limits(const Vector &position) const

Check if the given position is within the hard limits.

Parameters:

position – Joint positions.

Returns:

True if hard_position_limits_lower <= position <= hard_position_limits_upper.

void print() const

Print the given configuration in a human-readable way.

Public Members

CanPortArray can_ports

List of CAN port names used by the robot.

For each motor control board used by the robot, this specifies the CAN port through which it is connected.

Example: {"can0", "can1"}

double max_current_A = 0.0

Maximum current that can be sent to the motor [A].

bool has_endstop = false

Whether the joints have physical end stops or not.

This is for example relevant for homing, where (in case this value is set to true) all joints move until they hit the end stop to determine their absolute position.

Note that not having end stops does not mean that the joint can rotate freely in general.

HomingMethod homing_method = HomingMethod::NONE

Which method to use for homing.

struct robot_fingers::NJointBlmcRobotDriver<Observation, N_JOINTS, N_MOTOR_BOARDS>::Config::CalibrationParameters calibration
double move_to_position_tolerance_rad = 0.0

Tolerance for reaching the target with NJointBlmcRobotDriver::move_to_position.

Vector safety_kd = Vector::Constant(0.1)

D-gain to dampen velocity. Set to zero to disable damping.

struct robot_fingers::NJointBlmcRobotDriver<Observation, N_JOINTS, N_MOTOR_BOARDS>::Config::PositionControlGains position_control_gains
Vector hard_position_limits_lower = Vector::Zero()

Hard lower limits for joint position.

Exceeding this limit results in an error and robot shutdown.

Vector hard_position_limits_upper = Vector::Zero()

Hard upper limits for joint position.

Exceeding this limit results in an error and robot shutdown.

Vector soft_position_limits_lower = Vector::Constant(-std::numeric_limits<double>::infinity())

Soft lower limits for joint position.

Exceeding this limit results in the action being adjusted to move the joint back inside the limits.

Vector soft_position_limits_upper = Vector::Constant(std::numeric_limits<double>::infinity())

Soft upper limits for joint position.

Exceeding this limit results in the action being adjusted to move the joint back inside the limits.

Vector home_offset_rad = Vector::Zero()

Offset between home position and zero.

Vector initial_position_rad = Vector::Zero()

Initial position to which the robot moves after initialization.

std::vector<TrajectoryStep> shutdown_trajectory

Trajectory which is executed in the shutdown method.

Use this to move the robot to a “rest position” during shutdown of the robot driver. It can consist of arbitrarily many steps. Leave it empty to not move during shutdown.

std::vector<std::string> run_duration_logfiles

List of file to which run duration logs are written.

You can specify multiple files here if you want to log the runtime of different independent components separately. For example on a robot with multiple manipulators, you can have a separate log for each manipulator, so if one of them is replaced, only the log file of this manipulator needs to be changed.

Public Static Functions

static Config load_config(const std::string &config_file_name)

Load driver configuration from file.

Load the configuration from the specified YAML file. The file is expected to have the same structure/key naming as the Config struct. If a value can not be read from the file, the application exists with an error message.

Parameters:

config_file_name – Path/name of the configuration YAML file.

Returns:

Configuration

static inline HomingMethod parse_homing_method_name(const std::string method_name)

Parse a homing method name.

Parameters:

method_name – Homing method name.

Throws:

std::invalid_argument – if the given string does not represent a valid homing method.

Returns:

The corresponding homing method.

static inline std::string get_homing_method_name(HomingMethod method)

Get the name of the specified homing method.

static Config load_config(const std::string &config_file_name)

Load driver configuration from file.

Load the configuration from the specified YAML file. The file is expected to have the same structure/key naming as the Config struct. If a value can not be read from the file, the application exists with an error message.

Parameters:

config_file_name – Path/name of the configuration YAML file.

Returns:

Configuration

static inline HomingMethod parse_homing_method_name(const std::string method_name)

Parse a homing method name.

Parameters:

method_name – Homing method name.

Throws:

std::invalid_argument – if the given string does not represent a valid homing method.

Returns:

The corresponding homing method.

static inline std::string get_homing_method_name(HomingMethod method)

Get the name of the specified homing method.

struct CalibrationParameters

Parameters related to calibration.

Public Members

Vector endstop_search_torques_Nm = Vector::Zero()

Torque that is used to find the end stop.

uint32_t move_steps = 0

Number of time steps for reaching the initial position.

struct PositionControlGains

Default control gains for the position PD controller.

Public Members

Vector kp = Vector::Zero()
Vector kd = Vector::Zero()
struct TrajectoryStep

A sub-goal of a trajectory.

Public Members

Vector target_position_rad = Vector::Zero()

Target position to which the joints should move.

uint32_t move_steps = 0

Number of time steps for reaching the target position.