Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F78364421
OncillaL1L2.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Aug 20, 05:31
Size
2 KB
Mime Type
text/x-c++
Expires
Thu, Aug 22, 05:31 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20033796
Attached To
R6622 liboncilla
OncillaL1L2.h
View Options
#pragma once
#include <tr1/memory>
#include <rci/dto/JointAngles.h>
#include <rci/ResourceNode.h>
#include <rci/Controlled.h>
#include <rci/Sensing.h>
#include "OncillaSynchronizer.h"
namespace
rci
{
namespace
oncilla
{
class
OncillaL1L2
;
typedef
std
::
tr1
::
shared_ptr
<
OncillaL1L2
>
OncillaL1Ptr
;
typedef
std
::
tr1
::
shared_ptr
<
OncillaL1L2
>
OncillaL2Ptr
;
/**
* Node class, representing the hip node of the quadruped robot.
*
* @todo In case of simulation, this node can also sense the power consumption.
*/
class
OncillaL1L2
:
public
rci
::
ResourceNode
,
public
rci
::
Controlled
,
public
rci
::
Sensing
,
public
rci
::
PositionControlled
,
public
rci
::
PositionSensing
,
// Two encoder values
public
rci
::
VelocityControlled
,
public
rci
::
TorqueControlled
,
public
rci
::
ImpedanceControlled
{
public:
const
static
unsigned
int
MotorAxisIndex
=
0
;
const
static
unsigned
int
MagneticEncoderIndex
=
1
;
/**
* Special constructor to also link to webots
*/
OncillaL1L2
(
OncillaSynchronizer
&
s
,
const
std
::
string
&
name
=
"Oncilla Hip"
);
virtual
~
OncillaL1L2
();
/**
* Returns, if controller is converged.
* @return True, if controller is converged after last command.
*/
bool
isConverged
()
const
;
/**
* Commanding a joint position.
* @param position Position command
* @return Return, if successfull. (e.g. not exceeding joint limits)
* @todo Check for correct control mode
*/
bool
setJointPosition
(
JointAnglesPtr
position
);
void
unsafeSetCommand
(
double
value
);
double
unsafeGetCommand
()
const
;
/**
* Returns current joint position.
* @return Current joint position
*/
virtual
JointAnglesPtr
getJointPosition
()
const
;
double
unsafeGetMotorAxisPosition
()
const
;
double
unsafeGetMagneticEncoderPosition
()
const
;
void
unsafeUpdateMotorAxisPosition
(
double
value
);
void
unsafeUpdateMagneticEncoderPosition
(
double
value
);
/**
* Commanding a joint velocity.
* @param position Position command
* @return Return, if successfull. (e.g. not exceeding joint limits)
* @todo Check for correct control mode
*/
virtual
bool
setJointVelocity
(
rci
::
JointVelocitiesPtr
vel
);
/**
* Returns current joint torque.
* @return Current joint torque
*/
virtual
bool
setJointTorque
(
JointTorquesPtr
torque
);
/**
* Returns current joint torque.
* @return Current joint torque
*/
virtual
bool
setJointImpedance
(
JointImpedancePtr
imped
);
/**
* Returns latest position command. Note, that this is the latest valid
* commanded position. If the position command exceeds limits and is
* therefore rejected, it ..
*/
virtual
JointAnglesPtr
getLastPositionCommand
()
const
;
/**
* Print
*/
std
::
string
print
()
const
;
private:
/**
* Reference to OncillaSynchronizer
* @todo This is a dangerous reference which will become invalid as soon as
* OncillaSynchronizer gets deleted outside.
*/
OncillaSynchronizer
&
synchronizer
;
};
}
}
Event Timeline
Log In to Comment