Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92303363
OncillaHip.cpp
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, Nov 19, 05:58
Size
2 KB
Mime Type
text/x-c
Expires
Thu, Nov 21, 05:58 (2 d)
Engine
blob
Format
Raw Data
Handle
22417617
Attached To
R6622 liboncilla
OncillaHip.cpp
View Options
#include "OncillaHip.h"
using
namespace
std
;
namespace
cca
{
namespace
rci
{
namespace
driver
{
OncillaHipSagittal
::
OncillaHipSagittal
(
std
::
string
name
)
:
ResourceNode
(
name
),
Controlled
(),
Sensing
(),
PositionControlled
(),
PositionSensing
(),
TorqueControlled
(),
ImpedanceControlled
()
{
this
->
_dimension
=
2
;
// Two encoder values - should always be the same
}
bool
OncillaHipSagittal
::
isConverged
()
const
{
throw
std
::
runtime_error
(
"Not yet implemented."
);
}
bool
OncillaHipSagittal
::
setJointPosition
(
JointAnglesPtr
position
)
{
// Successfull
this
->
_lastCommandedPosition
=
position
;
return
true
;
}
JointAnglesPtr
OncillaHipSagittal
::
getJointPosition
()
const
{
return
this
->
_latestJointPosition
;
}
bool
OncillaHipSagittal
::
setJointVelocity
(
JointVelocitiesPtr
vel
)
{
throw
std
::
runtime_error
(
"Not yet implemented."
);
}
bool
OncillaHipSagittal
::
setJointTorque
(
JointTorquesPtr
torque
)
{
throw
std
::
runtime_error
(
"Not yet implemented."
);
}
bool
OncillaHipSagittal
::
setJointImpedance
(
JointImpedancePtr
imped
)
{
throw
std
::
runtime_error
(
"Not yet implemented."
);
}
JointAnglesPtr
OncillaHipSagittal
::
getLastPositionCommand
()
const
{
// TODO: The second part f this condition shouldn`t be necessary
if
(
this
->
_lastCommandedPosition
&&
this
->
_lastCommandedPosition
.
get
())
{
//std::cout << this->_lastCommandedPosition->print();
return
this
->
_lastCommandedPosition
;
}
// No command set yet. Returning current joint values instead
return
this
->
_latestJointPosition
;
}
OncillaHipSagittal
::~
OncillaHipSagittal
()
{
}
std
::
string
OncillaHipSagittal
::
print
()
const
{
ostringstream
outstream
(
ostringstream
::
out
);
outstream
.
precision
(
3
);
// Precision when printing double values
outstream
<<
"<Oncilla Hip>"
<<
endl
;
return
outstream
.
str
();
}
/** Oncilla Hip Transverse **/
OncillaHipTransverse
::
OncillaHipTransverse
(
std
::
string
name
)
:
ResourceNode
(
name
),
Controlled
(),
PositionControlled
()
{
}
bool
OncillaHipTransverse
::
isConverged
()
const
{
return
false
;
}
bool
OncillaHipTransverse
::
setJointPosition
(
JointAnglesPtr
position
)
{
// Successfull
this
->
_lastCommandedPosition
=
position
;
return
true
;
}
JointAnglesPtr
OncillaHipTransverse
::
getLastPositionCommand
()
const
{
// TODO: The second part f this condition shouldn`t be necessary
if
(
this
->
_lastCommandedPosition
&&
this
->
_lastCommandedPosition
.
get
())
{
//std::cout << this->_lastCommandedPosition->print();
return
this
->
_lastCommandedPosition
;
}
}
OncillaHipTransverse
::~
OncillaHipTransverse
()
{
}
std
::
string
OncillaHipTransverse
::
print
()
const
{
ostringstream
outstream
(
ostringstream
::
out
);
outstream
.
precision
(
3
);
// Precision when printing double values
outstream
<<
"<Oncilla Hip>"
<<
endl
;
return
outstream
.
str
();
}
}
}
}
Event Timeline
Log In to Comment