SMACC2
|
#include <waypoints_navigator.hpp>
Public Member Functions | |
WaypointNavigator () | |
void | onInitialize () override |
template<typename TOrthogonal , typename TSourceObject > | |
void | onOrthogonalAllocation () |
void | loadWayPointsFromFile (std::string filepath) |
void | loadWayPointsFromFile2 (std::string filepath) |
void | setWaypoints (const std::vector< geometry_msgs::msg::Pose > &waypoints) |
void | setWaypoints (const std::vector< Pose2D > &waypoints) |
std::optional< std::shared_future< std::shared_ptr< rclcpp_action::ClientGoalHandle< nav2_msgs::action::NavigateToPose > > > > | sendNextGoal (std::optional< NavigateNextWaypointOptions > options=std::nullopt, cl_nav2z::ClNav2Z::SmaccNavigateResultSignal::WeakPtr callback=cl_nav2z::ClNav2Z::SmaccNavigateResultSignal::WeakPtr()) |
void | stopWaitingResult () |
const std::vector< geometry_msgs::msg::Pose > & | getWaypoints () const |
const std::vector< std::string > & | getWaypointNames () const |
std::optional< geometry_msgs::msg::Pose > | getNamedPose (std::string name) const |
long | getCurrentWaypointIndex () const |
std::optional< std::string > | getCurrentWaypointName () const |
void | rewind (int count) |
void | forward (int count) |
void | seekName (std::string name) |
Public Member Functions inherited from smacc2::ISmaccComponent | |
ISmaccComponent () | |
virtual | ~ISmaccComponent () |
virtual std::string | getName () const |
Public Attributes | |
WaypointEventDispatcher | waypointsEventDispatcher |
ClNav2Z * | client_ |
long | currentWaypoint_ |
smacc2::SmaccSignal< void()> | onNavigationRequestSucceded |
smacc2::SmaccSignal< void()> | onNavigationRequestAborted |
smacc2::SmaccSignal< void()> | onNavigationRequestCancelled |
Private Member Functions | |
void | insertWaypoint (int index, geometry_msgs::msg::Pose &newpose) |
void | removeWaypoint (int index) |
void | onNavigationResult (const ClNav2Z::WrappedResult &r) |
void | onGoalReached (const ClNav2Z::WrappedResult &res) |
void | onGoalCancelled (const ClNav2Z::WrappedResult &) |
void | onGoalAborted (const ClNav2Z::WrappedResult &) |
Private Attributes | |
std::vector< geometry_msgs::msg::Pose > | waypoints_ |
std::vector< std::string > | waypointsNames_ |
boost::signals2::connection | succeddedNav2ZClientConnection_ |
boost::signals2::connection | abortedNav2ZClientConnection_ |
boost::signals2::connection | cancelledNav2ZClientConnection_ |
Additional Inherited Members | |
Protected Member Functions inherited from smacc2::ISmaccComponent | |
virtual void | onInitialize () |
template<typename EventType > | |
void | postEvent (const EventType &ev) |
template<typename EventType > | |
void | postEvent () |
template<typename TOrthogonal , typename TSourceObject > | |
void | onOrthogonalAllocation () |
template<typename TComponent > | |
void | requiresComponent (TComponent *&requiredComponentStorage, bool throwExceptionIfNotExist=false) |
template<typename TComponent > | |
void | requiresComponent (std::string name, TComponent *&requiredComponentStorage, bool throwExceptionIfNotExist=false) |
template<typename TClient > | |
void | requiresClient (TClient *&requiredClientStorage) |
template<typename SmaccComponentType , typename TOrthogonal , typename TClient , typename... TArgs> | |
SmaccComponentType * | createSiblingComponent (TArgs... targs) |
template<typename SmaccComponentType , typename TOrthogonal , typename TClient , typename... TArgs> | |
SmaccComponentType * | createSiblingNamedComponent (std::string name, TArgs... targs) |
rclcpp::Node::SharedPtr | getNode () |
rclcpp::Logger | getLogger () const |
ISmaccStateMachine * | getStateMachine () |
Protected Attributes inherited from smacc2::ISmaccComponent | |
ISmaccStateMachine * | stateMachine_ |
ISmaccClient * | owner_ |
Definition at line 55 of file waypoints_navigator.hpp.
cl_nav2z::WaypointNavigator::WaypointNavigator | ( | ) |
Definition at line 37 of file waypoints_navigator.cpp.
void cl_nav2z::WaypointNavigator::forward | ( | int | count | ) |
Definition at line 73 of file waypoints_navigator.cpp.
References currentWaypoint_, and waypoints_.
Referenced by cl_nav2z::CbSeekWaypoint::onEntry().
long cl_nav2z::WaypointNavigator::getCurrentWaypointIndex | ( | ) | const |
Definition at line 356 of file waypoints_navigator.cpp.
References currentWaypoint_.
Referenced by cl_nav2z::CbNavigateNextWaypoint::onEntry(), cl_nav2z::CbNavigateNextWaypointUntilReached::onNavigationActionSuccess(), and cl_nav2z::CpWaypointsVisualizer::update().
std::optional< std::string > cl_nav2z::WaypointNavigator::getCurrentWaypointName | ( | ) | const |
Definition at line 347 of file waypoints_navigator.cpp.
References currentWaypoint_, and waypointsNames_.
Referenced by cl_nav2z::CbNavigateNextWaypoint::onEntry(), and cl_nav2z::CbNavigateNextWaypointUntilReached::onNavigationActionSuccess().
std::optional< geometry_msgs::msg::Pose > cl_nav2z::WaypointNavigator::getNamedPose | ( | std::string | name | ) | const |
Definition at line 326 of file waypoints_navigator.cpp.
References waypoints_, and waypointsNames_.
const std::vector< std::string > & cl_nav2z::WaypointNavigator::getWaypointNames | ( | ) | const |
Definition at line 342 of file waypoints_navigator.cpp.
References waypointsNames_.
Referenced by cl_nav2z::CpWaypointsVisualizer::onInitialize().
const std::vector< geometry_msgs::msg::Pose > & cl_nav2z::WaypointNavigator::getWaypoints | ( | ) | const |
Definition at line 321 of file waypoints_navigator.cpp.
References waypoints_.
Referenced by cl_nav2z::CpWaypointsVisualizer::onInitialize().
|
private |
Definition at line 280 of file waypoints_navigator.cpp.
References waypoints_.
void cl_nav2z::WaypointNavigator::loadWayPointsFromFile | ( | std::string | filepath | ) |
Definition at line 359 of file waypoints_navigator.cpp.
References smacc2::ISmaccComponent::getLogger(), waypoints_, and waypointsNames_.
void cl_nav2z::WaypointNavigator::loadWayPointsFromFile2 | ( | std::string | filepath | ) |
Definition at line 432 of file waypoints_navigator.cpp.
References smacc2::ISmaccComponent::getLogger(), waypoints_, and waypointsNames_.
|
private |
Definition at line 48 of file waypoints_navigator.cpp.
References onNavigationRequestAborted, and stopWaitingResult().
Referenced by onNavigationResult().
|
private |
Definition at line 41 of file waypoints_navigator.cpp.
References onNavigationRequestCancelled, and stopWaitingResult().
Referenced by onNavigationResult().
|
private |
Definition at line 55 of file waypoints_navigator.cpp.
References currentWaypoint_, smacc2::ISmaccComponent::getLogger(), onNavigationRequestSucceded, cl_nav2z::WaypointEventDispatcher::postWaypointEvent(), stopWaitingResult(), and waypointsEventDispatcher.
Referenced by onNavigationResult().
|
overridevirtual |
Reimplemented from smacc2::ISmaccComponent.
Definition at line 39 of file waypoints_navigator.cpp.
References client_, and smacc2::ISmaccComponent::owner_.
|
private |
Definition at line 260 of file waypoints_navigator.cpp.
References onGoalAborted(), onGoalCancelled(), and onGoalReached().
Referenced by sendNextGoal().
|
inline |
Definition at line 67 of file waypoints_navigator.hpp.
References client_, cl_nav2z::WaypointEventDispatcher::initialize(), and waypointsEventDispatcher.
|
private |
Definition at line 313 of file waypoints_navigator.cpp.
References waypoints_.
void cl_nav2z::WaypointNavigator::rewind | ( | int | count | ) |
Definition at line 67 of file waypoints_navigator.cpp.
References currentWaypoint_.
void cl_nav2z::WaypointNavigator::seekName | ( | std::string | name | ) |
Definition at line 80 of file waypoints_navigator.cpp.
References currentWaypoint_, smacc2::ISmaccComponent::getLogger(), waypoints_, and waypointsNames_.
Referenced by cl_nav2z::CbNavigateNamedWaypoint::onEntry(), and cl_nav2z::CbSeekWaypoint::onEntry().
std::optional< std::shared_future< std::shared_ptr< rclcpp_action::ClientGoalHandle< nav2_msgs::action::NavigateToPose > > > > cl_nav2z::WaypointNavigator::sendNextGoal | ( | std::optional< NavigateNextWaypointOptions > | options = std::nullopt , |
cl_nav2z::ClNav2Z::SmaccNavigateResultSignal::WeakPtr | callback = cl_nav2z::ClNav2Z::SmaccNavigateResultSignal::WeakPtr() |
||
) |
Definition at line 155 of file waypoints_navigator.cpp.
References client_, smacc2::ISmaccStateMachine::createSignalConnection(), currentWaypoint_, smacc2::ISmaccClient::getComponent(), smacc2::ISmaccStateMachine::getCurrentState(), smacc2::ISmaccComponent::getLogger(), smacc2::ISmaccComponent::getName(), smacc2::ISmaccState::getName(), smacc2::ISmaccComponent::getStateMachine(), smacc2::ISmaccClient::getStateMachine(), onNavigationResult(), smacc2::ISmaccComponent::owner_, cl_nav2z::odom_tracker::RECORD_PATH, smacc2::client_bases::SmaccActionClientBase< ActionType >::sendGoal(), cl_nav2z::PlannerSwitcher::setDefaultPlanners(), succeddedNav2ZClientConnection_, cl_nav2z::Pose::toPoseMsg(), waypoints_, and waypointsNames_.
Referenced by cl_nav2z::CbNavigateNextWaypoint::onEntry().
void cl_nav2z::WaypointNavigator::setWaypoints | ( | const std::vector< geometry_msgs::msg::Pose > & | waypoints | ) |
Definition at line 288 of file waypoints_navigator.cpp.
References waypoints_.
void cl_nav2z::WaypointNavigator::setWaypoints | ( | const std::vector< Pose2D > & | waypoints | ) |
Definition at line 293 of file waypoints_navigator.cpp.
References waypoints_, and waypointsNames_.
void cl_nav2z::WaypointNavigator::stopWaitingResult | ( | ) |
Definition at line 143 of file waypoints_navigator.cpp.
References abortedNav2ZClientConnection_, cancelledNav2ZClientConnection_, and succeddedNav2ZClientConnection_.
Referenced by cl_nav2z::CbNavigateNextWaypoint::onExit(), onGoalAborted(), onGoalCancelled(), and onGoalReached().
|
private |
Definition at line 123 of file waypoints_navigator.hpp.
Referenced by stopWaitingResult().
|
private |
Definition at line 124 of file waypoints_navigator.hpp.
Referenced by stopWaitingResult().
ClNav2Z* cl_nav2z::WaypointNavigator::client_ |
Definition at line 60 of file waypoints_navigator.hpp.
Referenced by onInitialize(), onOrthogonalAllocation(), and sendNextGoal().
long cl_nav2z::WaypointNavigator::currentWaypoint_ |
Definition at line 96 of file waypoints_navigator.hpp.
Referenced by forward(), getCurrentWaypointIndex(), getCurrentWaypointName(), onGoalReached(), rewind(), seekName(), and sendNextGoal().
smacc2::SmaccSignal<void()> cl_nav2z::WaypointNavigator::onNavigationRequestAborted |
Definition at line 104 of file waypoints_navigator.hpp.
Referenced by onGoalAborted().
smacc2::SmaccSignal<void()> cl_nav2z::WaypointNavigator::onNavigationRequestCancelled |
Definition at line 105 of file waypoints_navigator.hpp.
Referenced by onGoalCancelled().
smacc2::SmaccSignal<void()> cl_nav2z::WaypointNavigator::onNavigationRequestSucceded |
Definition at line 103 of file waypoints_navigator.hpp.
Referenced by onGoalReached().
|
private |
Definition at line 122 of file waypoints_navigator.hpp.
Referenced by sendNextGoal(), and stopWaitingResult().
|
private |
Definition at line 118 of file waypoints_navigator.hpp.
Referenced by forward(), getNamedPose(), getWaypoints(), insertWaypoint(), loadWayPointsFromFile(), loadWayPointsFromFile2(), removeWaypoint(), seekName(), sendNextGoal(), and setWaypoints().
WaypointEventDispatcher cl_nav2z::WaypointNavigator::waypointsEventDispatcher |
Definition at line 58 of file waypoints_navigator.hpp.
Referenced by onGoalReached(), and onOrthogonalAllocation().
|
private |
Definition at line 120 of file waypoints_navigator.hpp.
Referenced by getCurrentWaypointName(), getNamedPose(), getWaypointNames(), loadWayPointsFromFile(), loadWayPointsFromFile2(), seekName(), sendNextGoal(), and setWaypoints().