SMACC2
Loading...
Searching...
No Matches
cb_dock_robot.hpp
Go to the documentation of this file.
1// Copyright 2026 RobosoftAI Inc.
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#pragma once
16
17#include <string>
18
19#include <geometry_msgs/msg/pose_stamped.hpp>
20#include <nav2_msgs/action/dock_robot.hpp>
22
23namespace cl_nav2z
24{
25
26// Dock the robot via the Nav2 docking server (opennav_docking): navigate to
27// the dock's staging pose, detect the dock, drive in, and confirm charging.
28// Requires the docking server running with a dock database (dock-id form) or
29// a detectable dock at the given pose (dock-pose form).
31: public smacc2::client_behavior_bases::CbActionClientBehaviorBase<nav2_msgs::action::DockRobot>
32{
33public:
34 // dock at a named dock from the server's dock database
35 explicit CbDockRobot(std::string dockId);
36
37 // dock at an explicit pose; dockType selects the dock plugin when the
38 // server has several configured
39 CbDockRobot(geometry_msgs::msg::PoseStamped dockPose, std::string dockType = "");
40
41 void onEntry() override;
42
43private:
45 std::string dockId_;
46 geometry_msgs::msg::PoseStamped dockPose_;
47 std::string dockType_;
48};
49
50} // namespace cl_nav2z
geometry_msgs::msg::PoseStamped dockPose_
CbDockRobot(std::string dockId)
void onEntry() override