Skip to content

Commit

Permalink
Bump ign-math to 6.5, update style
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <[email protected]>
  • Loading branch information
chapulina committed Sep 10, 2020
1 parent 9b53f70 commit 25e4f30
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
18 changes: 9 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ ign_configure_project(VERSION_SUFFIX pre1)
# Cross-compilation related options
# In a cross-compilation scenario, it is possible that the ign_msgs_gen
# generator compiled for the target machine cannot be used to generate
# the C++ code corresponding to the .proto definition. For this scenario,
# the following two options can be used as follows.
# the C++ code corresponding to the .proto definition. For this scenario,
# the following two options can be used as follows.
# First of all, ign-msgs is compiled targeting the host machine, and in the
# build targeting the host, the INSTALL_IGN_MSGS_GEN_EXECUTABLE option is
# enabled:
# > cmake -DINSTALL_IGN_MSGS_GEN_EXECUTABLE:BOOL=ON ..
# ensuring that the ign_msgs_gen is installed in
# <host_install_prefix>/bin/ign_msgs_gen . Then, the same version of ign-msgs
# > cmake -DINSTALL_IGN_MSGS_GEN_EXECUTABLE:BOOL=ON ..
# ensuring that the ign_msgs_gen is installed in
# <host_install_prefix>/bin/ign_msgs_gen . Then, the same version of ign-msgs
# can be cross-compiled, and in the cross-compilation build the location of the
# host ign_msgs_gen is specified via the IGN_MSGS_GEN_EXECUTABLE
# CMake cache variable:
# > cmake -IGN_MSGS_GEN_EXECUTABLE=<host_install_prefix>/bin/ign_msgs_gen ..
# host ign_msgs_gen is specified via the IGN_MSGS_GEN_EXECUTABLE
# CMake cache variable:
# > cmake -IGN_MSGS_GEN_EXECUTABLE=<host_install_prefix>/bin/ign_msgs_gen ..

option(
INSTALL_IGN_MSGS_GEN_EXECUTABLE
Expand Down Expand Up @@ -65,7 +65,7 @@ ign_find_package(IgnProtobuf

#--------------------------------------
# Find ignition-math
ign_find_package(ignition-math6 REQUIRED)
ign_find_package(ignition-math6 REQUIRED VERSION 6.5)
set(IGN_MATH_VER ${ignition-math6_VERSION_MAJOR})

#--------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions src/Utility.cc
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,10 @@ namespace ignition
}

/////////////////////////////////////////////////
msgs::Time Convert(const std::chrono::steady_clock::time_point &_time_point)
msgs::Time Convert(const std::chrono::steady_clock::time_point &_timePoint)
{
std::pair<uint64_t, uint64_t> timeSecAndNsecs =
ignition::math::timePointToSecNsec(_time_point);
ignition::math::timePointToSecNsec(_timePoint);
msgs::Time msg;
msg.set_sec(timeSecAndNsecs.first);
msg.set_nsec(timeSecAndNsecs.second);
Expand Down
8 changes: 4 additions & 4 deletions src/Utility_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -319,17 +319,17 @@ TEST(UtilityTest, ConvertFloat)
/////////////////////////////////////////////////
TEST(UtilityTest, ConvertTimePoint)
{
std::chrono::steady_clock::time_point time_point =
std::chrono::steady_clock::time_point timePoint =
math::secNsecToTimePoint(0, 0);
msgs::Time msg = msgs::Convert(time_point);
msgs::Time msg = msgs::Convert(timePoint);
EXPECT_EQ(0, msg.sec());
EXPECT_EQ(0, msg.nsec());

std::chrono::steady_clock::time_point s = msgs::Convert(msg);
EXPECT_EQ(s, math::secNsecToTimePoint(0, 0));

time_point = math::secNsecToTimePoint(200, 999);
msg = msgs::Convert(time_point);
timePoint = math::secNsecToTimePoint(200, 999);
msg = msgs::Convert(timePoint);
EXPECT_EQ(200, msg.sec());
EXPECT_EQ(999, msg.nsec());
}
Expand Down

0 comments on commit 25e4f30

Please sign in to comment.