Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace boost::array with std::array #567

Merged
merged 1 commit into from Mar 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions swri_transform_util/include/swri_transform_util/transform_util.h
Expand Up @@ -31,7 +31,7 @@
#define TRANSFORM_UTIL_TRANSFORM_UTIL_H_

#include <string>
#include <boost/array.hpp>
#include <array>

#include <tf2/transform_datatypes.h>
#include <tf2/LinearMath/Transform.h>
Expand Down Expand Up @@ -179,7 +179,7 @@ namespace swri_transform_util
*
* @returns The upper-left 3x3 sub-matrix.
*/
tf2::Matrix3x3 GetUpperLeft(const boost::array<double, 36>& matrix);
tf2::Matrix3x3 GetUpperLeft(const std::array<double, 36>& matrix);

/**
* Gets the lower-right 3x3 sub-matrix of a 6x6 matrix.
Expand All @@ -188,7 +188,7 @@ namespace swri_transform_util
*
* @returns The lower-right 3x3 sub-matrix.
*/
tf2::Matrix3x3 GetLowerRight(const boost::array<double, 36>& matrix);
tf2::Matrix3x3 GetLowerRight(const std::array<double, 36>& matrix);

/**
* Converts the 3x3 covariance matrices from Imu messages to a Matrix3x3
Expand All @@ -197,7 +197,7 @@ namespace swri_transform_util
*
* @retval Returns the input matrix as a Matrix3x3 object
*/
tf2::Matrix3x3 Get3x3Cov(const boost::array<double, 9>& matrix);
tf2::Matrix3x3 Get3x3Cov(const std::array<double, 9>& matrix);

/**
* Converts the Matrix3x3 matrix into a 9 element covariance matrix from Imu
Expand All @@ -208,7 +208,7 @@ namespace swri_transform_util
*
*/
void Set3x3Cov(const tf2::Matrix3x3& matrix_in,
boost::array<double, 9>& matrix_out);
std::array<double, 9>& matrix_out);
/**
* Sets the upper-left quadrant of a 6x6 matrix with the specified 3x3
* sub-matrix
Expand All @@ -218,7 +218,7 @@ namespace swri_transform_util
*/
void SetUpperLeft(
const tf2::Matrix3x3& sub_matrix,
boost::array<double, 36>& matrix);
std::array<double, 36>& matrix);

/**
* Sets the lower-right quadrant of a 6x6 matrix with the specified 3x3
Expand All @@ -229,7 +229,7 @@ namespace swri_transform_util
*/
void SetLowerRight(
const tf2::Matrix3x3& sub_matrix,
boost::array<double, 36>& matrix);
std::array<double, 36>& matrix);

/**
* Calculate the subtending angle of an arc (aligned with the
Expand Down
12 changes: 6 additions & 6 deletions swri_transform_util/src/transform_util.cpp
Expand Up @@ -291,7 +291,7 @@ namespace swri_transform_util
return true;
}

tf2::Matrix3x3 GetUpperLeft(const boost::array<double, 36>& matrix)
tf2::Matrix3x3 GetUpperLeft(const std::array<double, 36>& matrix)
{
tf2::Matrix3x3 sub_matrix;

Expand All @@ -308,7 +308,7 @@ namespace swri_transform_util
return sub_matrix;
}

tf2::Matrix3x3 GetLowerRight(const boost::array<double, 36>& matrix)
tf2::Matrix3x3 GetLowerRight(const std::array<double, 36>& matrix)
{
tf2::Matrix3x3 sub_matrix;

Expand All @@ -325,7 +325,7 @@ namespace swri_transform_util
return sub_matrix;
}

tf2::Matrix3x3 Get3x3Cov(const boost::array<double, 9>& matrix)
tf2::Matrix3x3 Get3x3Cov(const std::array<double, 9>& matrix)
{
tf2::Matrix3x3 matrix_out;

Expand All @@ -344,7 +344,7 @@ namespace swri_transform_util

void Set3x3Cov(
const tf2::Matrix3x3& matrix_in,
boost::array<double, 9>& matrix_out)
std::array<double, 9>& matrix_out)
{
matrix_out[0] = matrix_in[0][0];
matrix_out[1] = matrix_in[0][1];
Expand All @@ -359,7 +359,7 @@ namespace swri_transform_util

void SetUpperLeft(
const tf2::Matrix3x3& sub_matrix,
boost::array<double, 36>& matrix)
std::array<double, 36>& matrix)
{
matrix[0] = sub_matrix[0][0];
matrix[1] = sub_matrix[0][1];
Expand All @@ -374,7 +374,7 @@ namespace swri_transform_util

void SetLowerRight(
const tf2::Matrix3x3& sub_matrix,
boost::array<double, 36>& matrix)
std::array<double, 36>& matrix)
{
matrix[21] = sub_matrix[0][0];
matrix[22] = sub_matrix[0][1];
Expand Down
4 changes: 2 additions & 2 deletions swri_transform_util/test/test_transform_util.cpp
Expand Up @@ -29,7 +29,7 @@

#include <cstdlib>

#include <boost/array.hpp>
#include <array.hpp>

#include <gtest/gtest.h>

Expand Down Expand Up @@ -174,7 +174,7 @@ TEST(TransformUtilTests, TestUpperLeftLowerRight)
tf::Matrix3x3 ul(1, 2, 3, 4, 5, 6, 7, 8, 9);
tf::Matrix3x3 lr(10, 11, 12, 13, 14, 15, 16, 17, 18);

boost::array<double, 36> array;
std::array<double, 36> array;

swri_transform_util::SetUpperLeft(ul, array);
swri_transform_util::SetLowerRight(lr, array);
Expand Down