Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91717310
OncillaL0Test.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, 19:37
Size
1 KB
Mime Type
text/x-c
Expires
Fri, Nov 15, 19:37 (2 d)
Engine
blob
Format
Raw Data
Handle
22309484
Attached To
R6622 liboncilla
OncillaL0Test.cpp
View Options
#include <gtest/gtest.h>
#include "liboncilla/OncillaL0.h"
using
namespace
nemo
;
using
namespace
rci
;
using
namespace
rci
::
oncilla
;
class
OncillaL0Test
:
public
::
testing
::
Test
{
protected
:
OncillaL0Test
()
:
joint
(),
ja_values
(),
ji_values
(),
ja
(),
ji
()
{
joint
=
OncillaL0Ptr
(
new
OncillaL0
(
"FooBar"
));
ja_values
=
RealVector
(
dim
(
1
),
1.234
);
ji_values
=
RealVector
(
dim
(
2
),
1.234
);
ji_values
[
1
]
=
2.345
;
ja
=
JointAngles
::
fromRad
(
ja_values
);
ji
=
JointImpedancePtr
(
new
JointImpedance
(
ji_values
));
}
virtual
~
OncillaL0Test
()
{
}
OncillaL0Ptr
joint
;
RealVector
ja_values
,
ji_values
;
JointAnglesPtr
ja
;
JointImpedancePtr
ji
;
};
TEST_F
(
OncillaL0Test
,
testInitialialState
)
{
EXPECT_NO_THROW
(
joint
->
getLastPositionCommand
());
EXPECT_EQ
(
0.0
,
joint
->
getLastPositionCommand
()
->
rad
());
}
TEST_F
(
OncillaL0Test
,
testPositionCommand
)
{
EXPECT_NO_THROW
(
joint
->
getLastPositionCommand
());
EXPECT_EQ
(
0.0
,
joint
->
getLastPositionCommand
()
->
rad
());
joint
->
setJointPosition
(
ja
);
EXPECT_EQ
(
1.234
,
joint
->
getLastPositionCommand
()
->
rad
());
}
Event Timeline
Log In to Comment