Tekkotsu Homepage
Dev. Resources

ERS7Info.h File Reference

Defines RobotInfo namespace for ERS-7 models, gives some information about the robot's capabilities, such as joint counts, offsets, names and PID values. More...

#include "Shared/CommonERSInfo.h"
Include dependency graph for ERS7Info.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


class  ERS7Info::ERS7Capabilities
 provides polymorphic robot capability detection/mapping More...


namespace  ERS7Info

Contains information about the ERS-7 Robot, such as number of joints, PID defaults, timing information, etc.


#define RAD(deg)   (((deg) * (float)M_PI ) / 180.0f)
 Just a little macro for converting degrees to radians.
#define __RI_RAD_FLAG
 a flag so we undef these after we're done - do you have a cleaner solution?


const char *const ERS7Info::TargetName = "ERS-7"
 the name of the model, to be used for logging and remote GUIs
const unsigned int ERS7Info::FrameTime = 8
 time between frames in the motion system (milliseconds)
const unsigned int ERS7Info::NumFrames = 4
 the number of frames per buffer (don't forget also double buffered)
const unsigned int ERS7Info::SlowFrameTime = 8
 time between frames for the ears (ERS-7 doesn't seem to have any "slow" joints; this only applied for the ears on the ERS-210)
const unsigned int ERS7Info::NumSlowFrames = 4
 the number of frames per buffer being sent to ears (double buffered as well)
const unsigned int ERS7Info::SoundBufferTime = 32
 the number of milliseconds per sound buffer... I'm not sure if this can be changed
const fmat::Column< 3 > ERS7Info::AgentBoundingBoxBaseFrameOffset = fmat::pack(0,0,0)
 Offset needed so that the centroid of the robot is correct relative to the bounding box.
const fmat::Column< 3 > ERS7Info::AgentBoundingBoxHalfDims = fmat::pack(304.8/2, 304.8/2, 0)
 Half of the length, width, and height of the robot.
const char *const ERS7Info::outputNames [NumReferenceFrames+1]
 Names for each of the outputs.
const ERS7Capabilities ERS7Info::capabilities
 allocation declared in RobotInfo.cc
const char *const ERS7Info::PrimitiveName [NumOutputs]
 the joint identifier strings used to refer to specific joints in OPEN-R (but not needed for others)
const char *const ERS7Info::SpeakerLocator = "PRM:/s1-Speaker:S1"
 use to open speaker connection with the system
const char *const ERS7Info::CameraLocator = "PRM:/r1/c1/c2/c3/i1-FbkImageSensor:F1"
 use to open camera connection with the system
const float ERS7Info::DefaultPIDs [NumPIDJoints][3]
 This table holds the default PID values for each joint. see PIDMC.
const unsigned char ERS7Info::DefaultPIDShifts [3] = {0x0E, 0x02-1, 0x0F-3}
 These will control the shift values given to the system. see PIDMC.
const float ERS7Info::MaxOutputSpeed [NumOutputs]
 These values are Sony's recommended maximum joint velocities, in rad/ms.
const float ERS7Info::outputRanges [NumOutputs][2]
 This table holds the software limits of each of the outputs, first index is the output offset, second index is MinMaxRange_t (i.e. MinRange or MaxRange).
const float ERS7Info::mechanicalLimits [NumOutputs][2]
 This table holds the mechanical limits of each of the outputs, first index is the output offset, second index is MinMaxRange_t (i.e. MinRange or MaxRange).
Output Types Information

Corresponds to entries in ERS7Info::PrimitiveName, defined at the end of this file, these are the primary grouping

Right now all binary joints are slow, but perhaps this won't always be the case... hence the IsFast/Slow bitmasks to select which type, in order to be more general

const unsigned ERS7Info::NumWheels = 0
 no wheels, just legs
const unsigned ERS7Info::JointsPerArm = 0
 no arms, just legs
const unsigned ERS7Info::NumArms = 0
 no arms, just legs
const unsigned ERS7Info::NumArmJoints = JointsPerArm*NumArms
 no wheels, just legs
const unsigned ERS7Info::JointsPerLeg = 3
 The number of joints per leg.
const unsigned ERS7Info::NumLegs = 4
 The number of legs.
const unsigned ERS7Info::NumLegJoints = JointsPerLeg*NumLegs
 the TOTAL number of joints on ALL legs
const unsigned ERS7Info::NumHeadJoints = 3
 The number of joints in the neck.
const unsigned ERS7Info::NumTailJoints = 2
 The number of joints assigned to the tail.
const unsigned ERS7Info::NumMouthJoints = 1
 the number of joints that control the mouth
const unsigned ERS7Info::NumEarJoints = 2
 The number of joints which control the ears (NOT per ear, is total).
const unsigned ERS7Info::NumButtons = 2+4+3+1
 the number of buttons that are available, 2 head, 4 paws, 3 back, 1 underbelly see ERS7Info::ButtonOffset_t
const unsigned ERS7Info::NumSensors = 3+3+5
 3 IR (distance), 3 accel (force), 5 from power, see ERS7Info::SensorOffset_t
const unsigned ERS7Info::NumLEDs = 27
 The number of LEDs which can be controlled.
const unsigned ERS7Info::NumFacePanelLEDs = 14
 The number of face panel LEDs.
const unsigned ERS7Info::NumPIDJoints = NumLegJoints+NumHeadJoints+NumTailJoints+NumMouthJoints
 The number of joints which use PID motion - everything except ears.
const unsigned ERS7Info::NumBinJoints = NumEarJoints
 The number of binary joints - just the ears.
const unsigned ERS7Info::NumOutputs = NumPIDJoints + NumBinJoints + NumLEDs
 the total number of outputs
const unsigned ERS7Info::NumReferenceFrames = NumOutputs + 1 + NumLegs + 1 + 3
 for the base, paws (NumLegs), camera, and IR sensors (3) reference frames
const float ERS7Info::CameraHorizFOV = 56.9f/180*static_cast<float>(M_PI)
 horizontal field of view (radians)
const float ERS7Info::CameraVertFOV = 45.2f/180*static_cast<float>(M_PI)
 vertical field of view (radians)
const float ERS7Info::CameraFOV = CameraHorizFOV
 should be set to maximum of CameraHorizFOV or CameraVertFOV
const unsigned int ERS7Info::CameraResolutionX = 208
 the number of pixels available in the 'full' layer
const unsigned int ERS7Info::CameraResolutionY = 160
 the number of pixels available in the 'full' layer
const char ERS7Info::CameraModelName [] = "ERS-7-Camera"
 specifies a name of the camera to load calibration parameters into RobotInfo::CameraHomography
const float ERS7Info::BallOfFootRadius = 23.433f/2
 radius of the ball of the foot
const bool ERS7Info::IsFastOutput [NumOutputs]
 true for joints which can be updated every 32 ms (all joints on ERS-7)

Values defined by OPEN-R, used to interface with lower level OPEN-R code to read sensors - values don't correspond to order of ERS7Info::PrimitiveName

const int ERS7Info::CPCJointMouth = 0
const int ERS7Info::CPCSwitchChin = 1
 Chin sensor.
const int ERS7Info::CPCJointNeckNod = 2
 Neck tilt2.
const int ERS7Info::CPCSensorHead = 3
 Head sensor.
const int ERS7Info::CPCSensorNearPSD = 4
 Head distance sensor(near).
const int ERS7Info::CPCSensorFarPSD = 5
 Head distance sensor(far).
const int ERS7Info::CPCJointNeckPan = 6
 Neck pan.
const int ERS7Info::CPCJointNeckTilt = 7
 Neck tilt1.
const int ERS7Info::CPCSwitchLFPaw = 8
 Left fore leg paw sensor.
const int ERS7Info::CPCJointLFKnee = 9
 Left fore legJ3.
const int ERS7Info::CPCJointLFElevator = 10
 Left fore legJ2.
const int ERS7Info::CPCJointLFRotator = 11
 Left fore legJ1.
const int ERS7Info::CPCSwitchLHPaw = 12
 Left hind leg paw sensor.
const int ERS7Info::CPCJointLHKnee = 13
 Left hind legJ3.
const int ERS7Info::CPCJointLHElevator = 14
 Left hind legJ2.
const int ERS7Info::CPCJointLHRotator = 15
 Left hind legJ1.
const int ERS7Info::CPCSwitchRFPaw = 16
 Right fore leg paw sensor.
const int ERS7Info::CPCJointRFKnee = 17
 Right fore legJ3.
const int ERS7Info::CPCJointRFElevator = 18
 Right fore legJ2.
const int ERS7Info::CPCJointRFRotator = 19
 Right fore legJ1.
const int ERS7Info::CPCSwitchRHPaw = 20
 Right hind leg paw sensor.
const int ERS7Info::CPCJointRHKnee = 21
 Right hind legJ3.
const int ERS7Info::CPCJointRHElevator = 22
 Right hind legJ2.
const int ERS7Info::CPCJointRHRotator = 23
 Right hind legJ1.
const int ERS7Info::CPCJointTailTilt = 24
 Tail tilt.
const int ERS7Info::CPCJointTailPan = 25
 Tail pan.
const int ERS7Info::CPCSensorAccelFB = 26
 Acceleration sensor(front-back).
const int ERS7Info::CPCSensorAccelLR = 27
 Acceleration sensor(right-left).
const int ERS7Info::CPCSensorAccelUD = 28
 Acceleration sensor(up-down).
const int ERS7Info::CPCSensorChestPSD = 29
 Chest distance sensor.
const int ERS7Info::CPCSwitchWireless = 30
 Wireless LAN switch.
const int ERS7Info::CPCSensorBackRear = 31
 Back sensor(rear).
const int ERS7Info::CPCSensorBackMiddle = 32
 Back sensor(middle).
const int ERS7Info::CPCSensorBackFront = 33
 Back sensor(front).

Output Offsets

Corresponds to entries in ERS7Info::PrimitiveName, defined at the end of this file

enum  ERS7Info::LegOrder_t { ERS7Info::LFrLegOrder = 0, ERS7Info::RFrLegOrder, ERS7Info::LBkLegOrder, ERS7Info::RBkLegOrder }

the ordering of legs

enum  ERS7Info::REKOffset_t { ERS7Info::RotatorOffset = 0, ERS7Info::ElevatorOffset, ERS7Info::KneeOffset }

The offsets within appendages (the legs) Note that the ordering matches the actual physical ordering of joints on the appendage (and not that of the head's TPROffset_t's).

enum  ERS7Info::TPROffset_t { ERS7Info::TiltOffset = 0, ERS7Info::PanOffset, ERS7Info::RollOffset, ERS7Info::NodOffset = RollOffset }

The offsets of appendages with tilt (elevation), pan (heading), and roll or nod joints (i.e. head) Note that the ordering matches the actual physical ordering of joints on the appendage (and not that of the leg's REKOffset_t's).

enum  ERS7Info::LegOffset_t { ERS7Info::LFrLegOffset = LegOffset+LFrLegOrder*JointsPerLeg, ERS7Info::RFrLegOffset = LegOffset+RFrLegOrder*JointsPerLeg, ERS7Info::LBkLegOffset = LegOffset+LBkLegOrder*JointsPerLeg, ERS7Info::RBkLegOffset = LegOffset+RBkLegOrder*JointsPerLeg }

The offsets of the individual legs, add REKOffset_t value to access specific joint.

enum  ERS7Info::LEDOffset_t {
  ERS7Info::HeadColorLEDOffset = LEDOffset, ERS7Info::HeadWhiteLEDOffset, ERS7Info::ModeRedLEDOffset, ERS7Info::ModeGreenLEDOffset,
  ERS7Info::ModeBlueLEDOffset, ERS7Info::WirelessLEDOffset, ERS7Info::FaceLEDPanelOffset, ERS7Info::FrBackColorLEDOffset = FaceLEDPanelOffset+NumFacePanelLEDs,
  ERS7Info::FrBackWhiteLEDOffset, ERS7Info::MdBackColorLEDOffset, ERS7Info::MdBackWhiteLEDOffset, ERS7Info::RrBackColorLEDOffset,
  ERS7Info::RrBackWhiteLEDOffset, ERS7Info::LEDABModeOffset, ERS7Info::BotLLEDOffset = FaceLEDPanelOffset+1, ERS7Info::BotRLEDOffset = FaceLEDPanelOffset+0,
  ERS7Info::MidLLEDOffset = FaceLEDPanelOffset+3, ERS7Info::MidRLEDOffset = FaceLEDPanelOffset+2, ERS7Info::TopLLEDOffset = FaceLEDPanelOffset+7, ERS7Info::TopRLEDOffset = FaceLEDPanelOffset+6,
  ERS7Info::TopBrLEDOffset = HeadColorLEDOffset, ERS7Info::TlRedLEDOffset = RrBackColorLEDOffset, ERS7Info::TlBluLEDOffset = FrBackColorLEDOffset

The offsets of the individual LEDs on the head and tail. Note that left/right are robot's point of view. See also LEDBitMask_t.

const unsigned ERS7Info::PIDJointOffset = 0
 The beginning of the PID Joints.
const unsigned ERS7Info::LegOffset = PIDJointOffset
 the offset of the beginning of the leg joints, NumLegs of JointsPerLeg each, in LegOrder_t order; see LegOffset_t
const unsigned ERS7Info::HeadOffset = LegOffset+NumLegJoints
 the offset of the beginning of the head joints, add TPROffset_t to get specific joint
const unsigned ERS7Info::TailOffset = HeadOffset+NumHeadJoints
 the offset of the beginning of the tail joints, add TPROffset_t to get specific joint (except RollOffset not available)
const unsigned ERS7Info::MouthOffset = TailOffset+NumTailJoints
 the offset of the beginning of the mouth joint, is specific joint
const unsigned ERS7Info::LEDOffset = PIDJointOffset + NumPIDJoints
 the offset of LEDs in WorldState::outputs and MotionCommand functions, see LedOffset_t for specific offsets
const unsigned ERS7Info::BinJointOffset = LEDOffset + NumLEDs
 The beginning of the binary joints.
const unsigned ERS7Info::EarOffset = BinJointOffset
 the offset of the beginning of the ear joints - note that ears aren't sensed. They can be flicked by the environment and you won't know.
const unsigned ERS7Info::BaseFrameOffset = NumOutputs
 Use with kinematics to refer to base reference frame.
const unsigned ERS7Info::FootFrameOffset = BaseFrameOffset+1
 Use with kinematics to refer to paw reference frames (add appropriate LegOrder_t to specify which paw).
const unsigned ERS7Info::PawFrameOffset = FootFrameOffset
 Aibo-era alias for FootFrameOffset.
const unsigned ERS7Info::CameraFrameOffset = FootFrameOffset+NumLegs
 Use with kinematics to refer to camera reference frame.
const unsigned ERS7Info::NearIRFrameOffset = CameraFrameOffset+1
 Use with kinematics to refer to short-range infrared (distance) sensor reference frame.
const unsigned ERS7Info::IRFrameOffset = NearIRFrameOffset
 alias for the near IR sensor
const unsigned ERS7Info::FarIRFrameOffset = NearIRFrameOffset+1
 Use with kinematics to refer to long-range infrared (distance) sensor reference frame.
const unsigned ERS7Info::ChestIRFrameOffset = FarIRFrameOffset+1
 Use with kinematics to refer to chest-mounted infrared (distance) sensor reference frame.

Input Offsets

The order in which inputs should be stored

enum  ERS7Info::ButtonOffset_t {
  ERS7Info::LFrPawOffset = LFrLegOrder, ERS7Info::RFrPawOffset = RFrLegOrder, ERS7Info::LBkPawOffset = LBkLegOrder, ERS7Info::RBkPawOffset = RBkLegOrder,
  ERS7Info::ChinButOffset = 4, ERS7Info::HeadButOffset, ERS7Info::HeadFrButOffset = HeadButOffset, ERS7Info::FrontBackButOffset,
  ERS7Info::MiddleBackButOffset, ERS7Info::BackButOffset = MiddleBackButOffset, ERS7Info::RearBackButOffset, ERS7Info::WirelessSwOffset

holds offsets to different buttons in WorldState::buttons[]

enum  ERS7Info::SensorOffset_t {
  ERS7Info::NearIRDistOffset = 0, ERS7Info::IRDistOffset = NearIRDistOffset, ERS7Info::FarIRDistOffset, ERS7Info::ChestIRDistOffset,
  ERS7Info::BAccelOffset, ERS7Info::LAccelOffset, ERS7Info::DAccelOffset, ERS7Info::PowerRemainOffset,
  ERS7Info::PowerThermoOffset, ERS7Info::PowerCapacityOffset, ERS7Info::PowerVoltageOffset, ERS7Info::PowerCurrentOffset

holds offset to different sensor values in WorldState::sensors[]

const char *const ERS7Info::buttonNames [NumButtons]
 Provides a string name for each button.
const char *const ERS7Info::sensorNames [NumSensors]
 Provides a string name for each sensor.

LED Bitmasks

Bitmasks for use when specifying combinations of LEDs (see LedEngine ) Note that left/right are robot's point of view

typedef unsigned int ERS7Info::LEDBitMask_t
 So you can be clear when you're refering to a LED bitmask.
const LEDBitMask_t ERS7Info::HeadColorLEDMask = 1<<(HeadColorLEDOffset-LEDOffset)
 mask corresponding to HeadColorLEDOffset
const LEDBitMask_t ERS7Info::HeadWhiteLEDMask = 1<<(HeadWhiteLEDOffset-LEDOffset)
 mask corresponding to HeadWhiteLEDOffset
const LEDBitMask_t ERS7Info::ModeRedLEDMask = 1<<(ModeRedLEDOffset-LEDOffset)
 mask corresponding to ModeRedLEDOffset
const LEDBitMask_t ERS7Info::ModeGreenLEDMask = 1<<(ModeGreenLEDOffset-LEDOffset)
 mask corresponding to ModeGreenLEDOffset
const LEDBitMask_t ERS7Info::ModeBlueLEDMask = 1<<(ModeBlueLEDOffset-LEDOffset)
 mask corresponding to ModeBlueLEDOffset
const LEDBitMask_t ERS7Info::WirelessLEDMask = 1<<(WirelessLEDOffset-LEDOffset)
 mask corresponding to WirelessLEDOffset
const LEDBitMask_t ERS7Info::FaceLEDPanelMask = 1<<(FaceLEDPanelOffset-LEDOffset)
 mask corresponding to FaceLEDPanelOffset, selects only the first of the panel - shift this to get the others
const LEDBitMask_t ERS7Info::FrBackColorLEDMask = 1<<(FrBackColorLEDOffset-LEDOffset)
 mask corresponding to FrBackColorLEDOffset
const LEDBitMask_t ERS7Info::FrBackWhiteLEDMask = 1<<(FrBackWhiteLEDOffset-LEDOffset)
 mask corresponding to FrBackWhiteLEDOffset
const LEDBitMask_t ERS7Info::MdBackColorLEDMask = 1<<(MdBackColorLEDOffset-LEDOffset)
 mask corresponding to MdBackColorLEDOffset
const LEDBitMask_t ERS7Info::MdBackWhiteLEDMask = 1<<(MdBackWhiteLEDOffset-LEDOffset)
 mask corresponding to MdBackWhiteLEDOffset
const LEDBitMask_t ERS7Info::RrBackColorLEDMask = 1<<(RrBackColorLEDOffset-LEDOffset)
 mask corresponding to RrBackColorLEDOffset
const LEDBitMask_t ERS7Info::RrBackWhiteLEDMask = 1<<(RrBackWhiteLEDOffset-LEDOffset)
 mask corresponding to RrBackWhiteLEDOffset
const LEDBitMask_t ERS7Info::LEDABModeMask = 1<<(LEDABModeOffset-LEDOffset)
 mask corresponding to LEDABModeOffset
const LEDBitMask_t ERS7Info::BotLLEDMask = 1<<(BotLLEDOffset-LEDOffset)
 bottom left
const LEDBitMask_t ERS7Info::BotRLEDMask = 1<<(BotRLEDOffset-LEDOffset)
 bottom right
const LEDBitMask_t ERS7Info::MidLLEDMask = 1<<(MidLLEDOffset-LEDOffset)
 middle left
const LEDBitMask_t ERS7Info::MidRLEDMask = 1<<(MidRLEDOffset-LEDOffset)
 middle right
const LEDBitMask_t ERS7Info::TopLLEDMask = 1<<(TopLLEDOffset-LEDOffset)
 top left
const LEDBitMask_t ERS7Info::TopRLEDMask = 1<<(TopRLEDOffset-LEDOffset)
 top right
const LEDBitMask_t ERS7Info::TopBrLEDMask = 1<<(TopBrLEDOffset-LEDOffset)
 top bar
const LEDBitMask_t ERS7Info::TlRedLEDMask = 1<<(TlRedLEDOffset-LEDOffset)
 red tail light
const LEDBitMask_t ERS7Info::TlBluLEDMask = 1<<(TlBluLEDOffset-LEDOffset)
 blue tail light
const LEDBitMask_t ERS7Info::FaceLEDMask
 LEDs for the face panel (all FaceLEDPanelMask<<(0:NumFacePanelLEDs-1) entries).
const LEDBitMask_t ERS7Info::HeadLEDMask
 LEDs for face (all but back lights).
const LEDBitMask_t ERS7Info::BackLEDMask
 LEDS on the back.
const LEDBitMask_t ERS7Info::TailLEDMask = 0
 LEDs on tail (ERS-7 has none).
const LEDBitMask_t ERS7Info::AllLEDMask = (LEDBitMask_t)~0
 selects all of the leds

Detailed Description

Defines RobotInfo namespace for ERS-7 models, gives some information about the robot's capabilities, such as joint counts, offsets, names and PID values.

ejt (Creator)

Definition in file ERS7Info.h.

Define Documentation

#define __RI_RAD_FLAG

a flag so we undef these after we're done - do you have a cleaner solution?

Definition at line 552 of file ERS7Info.h.

#define RAD ( deg   )     (((deg) * (float)M_PI ) / 180.0f)

Just a little macro for converting degrees to radians.

Definition at line 550 of file ERS7Info.h.

Tekkotsu v5.1CVS
Generated Mon May 9 04:58:55 2016 by Doxygen 1.6.3