Skip to content

Commit 8ebf1c0

Browse files
authored
Consistently add <cmath> include with define for windows (backport #2193) (#2196)
1 parent caaca43 commit 8ebf1c0

File tree

8 files changed

+24
-0
lines changed

8 files changed

+24
-0
lines changed

imu_sensor_broadcaster/test/test_imu_sensor_broadcaster.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@
1616
* Authors: Subhas Das, Denis Stogl, Victor Lopez, Christoph Froehlich
1717
*/
1818

19+
#define _USE_MATH_DEFINES
20+
1921
#include "test_imu_sensor_broadcaster.hpp"
2022

23+
#include <cmath>
2124
#include <memory>
2225
#include <utility>
2326
#include <vector>

imu_sensor_broadcaster/test/test_imu_transform.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
// adapted from
1616
// https://github.com/ros-perception/imu_pipeline/blob/jazzy/imu_transformer/test/test_imu_transforms.cpp
1717

18+
#define _USE_MATH_DEFINES
19+
1820
#include <array>
21+
#include <cmath>
1922

2023
#include "Eigen/Dense"
2124
#include "gmock/gmock.h"

joint_trajectory_controller/src/trajectory.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#ifndef _USE_MATH_DEFINES
16+
#define _USE_MATH_DEFINES
17+
#endif
18+
1519
#include "joint_trajectory_controller/trajectory.hpp"
1620

21+
#include <cmath>
1722
#include <memory>
1823

1924
#include "angles/angles.h"

joint_trajectory_controller/test/test_trajectory.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#ifndef _USE_MATH_DEFINES
16+
#define _USE_MATH_DEFINES
17+
#endif
18+
1519
#include <gmock/gmock.h>
1620

1721
#include <cmath>

joint_trajectory_controller/test/test_trajectory_controller.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#ifndef _USE_MATH_DEFINES
16+
#define _USE_MATH_DEFINES
17+
#endif
18+
1519
#include <cstddef>
1620

1721
#include <chrono>

mecanum_drive_controller/test/test_mecanum_drive_controller.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#define _USE_MATH_DEFINES
16+
1517
#include "test_mecanum_drive_controller.hpp"
1618

19+
#include <cmath>
1720
#include <limits>
1821
#include <memory>
1922
#include <string>

steering_controllers_library/test/test_steering_odometry.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#define _USE_MATH_DEFINES
1616

1717
#include <gmock/gmock.h>
18+
#include <cmath>
1819

1920
#include "steering_controllers_library/steering_kinematics.hpp"
2021

tricycle_controller/src/tricycle_controller.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#define _USE_MATH_DEFINES
2020

21+
#include <cmath>
2122
#include <memory>
2223
#include <queue>
2324
#include <string>

0 commit comments

Comments
 (0)