Nav2 Navigation Stack - humble  humble
ROS 2 Navigation Stack
wait.hpp
1 // Copyright (c) 2019 Samsung Research America
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef NAV2_BEHAVIORS__PLUGINS__WAIT_HPP_
16 #define NAV2_BEHAVIORS__PLUGINS__WAIT_HPP_
17 
18 #include <chrono>
19 #include <string>
20 #include <memory>
21 
22 #include "nav2_behaviors/timed_behavior.hpp"
23 #include "nav2_msgs/action/wait.hpp"
24 
25 namespace nav2_behaviors
26 {
27 using WaitAction = nav2_msgs::action::Wait;
28 
33 class Wait : public TimedBehavior<WaitAction>
34 {
35 public:
39  Wait();
40  ~Wait();
41 
47  Status onRun(const std::shared_ptr<const WaitAction::Goal> command) override;
48 
53  Status onCycleUpdate() override;
54 
55 protected:
56  rclcpp::Time wait_end_;
57  WaitAction::Feedback::SharedPtr feedback_;
58 };
59 
60 } // namespace nav2_behaviors
61 
62 #endif // NAV2_BEHAVIORS__PLUGINS__WAIT_HPP_
An action server behavior for waiting a fixed duration.
Definition: wait.hpp:34
Status onRun(const std::shared_ptr< const WaitAction::Goal > command) override
Initialization to run behavior.
Definition: wait.cpp:31
Wait()
A constructor for nav2_behaviors::Wait.
Definition: wait.cpp:23
Status onCycleUpdate() override
Loop function to run behavior.
Definition: wait.cpp:37