RobotRaconteurCompanion.Util.RobotUtil
Utility class for to convert a com.robotraconteur.robotics.robot.RobotInfo structure to a general_robotics_toolbox.Robot object. The general_robotics_toolbox package contains functions for working with robot kinematics.
A simple example:
from RobotRaconteur.Client import *
from RobotRaconteurCompanion.Util.RobotUtil import RobotUtil
import general_robotics_toolbox as rox
c = RRN.ConnectService('rr+tcp://localhost:2356?service=robot')
robot_util = RobotUtil(client_obj=c)
# Read the robot info off the driver
robot_info = c.robot_info
# Convert to a general_robotics_toolbox.Robot object
robot = robot_util.robot_info_to_rox_robot(robot_info)
# Get the forward kinematics
T = rox.fwdkin(robot,[0,0,0,0,0,0])
RobotUtil
- class RobotRaconteurCompanion.Util.RobotUtil.RobotUtil(node=None, client_obj=None)
Utility class to convert a Robot Raconteur com.robotraconteur.robotics.robot.RobotInfo to a general_robotics_toolbox.Robot object.
The RobotInfo is provided by robot drivers and is used to describe the kinematics of the robot.
- Parameters:
node (RobotRaconteur.RobotRaconteurNode) – (optional) The Robot Raconteur node to use for parsing. Defaults to RobotRaconteurNode.s
client_obj (RobotRaconteur.ClientObject) – (optional) The client object to use for finding types. Defaults to None
- robot_info_to_rox_robot(robot_info, chain_number)
Convert a RobotInfo to a general_robotics_toolbox.Robot object
- Parameters:
robot_info (com.robotraconteur.robotics.robot.RobotInfo) – The RobotInfo to convert
chain_number (int) – The kinematic chain number to convert. For a single arm robot, this is 0. For a dual arm robot, this is 0 for the left arm and 1 for the right arm.
- Returns:
The converted robot
- Return type:
general_robotics_toolbox.Robot