dcs.robot.ros_client
This module is a ROS client for ABB robot controller via compas_rrc.
DcsRosClient
A ROS client for ABB robot controller via compas_rrc.
This class provides an interface to connect, control, and communicate with an ABB robot controller using the compas_rrc library over ROS. It supports initialization and termination of the ROS client, digital/group/analog IO operations, and various robot movement commands.
Attributes:
Name | Type | Description |
---|---|---|
_ros |
Internal ROS client instance. |
|
_abb |
Internal ABB client instance. |
__init__()
Initialize the ROS client.
Creates a new DcsRosClient instance with uninitialized ROS and ABB client connections.
close_ros_client()
Close the ROS client and terminate the connection.
Properly closes the ROS client connection and terminates the ROS communication. Sends a disconnection message before closing.
get_analog_input(io_name)
Retrieve and display the value of an analog input from the robot controller.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
io_name
|
str
|
The name/identifier of the analog input to read. |
required |
Side Effects
Prints the current value of the specified analog input to the console.
get_analog_output(io_name, value)
Set the value of an analog output on the robot controller.
Note: Method name suggests 'get' but actually sets the analog output value.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
io_name
|
str
|
The name/identifier of the analog output signal. |
required |
value
|
int
|
The analog value to set. |
required |
get_digital_input(io_name)
Retrieve and display the value of a digital input from the robot controller.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
io_name
|
str
|
The name/identifier of the digital input signal to read. |
required |
Side Effects
Prints the current value of the specified digital input to the console.
get_group_input(io_name)
Retrieve and display the value of a group input from the robot controller.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
io_name
|
str
|
The name/identifier of the group input to read. |
required |
Side Effects
Prints the current value of the specified group input to the console.
get_robotarget()
Get the current robot target position and external axes.
Returns:
Name | Type | Description |
---|---|---|
tuple |
tuple
|
A tuple containing (frame, external_axes) representing the current robot position, or (None, None) if the request fails. |
get_workobject()
Get the currently active work object.
Raises:
Type | Description |
---|---|
NotImplementedError
|
This method is not yet implemented. |
init_ros_client()
Initialize the ROS client and establish connection to ABB robot.
Creates and starts the ROS client connection, then initializes the ABB client with the robot namespace '/rob1'. Sends a welcome message to confirm connection.
Raises:
Type | Description |
---|---|
Exception
|
If ROS connection fails or ABB client initialization fails. |
move_to_frame(frame, speed, zone)
Move the robot to a specified frame using linear motion.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
frame
|
The target frame/pose for the robot to move to. |
required | |
speed
|
int
|
Movement speed parameter. |
required |
zone
|
int
|
Zone parameter controlling path precision vs speed. |
required |
Side Effects
Sends movement command to robot and prints movement status.
move_to_joints(joints, external_axes, speed, zone)
Move the robot to specified joint positions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
joints
|
list
|
List of joint angles for robot axes. |
required |
external_axes
|
External axis positions (if applicable). |
required | |
speed
|
int
|
Movement speed parameter. |
required |
zone
|
int
|
Zone parameter controlling path precision vs speed. |
required |
Side Effects
Sends joint movement command to robot and prints movement status.
move_to_robotarget()
Move the robot to a robot target position.
Raises:
Type | Description |
---|---|
NotImplementedError
|
This method is not yet implemented. |
print_text(text)
Send text to be printed on the robot controller and console.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text
|
str
|
The text message to print. |
required |
Side Effects
Sends print command to robot controller and prints to local console.
set_acceleration(acc, ramp)
Set the robot's acceleration parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
acc
|
int
|
Acceleration value as percentage (%). |
required |
ramp
|
int
|
Ramp value as percentage (%). |
required |
set_digital_output(io_name, value)
Set the value of a digital output on the robot controller.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
io_name
|
str
|
The name/identifier of the digital output signal. |
required |
value
|
int
|
The value to set (typically 0 or 1 for digital signals). |
required |
set_group_output(io_name, value)
Set the value of a group output on the robot controller.
Group outputs allow setting multiple digital signals simultaneously.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
io_name
|
str
|
The name/identifier of the group output. |
required |
value
|
int
|
The integer value representing the group state. |
required |
set_max_speed(overide, max_tcp)
Set the robot's maximum speed parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
overide
|
int
|
Speed override value as percentage (%). |
required |
max_tcp
|
int
|
Maximum TCP (Tool Center Point) speed in mm/s. |
required |
set_move_zone(zone)
Set the movement zone parameter for robot motions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
zone
|
int
|
Zone parameter value. |
required |
Raises:
Type | Description |
---|---|
NotImplementedError
|
This method is not yet implemented. |
set_tool(tool_name)
Set the active tool for the robot.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tool_name
|
str
|
Name of the tool to activate. |
required |
Side Effects
Prints confirmation of tool change.
set_workobject(workobject)
Set the active work object coordinate system for the robot.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workobject
|
str
|
Name of the work object to activate. |
required |
Side Effects
Prints confirmation of work object change.
wait(time)
Make the robot wait for a specified duration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
time
|
int
|
Wait time duration (units depend on robot controller settings). |
required |