SMACC2
Loading...
Searching...
No Matches
smacc2_client_library
cl_nav2z
cl_nav2z
include
cl_nav2z
client_behaviors
cb_assisted_teleop.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 <nav2_msgs/action/assisted_teleop.hpp>
18
#include <
smacc2/client_behavior_bases/cb_action_client_behavior_base.hpp
>
19
20
namespace
cl_nav2z
21
{
22
23
// Collision-guarded teleoperation via the Nav2 behavior server's
24
// AssistedTeleop action: incoming teleop velocity commands are projected
25
// through the local costmap and scaled/zeroed before a collision. A positive
26
// time allowance bounds the session (the server reports expiry as an abort
27
// with the TIMEOUT code, which this wrapper maps to EvCbSuccess - the window
28
// running its course is the normal ending). A zero allowance disables the
29
// server-side timeout: the session runs until the state exits, which cancels
30
// the action through the behavior base.
31
class
CbAssistedTeleop
:
public
smacc2::client_behavior_bases::CbActionClientBehaviorBase
<
32
nav2_msgs::action::AssistedTeleop>
33
{
34
public
:
35
explicit
CbAssistedTeleop
(std::chrono::seconds timeAllowance = std::chrono::seconds(30));
36
37
void
onEntry
()
override
;
38
39
protected
:
40
// The server reports time-allowance expiry as an abort (error code TIMEOUT)
41
// - but for this action the window running its course IS the normal ending,
42
// so map it to success. Genuine failures (TF_ERROR, rejection) keep failing.
43
void
onActionAbort
(
const
WrappedResult & result)
override
;
44
45
private
:
46
std::chrono::seconds
timeAllowance_
;
47
};
48
49
}
// namespace cl_nav2z
cb_action_client_behavior_base.hpp
cl_nav2z::CbAssistedTeleop
Definition
cb_assisted_teleop.hpp:33
cl_nav2z::CbAssistedTeleop::CbAssistedTeleop
CbAssistedTeleop(std::chrono::seconds timeAllowance=std::chrono::seconds(30))
Definition
cb_assisted_teleop.cpp:20
cl_nav2z::CbAssistedTeleop::onActionAbort
void onActionAbort(const WrappedResult &result) override
Definition
cb_assisted_teleop.cpp:47
cl_nav2z::CbAssistedTeleop::timeAllowance_
std::chrono::seconds timeAllowance_
Definition
cb_assisted_teleop.hpp:46
cl_nav2z::CbAssistedTeleop::onEntry
void onEntry() override
Definition
cb_assisted_teleop.cpp:25
smacc2::client_behavior_bases::CbActionClientBehaviorBase
Definition
cb_action_client_behavior_base.hpp:52
cl_nav2z
Definition
cl_nav2z.hpp:23
Generated by
1.12.0