Skip to content

Commit

Permalink
Change to relative topic
Browse files Browse the repository at this point in the history
  • Loading branch information
wico-molina committed Sep 6, 2023
1 parent 9b7e27a commit 4cd211c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mavros/src/plugins/global_position.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class GlobalPositionPlugin : public plugin::PluginBase {

GlobalPositionPlugin() : PluginBase(),
gp_nh("~global_position"),
nh(),
hp_nh("~home_position"),
tf_send(false),
use_relative_alt(true),
is_map_init(false),
Expand Down Expand Up @@ -90,7 +90,7 @@ class GlobalPositionPlugin : public plugin::PluginBase {

// home position subscriber to set "map" origin
// TODO use UAS
hp_sub = nh.subscribe("/mavros/home_position/home", 10, &GlobalPositionPlugin::home_position_cb, this);
hp_sub = hp_nh.subscribe("home", 10, &GlobalPositionPlugin::home_position_cb, this);

// offset from local position to the global origin ("earth")
gp_global_offset_pub = gp_nh.advertise<geometry_msgs::PoseStamped>("gp_lp_offset", 10);
Expand All @@ -109,7 +109,7 @@ class GlobalPositionPlugin : public plugin::PluginBase {

private:
ros::NodeHandle gp_nh;
ros::NodeHandle nh; //node handler outside the global_position namespace
ros::NodeHandle hp_nh; //node handler in home_position namespace

ros::Publisher raw_fix_pub;
ros::Publisher raw_vel_pub;
Expand Down

0 comments on commit 4cd211c

Please sign in to comment.