NimbRo ROS Soccer Package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nimbro_op_interface::RobotInterface Class Reference

Real robot interface. More...

#include <robotinterface.h>

Inherits HardwareInterface.

Inherited by nimbro_op_interface::DummyInterface.

Public Member Functions

 RobotInterface ()
 
virtual ~RobotInterface ()
 
virtual bool init (robotcontrol::RobotModel *model)
 
virtual void deinit ()
 
virtual boost::shared_ptr
< robotcontrol::Joint > 
createJoint (const std::string &name)
 
virtual bool sendJointTargets ()
 
virtual bool readJointStates ()
 
virtual bool setStiffness (float torque)
 
virtual void getDiagnostics (robotcontrol::DiagnosticsPtr ptr)
 

Protected Member Functions

virtual bool initCM730 ()
 
virtual int readFeedbackData (bool onlyTryCM730)
 
virtual bool syncWriteJointTargets (size_t numDevices, const uint8_t *data)
 
virtual bool syncWriteTorqueEnable (size_t numDevices, const uint8_t *data)
 
virtual bool syncWriteTorqueLimit (size_t numDevices, const uint8_t *data)
 
virtual bool useModel () const
 
struct
nimbro_op_interface::RobotInterface::CM730LedWriteData 
__attribute__ ((packed))
 
struct
nimbro_op_interface::RobotInterface::CM730BuzzerWriteData 
__attribute__ ((packed))
 
struct
nimbro_op_interface::RobotInterface::JointCmdSyncWriteData 
__attribute__ ((packed))
 
struct
nimbro_op_interface::RobotInterface::TorqueEnableSyncWriteData 
__attribute__ ((packed))
 
struct
nimbro_op_interface::RobotInterface::TorqueLimitSyncWriteData 
__attribute__ ((packed))
 
struct
nimbro_op_interface::RobotInterface::StatisticsReadData 
__attribute__ ((packed))
 

Protected Attributes

robotcontrol::RobotModel * m_model
 The robot model.
 
std::vector< cm730::BRData > m_servoData
 Bulk read buffer for servo feedback.
 
cm730::BRBoard m_boardData
 Bulk read buffer for CM730 feedback (e.g. IMU)
 
std::string m_robotNameStr
 Robot name.
 
std::string m_robotTypeStr
 Robot type.
 

Static Protected Attributes

static const double TICKS_PER_RAD = 2048.0 / M_PI
 
static const double FULL_TORQUE = 1023.0
 
static const double FULL_EFFORT = 32.0
 
static const double INT_TO_VOLTS = 0.1
 
static const double GYRO_SCALE = (M_PI / 180) * (2 * 250) / 65536
 
static const double ACC_SCALE = (2 * (4 * 9.81)) / 65536
 
static const double MAG_SCALE = 1 / 820.0
 

Detailed Description

Real robot interface.

Connects to a NimbRo-OP robot directly connected to the machine.

Parameters on the config_server (under the robotcontrol group):

Name Meaning
useModel Enable the servo model for command generation
effortSlopeLimit Maximum delta of the joint effort in a cycle
joints/X/type Actuator type of joint X
joints/X/id Address of joint X on the Dynamixel bus
joints/X/invert Invert the joint direction
offsets/X Offset (in servo ticks) of joint X

The RobotInterface also advertises a single service called read_offsets which resets the joint offsets so that the current measured robot pose becomes the zero pose. This is useful for initial calibration (with a relaxed robot) before fine-tuning the offsets.

Constructor & Destructor Documentation

nimbro_op_interface::RobotInterface::RobotInterface ( )

RobotInterface constructor.

nimbro_op_interface::RobotInterface::~RobotInterface ( )
virtual

RobotInterface destructor.

Member Function Documentation

boost::shared_ptr< Joint > nimbro_op_interface::RobotInterface::createJoint ( const std::string &  name)
virtual

Factory method for DXLJoint structs.

void nimbro_op_interface::RobotInterface::deinit ( )
virtual

Deinitialisation function.

void nimbro_op_interface::RobotInterface::getDiagnostics ( robotcontrol::DiagnosticsPtr  diag)
virtual

Reports the battery voltage (mean of all servo voltages) and the maximum temperature measured in the statistics callback over all servos.

bool nimbro_op_interface::RobotInterface::init ( robotcontrol::RobotModel *  model)
virtual

Initialize the robot interface and connect to the robot. It is assumed that createJoint() has already been called for all our joints.

bool nimbro_op_interface::RobotInterface::readJointStates ( )
virtual

Read joint states and other data from the CM730.


The documentation for this class was generated from the following files: