Easy Navigation
Toggle main menu visibility
Loading...
Searching...
No Matches
easynav_controller
include
easynav_controller
VelocityMux.hpp
Go to the documentation of this file.
1
// Copyright 2026 Intelligent Robotics Lab
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
17
18
#ifndef EASYNAV_CONTROLLER__VELOCITYMUX_HPP_
19
#define EASYNAV_CONTROLLER__VELOCITYMUX_HPP_
20
21
#include "geometry_msgs/msg/twist_stamped.hpp"
22
23
#include "
easynav_common/types/NavState.hpp
"
24
#include "easynav_core/SafetyChannel.hpp"
25
#include "easynav_core/VelocityCommand.hpp"
26
27
namespace
easynav
28
{
29
43
class
VelocityMux
44
{
45
public
:
47
enum class
Choice
{NONE, CONTROLLER, PAUSED, TAKEOVER, OVERRIDE, SAFETY_STOP, INHIBITED};
48
50
struct
Selection
51
{
52
geometry_msgs::msg::TwistStamped
cmd
;
53
Choice
choice
{
Choice::NONE
};
54
bool
fresh
{
false
};
55
bool
smooth
{
true
};
56
};
57
59
Selection
select
(
NavState
& nav_state);
60
62
void
reset
()
63
{
64
last_target_ = geometry_msgs::msg::TwistStamped();
65
last_choice_ =
Choice::NONE
;
66
}
67
68
private
:
69
geometry_msgs::msg::TwistStamped last_target_;
70
Choice last_choice_ {
Choice::NONE
};
71
};
72
73
}
// namespace easynav
74
75
#endif
// EASYNAV_CONTROLLER__VELOCITYMUX_HPP_
NavState.hpp
A blackboard-like structure to hold the current state of the navigation system.
easynav::NavState
A generic, type-safe, thread-safe blackboard to hold runtime state.
Definition
NavState.hpp:87
easynav::VelocityMux
Decides, every RT cycle, which velocity command is sent to the robot.
Definition
VelocityMux.hpp:44
easynav::VelocityMux::select
Selection select(NavState &nav_state)
Takes this cycle's proposals from nav_state and selects the command.
Definition
VelocityMux.cpp:32
easynav::VelocityMux::Choice
Choice
Who the selected command comes from.
Definition
VelocityMux.hpp:47
easynav::VelocityMux::Choice::NONE
@ NONE
Definition
VelocityMux.hpp:47
easynav::VelocityMux::reset
void reset()
Forgets the last target (e.g. on activation).
Definition
VelocityMux.hpp:62
easynav
Definition
CircularBuffer.hpp:24
easynav::VelocityMux::Selection
This cycle's selection.
Definition
VelocityMux.hpp:51
easynav::VelocityMux::Selection::smooth
bool smooth
Whether it must go through the smoother.
Definition
VelocityMux.hpp:55
easynav::VelocityMux::Selection::cmd
geometry_msgs::msg::TwistStamped cmd
Target command.
Definition
VelocityMux.hpp:52
easynav::VelocityMux::Selection::choice
Choice choice
Who it comes from.
Definition
VelocityMux.hpp:53
easynav::VelocityMux::Selection::fresh
bool fresh
A new command was proposed this cycle.
Definition
VelocityMux.hpp:54
Generated by
1.18.0