Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91651857
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
Wed, Nov 13, 02:44
Size
1 KB
Mime Type
text/x-c
Expires
Fri, Nov 15, 02:44 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22275169
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
_lastCommandedPosition
=
JointAngles
::
create
(
1
,
0.0
);
}
bool
OncillaL0
::
isConverged
()
const
{
return
false
;
}
void
OncillaL0
::
setRawLocalCommand
(
double
value
){
this
->
_lastCommandedPosition
->
setValue
(
value
);
}
double
OncillaL0
::
getRawLocalCommand
()
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