Verified Commit 8435aefe authored by Justin Carpentier's avatar Justin Carpentier
Browse files

test/all: remove compilation warnings

parent da27ec6c
//
// Copyright (c) 2015-2018 CNRS INRIA
// Copyright (c) 2015-2019 CNRS INRIA
//
#include "pinocchio/multibody/model.hpp"
#include "pinocchio/multibody/data.hpp"
#include "pinocchio/algorithm/crba.hpp"
#include "pinocchio/algorithm/centroidal.hpp"
#include "pinocchio/algorithm/rnea.hpp"
#include "pinocchio/algorithm/jacobian.hpp"
#include "pinocchio/algorithm/center-of-mass.hpp"
#include "pinocchio/algorithm/joint-configuration.hpp"
#include "pinocchio/parsers/sample-models.hpp"
#include "pinocchio/utils/timer.hpp"
#include <iostream>
......@@ -32,7 +32,7 @@ static void addJointAndBody(pinocchio::Model & model,
Model::JointIndex idx;
if (setRandomLimits)
if(setRandomLimits)
idx = model.addJoint(model.getJointId(parent_name),joint,
SE3::Random(),
name + "_joint",
......@@ -41,15 +41,15 @@ static void addJointAndBody(pinocchio::Model & model,
CV::Random() - CV::Constant(1),
CV::Random() + CV::Constant(1)
);
else
idx = model.addJoint(model.getJointId(parent_name),joint,
placement, name + "_joint");
model.addJointFrame(idx);
model.appendBodyToJoint(idx,Inertia::Random(),SE3::Identity());
model.addBodyFrame(name + "_body", idx);
}
else
idx = model.addJoint(model.getJointId(parent_name),joint,
placement, name + "_joint");
model.addJointFrame(idx);
model.appendBodyToJoint(idx,Inertia::Random(),SE3::Identity());
model.addBodyFrame(name + "_body", idx);
}
BOOST_AUTO_TEST_SUITE( BOOST_TEST_MODULE )
......@@ -104,7 +104,6 @@ BOOST_AUTO_TEST_CASE (test_dccrb)
crba(model,data_ref,q);
data_ref.M.triangularView<Eigen::StrictlyLower>() = data_ref.M.transpose().triangularView<Eigen::StrictlyLower>();
SE3::Vector3 com = data_ref.Ycrb[1].lever();
SE3 cMo(SE3::Identity());
cMo.translation() = -getComFromCrba(model, data_ref);
......
//
// Copyright (c) 2015-2018 CNRS
// Copyright (c) 2015-2019 CNRS INRIA
//
/*
......@@ -49,15 +49,15 @@ static void addJointAndBody(pinocchio::Model & model,
CV::Random() - CV::Constant(1),
CV::Random() + CV::Constant(1)
);
else
idx = model.addJoint(model.getJointId(parent_name),joint,
placement, name + "_joint");
model.addJointFrame(idx);
model.appendBodyToJoint(idx,Inertia::Random(),SE3::Identity());
model.addBodyFrame(name + "_body", idx);
}
else
idx = model.addJoint(model.getJointId(parent_name),joint,
placement, name + "_joint");
model.addJointFrame(idx);
model.appendBodyToJoint(idx,Inertia::Random(),SE3::Identity());
model.addBodyFrame(name + "_body", idx);
}
BOOST_AUTO_TEST_SUITE ( BOOST_TEST_MODULE )
......
......@@ -14,7 +14,8 @@ BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
BOOST_AUTO_TEST_CASE(test_emulate_tensors)
{
typedef pinocchio::Tensor<double,3> Tensor;
typedef double Scalar;
typedef pinocchio::Tensor<Scalar,3> Tensor;
const Eigen::DenseIndex x_dim = 6, y_dim = 20, z_dim = 20;
Tensor tensor1(x_dim,y_dim,z_dim);
......@@ -24,9 +25,9 @@ BOOST_AUTO_TEST_CASE(test_emulate_tensors)
BOOST_CHECK(tensor1.dimension(1) == y_dim);
BOOST_CHECK(tensor1.dimension(2) == z_dim);
double * data = tensor1.data();
Scalar * data = tensor1.data();
for(Eigen::DenseIndex k = 0; k < tensor1.size(); ++k)
data[k] = k;
data[k] = (Scalar)k;
for(Eigen::DenseIndex k = 0; k < z_dim; ++k)
{
......@@ -34,7 +35,7 @@ BOOST_AUTO_TEST_CASE(test_emulate_tensors)
{
for(Eigen::DenseIndex i = 0; i < x_dim; ++i)
{
BOOST_CHECK(tensor1(i,j,k) == i + j*x_dim + k*(x_dim*y_dim));
BOOST_CHECK(tensor1(i,j,k) == (Scalar)(i + j*x_dim + k*(x_dim*y_dim)));
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment