Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F61361916
OncillaL01.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
Mon, May 6, 04:57
Size
2 KB
Mime Type
text/x-c
Expires
Wed, May 8, 04:57 (2 d)
Engine
blob
Format
Raw Data
Handle
17501172
Attached To
R6622 liboncilla
OncillaL01.cpp
View Options
#include "OncillaL01.h"
using
namespace
std
;
namespace
cca
{
namespace
rci
{
namespace
driver
{
OncillaL1
::
OncillaL1
(
const
std
::
string
&
name
)
:
ResourceNode
(
name
),
Controlled
(),
Sensing
(),
PositionControlled
(),
PositionSensing
(),
TorqueControlled
(),
ImpedanceControlled
()
{
this
->
_dimension
=
2
;
// Two encoder values - should always be the same
}
bool
OncillaL1
::
isConverged
()
const
{
throw
std
::
runtime_error
(
"Not yet implemented."
);
return
false
;
}
bool
OncillaL1
::
setJointPosition
(
JointAnglesPtr
position
)
{
// Successfull
this
->
_lastCommandedPosition
=
position
;
return
true
;
}
JointAnglesPtr
OncillaL1
::
getJointPosition
()
const
{
return
this
->
_latestJointPosition
;
}
bool
OncillaL1
::
setJointVelocity
(
JointVelocitiesPtr
vel
)
{
throw
std
::
runtime_error
(
"Not yet implemented."
);
}
bool
OncillaL1
::
setJointTorque
(
JointTorquesPtr
torque
)
{
throw
std
::
runtime_error
(
"Not yet implemented."
);
}
bool
OncillaL1
::
setJointImpedance
(
JointImpedancePtr
imped
)
{
throw
std
::
runtime_error
(
"Not yet implemented."
);
}
JointAnglesPtr
OncillaL1
::
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
;
}
OncillaL1
::~
OncillaL1
()
{
}
std
::
string
OncillaL1
::
print
()
const
{
ostringstream
outstream
(
ostringstream
::
out
);
outstream
.
precision
(
3
);
// Precision when printing double values
outstream
<<
"<Oncilla Hip>"
<<
endl
;
return
outstream
.
str
();
}
/** Oncilla Hip Transverse **/
OncillaL0
::
OncillaL0
(
std
::
string
name
)
:
ResourceNode
(
name
),
Controlled
(),
PositionControlled
()
{
}
bool
OncillaL0
::
isConverged
()
const
{
return
false
;
}
bool
OncillaL0
::
setJointPosition
(
JointAnglesPtr
position
)
{
// Successfull
this
->
_lastCommandedPosition
=
position
;
return
true
;
}
JointAnglesPtr
OncillaL0
::
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
;
}
return
JointAnglesPtr
();
}
OncillaL0
::~
OncillaL0
()
{
}
std
::
string
OncillaL0
::
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