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

log level to debug, allow launch params #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions launch/coordinate_convertion.launch
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<launch>
<!-- The following is denver UTM zone. check your UTM zone at https://mangomap.com/robertyoung/maps/69585/what-utm-zone-am-i-in-# -->
<param name="utm_zone" type="int" value="13" />
<param name="hemisphere" type="string" value="North" />
<arg name="utm_zone" default="13" />
<arg name="hemisphere" default="North" />

<param name="utm_zone" type="int" value="$(arg utm_zone)" />
<param name="hemisphere" type="string" value="$(arg hemisphere)" />
<node type="utm_lla_converter" pkg="utm_lla" name="utm_lla_converter" output="screen">
</node>
</launch>
</launch>
24 changes: 12 additions & 12 deletions src/utm_lla_converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ void ULConverter::PoseCallback(const geometry_msgs::PoseStamped::ConstPtr& msgs)
double px = -bs.bx + msgs->pose.position.x ;
double py = -bs.by + msgs->pose.position.y ;
double pz = -bs.bz + msgs->pose.position.z;//height not change, just output unit in meters
ROS_INFO("Get data x: [%f]", px);
ROS_INFO("Get data y: [%f]", py);
ROS_INFO("Get data z: [%f]", pz);
ROS_DEBUG("Get data x: [%f]", px);
ROS_DEBUG("Get data y: [%f]", py);
ROS_DEBUG("Get data z: [%f]", pz);

if(hemi_ == "North")
UTMConvert2LLA(NorthH, zone_, px, py, pz);//hemisphere, zone, x, y, height
Expand All @@ -42,9 +42,9 @@ void ULConverter::PoseCallback(const geometry_msgs::PoseStamped::ConstPtr& msgs)
gps.longitude = lla_[1];
gps.altitude = lla_[2];

ROS_INFO("Convert to lagitude: [%f]", lla_[0]);
ROS_INFO("Convert to longitude: [%f]", lla_[1]);
ROS_INFO("Convert to altitude: [%f]", lla_[2]);
ROS_DEBUG("Convert to lagitude: [%f]", lla_[0]);
ROS_DEBUG("Convert to longitude: [%f]", lla_[1]);
ROS_DEBUG("Convert to altitude: [%f]", lla_[2]);

gps_pub_.publish(gps);
lla_.clear();//don't forget this
Expand All @@ -53,9 +53,9 @@ void ULConverter::PoseCallback(const geometry_msgs::PoseStamped::ConstPtr& msgs)
void ULConverter::GPSCallback(const sensor_msgs::NavSatFix::ConstPtr& msgs)
{
basic bs;
ROS_INFO("Get data lagitude from GPS: [%f]", msgs->latitude);
ROS_INFO("Get data longitude from GPS: [%f]", msgs->longitude);
ROS_INFO("Get data altitude from GPS: [%f]", msgs->altitude);
ROS_DEBUG("Get data lagitude from GPS: [%f]", msgs->latitude);
ROS_DEBUG("Get data longitude from GPS: [%f]", msgs->longitude);
ROS_DEBUG("Get data altitude from GPS: [%f]", msgs->altitude);

if(hemi_ == "North")
LLAConvert2UTM(NorthH, zone_, msgs->latitude, msgs->longitude, msgs->altitude);
Expand All @@ -73,9 +73,9 @@ void ULConverter::GPSCallback(const sensor_msgs::NavSatFix::ConstPtr& msgs)
local_pose.pose.position.y = utm_[1] + bs.by;
local_pose.pose.position.z = utm_[2] + bs.bz;

ROS_INFO("Convert to x: [%f]", local_pose.pose.position.x);
ROS_INFO("Convert to y: [%f]", local_pose.pose.position.y);
ROS_INFO("Convert to z: [%f]", local_pose.pose.position.z);
ROS_DEBUG("Convert to x: [%f]", local_pose.pose.position.x);
ROS_DEBUG("Convert to y: [%f]", local_pose.pose.position.y);
ROS_DEBUG("Convert to z: [%f]", local_pose.pose.position.z);

xyz_pub_.publish(local_pose);

Expand Down