@@ -65,6 +65,8 @@ class SpinAction : public BtActionNode<nav2_msgs::action::Spin>
6565 BT::InputPort<double >(" spin_dist" , 1.57 , " Spin distance" ),
6666 BT::InputPort<double >(" time_allowance" , 10.0 , " Allowed time for spinning" ),
6767 BT::InputPort<bool >(" is_recovery" , true , " True if recovery" ),
68+ BT::OutputPort<double >(
69+ " angular_distance_traveled" , " Angular distance traveled (may be less than requested)" ),
6870 BT::OutputPort<ActionResult::_error_code_type>(
6971 " error_code_id" , " The spin behavior error code" )
7072 });
@@ -85,6 +87,18 @@ class SpinAction : public BtActionNode<nav2_msgs::action::Spin>
8587 */
8688 BT::NodeStatus on_cancelled () override ;
8789
90+ /* *
91+ * @brief Function to perform some user-defined operation after a timeout
92+ * waiting for a result that hasn't been received yet. Also provides access to
93+ * the latest feedback message from the action server. Feedback will be nullptr
94+ * in subsequent calls to this function if no new feedback is received while waiting for a result.
95+ * @param feedback shared_ptr to latest feedback message, nullptr if no new feedback was received
96+ */
97+ void on_wait_for_result (std::shared_ptr<const typename Action::Feedback> feedback) override ;
98+
99+ protected:
100+ double distance_traveled_;
101+
88102private:
89103 bool is_recovery_;
90104};
0 commit comments