Skip to content

Commit

Permalink
Release 2.1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
tsaubergine committed Jan 31, 2019
1 parent 8859b2e commit 7b6f27d
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 24 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ endif()

set(GOBY_VERSION_MAJOR "2")
set(GOBY_VERSION_MINOR "1")
set(GOBY_VERSION_PATCH "11")
set(GOBY_VERSION_PATCH "12")

if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
message("Compiling in Git source tree.")
Expand Down Expand Up @@ -51,7 +51,7 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")

else()
message("Compiling from release tarball.")
set(GOBY_VERSION_DATE "2018.11.08")
set(GOBY_VERSION_DATE "2019.01.31")
endif()

set(GOBY_VERSION "${GOBY_VERSION_MAJOR}.${GOBY_VERSION_MINOR}.${GOBY_VERSION_PATCH}")
Expand Down
11 changes: 11 additions & 0 deletions release.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
Goby Release Notes (Major version 2)

****************
Version 2.1.12

### Code aesthetics
- Consistent code formatting using clang-format style

### Bug fixes
- Corrected moos_translator1 unit test for Ubuntu 18.04

See https://github.com/GobySoft/goby/compare/2.1.11...2.1.12

****************
Version 2.1.11

Expand Down
9 changes: 6 additions & 3 deletions src/moos/moos_protobuf_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,8 @@ class MOOSTranslation<protobuf::TranslatorEntry::TECHNIQUE_COMMA_SEPARATED_KEY_E
break;

case google::protobuf::FieldDescriptor::CPPTYPE_FLOAT:
out << std::setprecision(std::numeric_limits<float>::digits10) << refl->GetRepeatedFloat(proto_msg, field_desc, j);
out << std::setprecision(std::numeric_limits<float>::digits10)
<< refl->GetRepeatedFloat(proto_msg, field_desc, j);
break;

case google::protobuf::FieldDescriptor::CPPTYPE_DOUBLE:
Expand Down Expand Up @@ -635,11 +636,13 @@ class MOOSTranslation<protobuf::TranslatorEntry::TECHNIQUE_COMMA_SEPARATED_KEY_E
break;

case google::protobuf::FieldDescriptor::CPPTYPE_FLOAT:
out << std::setprecision(std::numeric_limits<float>::digits10)<< refl->GetFloat(proto_msg, field_desc);
out << std::setprecision(std::numeric_limits<float>::digits10)
<< refl->GetFloat(proto_msg, field_desc);
break;

case google::protobuf::FieldDescriptor::CPPTYPE_DOUBLE:
out << std::setprecision(std::numeric_limits<double>::digits10) << refl->GetDouble(proto_msg, field_desc);
out << std::setprecision(std::numeric_limits<double>::digits10)
<< refl->GetDouble(proto_msg, field_desc);
break;

case google::protobuf::FieldDescriptor::CPPTYPE_ENUM:
Expand Down
48 changes: 29 additions & 19 deletions src/test/moos/translator1/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
#include "goby/common/logger.h"
#include "goby/moos/moos_translator.h"
#include "goby/util/binary.h"
#include "test.pb.h"
#include "goby/util/sci.h"
#include "test.pb.h"

using namespace goby::moos;

Expand Down Expand Up @@ -57,7 +57,7 @@ int main(int argc, char* argv[])

CMOOSGeodesy geodesy;
geodesy.Initialise(LAT_ORIGIN, LON_ORIGIN);

goby::glog << translator << std::endl;
run_one_in_one_out_test(translator, 0, false);

Expand Down Expand Up @@ -306,43 +306,53 @@ int main(int argc, char* argv[])
geodesy.UTM2LatLong(report.x(), report.y(), expected_lat, expected_lon);
const int LAT_INT_DIGITS = 2;
const int LON_INT_DIGITS = 3;
expected_lat = goby::util::unbiased_round(expected_lat, std::numeric_limits<double>::digits10 - LAT_INT_DIGITS-1);
expected_lon = goby::util::unbiased_round(expected_lon, std::numeric_limits<double>::digits10 - LON_INT_DIGITS-1);
expected_lat = goby::util::unbiased_round(expected_lat, std::numeric_limits<double>::digits10 -
LAT_INT_DIGITS - 1);
expected_lon = goby::util::unbiased_round(expected_lon, std::numeric_limits<double>::digits10 -
LON_INT_DIGITS - 1);

std::stringstream expected_lat_ss, expected_lon_ss;
expected_lat_ss << std::setprecision(std::numeric_limits<double>::digits10) << expected_lat;
expected_lon_ss << std::setprecision(std::numeric_limits<double>::digits10) << expected_lon;
boost::format expected_lat_fmt("%1%");
boost::format expected_lon_fmt("%1%");
std::string expected_lat_fmt_str = (expected_lat_fmt % boost::io::group(
std::setprecision(std::numeric_limits<double>::digits10), expected_lat)).str();
std::string expected_lon_fmt_str = (expected_lon_fmt % boost::io::group(
std::setprecision(std::numeric_limits<double>::digits10), expected_lon)).str();
std::string expected_lat_fmt_str =
(expected_lat_fmt %
boost::io::group(std::setprecision(std::numeric_limits<double>::digits10), expected_lat))
.str();
std::string expected_lon_fmt_str =
(expected_lon_fmt %
boost::io::group(std::setprecision(std::numeric_limits<double>::digits10), expected_lon))
.str();
std::string expected_lat_key_values_str = expected_lat_ss.str();
std::string expected_lon_key_values_str = expected_lon_ss.str();



for (std::multimap<std::string, CMOOSMsg>::const_iterator it = moos_msgs.begin(),
n = moos_msgs.end();
it != n; ++it)
{
goby::glog << "Variable: " << it->first << "\n"
<< "Value: " << it->second.GetString() << std::endl;

goby::glog << "Expected lat (FORMAT): " << expected_lat_fmt_str << std::endl;
goby::glog << "Expected lon (FORMAT): " << expected_lon_fmt_str << std::endl;
goby::glog << "Expected lat (KEY_VALUES): " << expected_lat_key_values_str << std::endl;
goby::glog << "Expected lon (KEY_VALUES): " << expected_lon_key_values_str << std::endl;
goby::glog << "Expected lat (FORMAT): " << expected_lat_fmt_str << std::endl;
goby::glog << "Expected lon (FORMAT): " << expected_lon_fmt_str << std::endl;
goby::glog << "Expected lat (KEY_VALUES): " << expected_lat_key_values_str << std::endl;
goby::glog << "Expected lon (KEY_VALUES): " << expected_lon_key_values_str << std::endl;

if (it->first == "NODE_REPORT_FORMAT")
assert(it->second.GetString() ==
std::string("NAME=unicorn,X=550,Y=1023.5,HEADING=240,REPEAT={};LAT=") + expected_lat_fmt_str + ";LON=" + expected_lon_fmt_str +
";X+Y=1573.5,X-Y=-473.5");
std::string("NAME=unicorn,X=550,Y=1023.5,HEADING=240,REPEAT={};LAT=") +
expected_lat_fmt_str + ";LON=" + expected_lon_fmt_str +
";X+Y=1573.5,X-Y=-473.5");
else if (it->first == "NODE_REPORT_KEY_VALUE")
assert(it->second.GetString() ==
std::string("Name=unicorn,x=550,y=1023.5,heading=240,utm_y2lat(y)=") + expected_lat_key_values_str + ",utm_x2lon("
"x)=" + expected_lon_key_values_str + ",name2modem_id(Name)=3,name2modem_id+modem_id2type+to_upper("
"Name)=AUV,add(x)=1573.5,subtract(x)=-473.5");
std::string("Name=unicorn,x=550,y=1023.5,heading=240,utm_y2lat(y)=") +
expected_lat_key_values_str +
",utm_x2lon("
"x)=" +
expected_lon_key_values_str +
",name2modem_id(Name)=3,name2modem_id+modem_id2type+to_upper("
"Name)=AUV,add(x)=1573.5,subtract(x)=-473.5");
}

std::string sub_message_format_str = "em.val=%17:1%";
Expand Down

0 comments on commit 7b6f27d

Please sign in to comment.