Page MenuHomec4science

OncillaL0Test.cpp
No OneTemporary

File Metadata

Created
Wed, Nov 13, 19:37

OncillaL0Test.cpp

#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