SMACC2
Loading...
Searching...
No Matches
smacc2_client_library
cl_nav2z
cl_nav2z
include
cl_nav2z
client_behaviors
cb_navigate_global_position.hpp
Go to the documentation of this file.
1
// Copyright 2025 Robosoft 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
/*****************************************************************************************************************
16
*
17
* Authors: Pablo Inigo Blasco, Brett Aldrich
18
*
19
******************************************************************************************************************/
20
#pragma once
21
22
#include <geometry_msgs/msg/point.hpp>
23
#include <geometry_msgs/msg/pose.hpp>
24
#include <nav2_msgs/action/navigate_to_pose.hpp>
25
26
#include "
cb_nav2z_client_behavior_base.hpp
"
27
28
namespace
cl_nav2z
29
{
30
struct
CbNavigateGlobalPositionOptions
31
{
32
std::optional<std::string>
goalChecker_
;
33
34
std::optional<std::string>
controllerName_
;
35
};
36
37
class
CbNavigateGlobalPosition
:
public
CbNav2ZClientBehaviorBase
38
{
39
public
:
40
float
goalYaw
= 0;
41
42
CbNavigateGlobalPositionOptions
options
;
43
geometry_msgs::msg::Point
goalPosition
;
44
45
CbNavigateGlobalPosition
();
46
47
CbNavigateGlobalPosition
(
48
float
x,
float
y,
float
yaw
/*radians*/
,
49
std::optional<CbNavigateGlobalPositionOptions>
options
= std::nullopt);
50
51
void
setGoal
(
const
geometry_msgs::msg::Pose & pose);
52
53
void
onEntry
()
override
;
54
55
// This is the substate destructor. This code will be executed when the
56
// workflow exits from this substate (that is according to statechart the moment when this object is destroyed)
57
void
onExit
()
override
;
58
59
// auxiliary function that defines the motion that is requested to the navigation2 action server
60
void
execute
();
61
62
private
:
63
void
readStartPoseFromParameterServer
(nav2_msgs::action::NavigateToPose::Goal & goal);
64
};
65
}
// namespace cl_nav2z
cb_nav2z_client_behavior_base.hpp
cl_nav2z::CbNav2ZClientBehaviorBase
Definition
cb_nav2z_client_behavior_base.hpp:41
cl_nav2z::CbNavigateGlobalPosition
Definition
cb_navigate_global_position.hpp:38
cl_nav2z::CbNavigateGlobalPosition::goalYaw
float goalYaw
Definition
cb_navigate_global_position.hpp:40
cl_nav2z::CbNavigateGlobalPosition::setGoal
void setGoal(const geometry_msgs::msg::Pose &pose)
Definition
cb_navigate_global_position.cpp:47
cl_nav2z::CbNavigateGlobalPosition::goalPosition
geometry_msgs::msg::Point goalPosition
Definition
cb_navigate_global_position.hpp:43
cl_nav2z::CbNavigateGlobalPosition::onExit
void onExit() override
Definition
cb_navigate_global_position.cpp:114
cl_nav2z::CbNavigateGlobalPosition::onEntry
void onEntry() override
Definition
cb_navigate_global_position.cpp:53
cl_nav2z::CbNavigateGlobalPosition::CbNavigateGlobalPosition
CbNavigateGlobalPosition()
Definition
cb_navigate_global_position.cpp:33
cl_nav2z::CbNavigateGlobalPosition::readStartPoseFromParameterServer
void readStartPoseFromParameterServer(nav2_msgs::action::NavigateToPose::Goal &goal)
cl_nav2z::CbNavigateGlobalPosition::options
CbNavigateGlobalPositionOptions options
Definition
cb_navigate_global_position.hpp:42
cl_nav2z::CbNavigateGlobalPosition::execute
void execute()
Definition
cb_navigate_global_position.cpp:93
cl_nav2z
Definition
cl_nav2z.hpp:24
cl_nav2z::CbNavigateGlobalPositionOptions
Definition
cb_navigate_global_position.hpp:31
cl_nav2z::CbNavigateGlobalPositionOptions::goalChecker_
std::optional< std::string > goalChecker_
Definition
cb_navigate_global_position.hpp:32
cl_nav2z::CbNavigateGlobalPositionOptions::controllerName_
std::optional< std::string > controllerName_
Definition
cb_navigate_global_position.hpp:34
Generated by
1.12.0