Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F81582566
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
Fri, Sep 6, 21:17
Size
1 KB
Mime Type
text/x-c
Expires
Sun, Sep 8, 21:17 (2 d)
Engine
blob
Format
Raw Data
Handle
20596426
Attached To
R6622 liboncilla
OncillaL0Test.cpp
View Options
#include <gtest/gtest.h>
#include "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_THROW(joint->getLastPositionCommand(), std::runtime_error);
}
TEST_F(OncillaL0Test, testPositionCommand)
{
EXPECT_THROW(joint->getLastPositionCommand(), std::runtime_error);
joint->setJointPosition(ja);
EXPECT_EQ(1.234, joint->getLastPositionCommand()->rad());
}
Event Timeline
Log In to Comment