Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F61595351
OncillaL0.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, May 7, 17:09
Size
1 KB
Mime Type
text/x-c
Expires
Thu, May 9, 17:09 (2 d)
Engine
blob
Format
Raw Data
Handle
17532652
Attached To
R6622 liboncilla
OncillaL0.cpp
View Options
#include "OncillaL0.h"
using
namespace
std
;
namespace
rci
{
namespace
oncilla
{
OncillaL0
::
OncillaL0
(
const
std
::
string
&
name
)
:
ResourceNode
(
name
)
,
Controlled
()
,
PositionControlled
()
{
// \todo add default value as a setting
_controlMode
=
modeJointPositionControl
;
_lastCommandedPosition
=
JointAngles
::
create
(
1
,
0.0
);
}
bool
OncillaL0
::
isConverged
()
const
{
return
false
;
}
void
OncillaL0
::
unsafeSetCommand
(
double
value
){
this
->
_lastCommandedPosition
->
setValue
(
value
);
}
double
OncillaL0
::
unsafeGetCommand
()
const
{
return
this
->
_lastCommandedPosition
->
asDouble
(
0
,
false
);
}
bool
OncillaL0
::
setJointPosition
(
JointAnglesPtr
position
)
{
// Successfull
this
->
_lastCommandedPosition
=
position
;
return
true
;
}
JointAnglesPtr
OncillaL0
::
getLastPositionCommand
()
const
{
if
(
this
->
_lastCommandedPosition
)
{
return
this
->
_lastCommandedPosition
;
}
throw
runtime_error
(
"No position command received yet."
);
}
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