Skip to content

Commit

Permalink
July demo cargo fixes (nasa#225)
Browse files Browse the repository at this point in the history
* always deploy to 0,0 if commanded
* taking out more warnings
* adding comment
  • Loading branch information
marinagmoreira authored Jul 7, 2021
1 parent 45e422f commit c76ac1a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 2 additions & 3 deletions behaviors/arm/src/arm_nodelet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,8 @@ class ArmNodelet : public ff_util::FreeFlyerNodelet {

// STOWED -> DEPLOYING_PANNING
// [label="[5]\nGOAL_DEPLOY\nPan(DEPLOY)"];
fsm_.Add(STATE::STOWED,
GOAL_DEPLOY,
[this](FSM::Event const& event) -> FSM::State {
fsm_.Add(GOAL_DEPLOY,
[this](FSM::State const& state, FSM::Event const& event) -> FSM::State {
if (!Arm(PAN))
return Result(RESPONSE::PAN_FAILED);
return STATE::DEPLOYING_PANNING;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ class GraphLocalizerNodelet : public ff_util::FreeFlyerNodelet {
GraphLocalizerNodeletParams params_;
int last_mode_ = -1;

ros::Time last_time_tf_dock_;
ros::Time last_time_tf_handrail_;

// Timers
localization_common::RosTimer vl_timer_ = localization_common::RosTimer("VL msg");
localization_common::RosTimer of_timer_ = localization_common::RosTimer("OF msg");
Expand Down
8 changes: 8 additions & 0 deletions localization/graph_localizer/src/graph_localizer_nodelet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ void GraphLocalizerNodelet::PublishWorldTDockTF() {
const auto world_T_dock = graph_localizer_wrapper_.estimated_world_T_dock();
const auto world_T_dock_tf =
lc::PoseToTF(world_T_dock, "world", "dock/body", lc::TimeFromRosTime(ros::Time::now()), platform_name_);
// If the rate is higher than the sim time, prevent repeated timestamps
if (world_T_dock_tf.header.stamp == last_time_tf_dock_)
return;
last_time_tf_dock_ = world_T_dock_tf.header.stamp;
transform_pub_.sendTransform(world_T_dock_tf);
}

Expand All @@ -270,6 +274,10 @@ void GraphLocalizerNodelet::PublishWorldTHandrailTF() {
if (!world_T_handrail) return;
const auto world_T_handrail_tf = lc::PoseToTF(world_T_handrail->pose, "world", "handrail/body",
lc::TimeFromRosTime(ros::Time::now()), platform_name_);
// If the rate is higher than the sim time, prevent repeated timestamps
if (world_T_handrail_tf.header.stamp == last_time_tf_handrail_)
return;
last_time_tf_handrail_ = world_T_handrail_tf.header.stamp;
transform_pub_.sendTransform(world_T_handrail_tf);
}

Expand Down

0 comments on commit c76ac1a

Please sign in to comment.