Function urcl::robotTypeFromString

Function Documentation

RobotType urcl::robotTypeFromString(const std::string &robot_type_str)

Get the robot type from a string.

The RobotType enum has no dedicated entries for UR7 and UR12, so “ur7e” is mapped to RobotType::UR5 and “ur12e” is mapped to RobotType::UR10, matching what the robot reports over the primary interface.

Parameters:

robot_type_str – The string representation of the robot type as used in the start_ursim.sh script. Must be all lower-case, e.g. “ur3e”, “ur5”, “ur10e”, “ur16e”, “ur7e”, “ur15”, “ur30”, “ur8long”.

Throws:

std::invalid_argument – if robot_type_str does not match a known robot type.

Returns:

The robot type corresponding to the given string.