Skip to content

Commit

Permalink
updated prints of TransformManager
Browse files Browse the repository at this point in the history
  • Loading branch information
klaxalk committed Jan 9, 2024
1 parent 6ef6856 commit a22ab3f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
18 changes: 13 additions & 5 deletions src/transform_manager/transform_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,20 +196,26 @@ void TransformManager::onInit() {
param_loader.loadParam("world_origin/units", world_origin_units_);

if (Support::toLowercase(world_origin_units_) == "utm") {

ROS_INFO("[%s]: Loading world origin in UTM units.", getPrintName().c_str());

is_origin_param_ok &= param_loader.loadParam("world_origin/origin_x", world_origin_x);
is_origin_param_ok &= param_loader.loadParam("world_origin/origin_y", world_origin_y);

} else if (Support::toLowercase(world_origin_units_) == "latlon") {
double lat, lon;

ROS_INFO("[%s]: Loading world origin in LatLon units.", getPrintName().c_str());

double lat, lon;
is_origin_param_ok &= param_loader.loadParam("world_origin/origin_x", lat);
is_origin_param_ok &= param_loader.loadParam("world_origin/origin_y", lon);

mrs_lib::UTM(lat, lon, &world_origin_x, &world_origin_y);

ROS_INFO("[%s]: Converted to UTM x: %f, y: %f.", getPrintName().c_str(), world_origin_x, world_origin_y);

} else {
ROS_ERROR("[%s]: world_origin_units must be (\"UTM\"|\"LATLON\"). Got '%s'", getPrintName().c_str(), world_origin_units_.c_str());
ROS_ERROR("[%s]: world_origin/units must be (\"UTM\"|\"LATLON\"). Got '%s'", getPrintName().c_str(), world_origin_units_.c_str());
ros::shutdown();
}

Expand All @@ -221,6 +227,7 @@ void TransformManager::onInit() {
ROS_ERROR("[%s]: Could not load all mandatory parameters from world file. Please check your world file.", getPrintName().c_str());
ros::shutdown();
}

/*//}*/

/*//{ load local_origin parameters */
Expand Down Expand Up @@ -893,8 +900,8 @@ std::optional<geometry_msgs::Pose> TransformManager::transformRtkToFcu(const geo
if (res1) {
pose_tmp.pose.orientation = res1.value().transform.rotation;
} else {
ROS_ERROR_THROTTLE(1.0, "[%s]: Could not obtain transform from %s to %s.", getPrintName().c_str(),
ch_->frames.ns_fcu_untilted.c_str(), ch_->frames.ns_fcu.c_str());
ROS_ERROR_THROTTLE(1.0, "[%s]: Could not obtain transform from %s to %s.", getPrintName().c_str(), ch_->frames.ns_fcu_untilted.c_str(),
ch_->frames.ns_fcu.c_str());
return {};
}

Expand All @@ -914,7 +921,8 @@ std::optional<geometry_msgs::Pose> TransformManager::transformRtkToFcu(const geo
if (res2) {
utm_in_fcu = res2.value();
} else {
ROS_ERROR_THROTTLE(1.0, "[%s]: Could not transform RTK pose from %s to %s.", getPrintName().c_str(), utm_in_antenna.header.frame_id.c_str(), ch_->frames.ns_fcu.c_str());
ROS_ERROR_THROTTLE(1.0, "[%s]: Could not transform RTK pose from %s to %s.", getPrintName().c_str(), utm_in_antenna.header.frame_id.c_str(),
ch_->frames.ns_fcu.c_str());
return {};
}

Expand Down
2 changes: 1 addition & 1 deletion test/coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cd build
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info "*/test/*" --output-file coverage.info.removed
lcov --extract coverage.info.removed "*/${WORKSPACE_NAME}/src/*" --output-file coverage.info.cleaned
genhtml -o coverage_html coverage.info.cleaned | tee /tmp/genhtml.log
genhtml --title "MRS UAV System - Test coverage report" --demangle-cpp --legend --frames --show-details -o coverage_html coverage.info.cleaned | tee /tmp/genhtml.log

COVERAGE_PCT=`cat /tmp/genhtml.log | tail -n 1 | awk '{print $2}'`

Expand Down

0 comments on commit a22ab3f

Please sign in to comment.