SMACC2
|
#include <backward_local_planner.hpp>
Public Member Functions | |
BackwardLocalPlanner () | |
virtual | ~BackwardLocalPlanner () |
void | configure (const rclcpp_lifecycle::LifecycleNode::WeakPtr &parent, std::string name, const std::shared_ptr< tf2_ros::Buffer > &tf, const std::shared_ptr< nav2_costmap_2d::Costmap2DROS > &costmap_ros) override |
void | activate () override |
void | deactivate () override |
void | cleanup () override |
void | setPlan (const nav_msgs::msg::Path &path) override |
nav2_core setPlan - Sets the global plan More... | |
virtual geometry_msgs::msg::TwistStamped | computeVelocityCommands (const geometry_msgs::msg::PoseStamped &pose, const geometry_msgs::msg::Twist &velocity, nav2_core::GoalChecker *goal_checker) override |
nav2_core computeVelocityCommands - calculates the best command given the current pose and velocity More... | |
bool | isGoalReached () |
virtual void | setSpeedLimit (const double &speed_limit, const bool &percentage) override |
Private Member Functions | |
void | updateParameters () |
bool | findInitialCarrotGoal (geometry_msgs::msg::PoseStamped &pose) |
bool | updateCarrotGoal (const geometry_msgs::msg::PoseStamped &pose) |
bool | resamplePrecisePlan () |
void | straightBackwardsAndPureSpinCmd (const geometry_msgs::msg::PoseStamped &pose, double &vetta, double &gamma, double alpha_error, double betta_error, double rho_error) |
void | clearMarkers () |
void | publishGoalMarker (double x, double y, double phi) |
void | computeCurrentEuclideanAndAngularErrorsToCarrotGoal (const geometry_msgs::msg::PoseStamped &pose, double &dist, double &angular_error) |
bool | checkGoalReached (const geometry_msgs::msg::PoseStamped &pose, double vetta, double gamma, double alpha_error, geometry_msgs::msg::Twist &cmd_vel) |
bool | checkCurrentPoseInGoalRange (const geometry_msgs::msg::PoseStamped &tfpose, const geometry_msgs::msg::Twist ¤tTwist, double angle_error, bool &linearGoalReached, nav2_core::GoalChecker *goalChecker) |
bool | resetDivergenceDetection () |
bool | divergenceDetectionUpdate (const geometry_msgs::msg::PoseStamped &pose) |
bool | checkCarrotHalfPlainConstraint (const geometry_msgs::msg::PoseStamped &pose) |
void | generateTrajectory (const Eigen::Vector3f &pos, const Eigen::Vector3f &vel, float maxdist, float maxangle, float maxtime, float dt, std::vector< Eigen::Vector3f > &outtraj) |
Eigen::Vector3f | computeNewPositions (const Eigen::Vector3f &pos, const Eigen::Vector3f &vel, double dt) |
Private Attributes | |
rclcpp_lifecycle::LifecycleNode::SharedPtr | nh_ |
std::string | name_ |
std::vector< geometry_msgs::msg::PoseStamped > | backwardsPlanPath_ |
std::shared_ptr< nav2_costmap_2d::Costmap2DROS > | costmapRos_ |
std::shared_ptr< tf2_ros::Buffer > | tf_ |
std::shared_ptr< rclcpp_lifecycle::LifecyclePublisher< visualization_msgs::msg::MarkerArray > > | goalMarkerPublisher_ |
std::shared_ptr< rclcpp_lifecycle::LifecyclePublisher< nav_msgs::msg::Path > > | planPub_ |
double | k_rho_ |
double | k_alpha_ |
double | k_betta_ |
double | pure_spinning_allowed_betta_error_ |
double | linear_mode_rho_error_threshold_ |
const double | alpha_offset_ = M_PI |
const double | betta_offset_ = 0 |
double | max_linear_x_speed_ |
double | max_angular_z_speed_ |
double | yaw_goal_tolerance_ |
double | xy_goal_tolerance_ |
meter | carrot_distance_ |
rad | carrot_angular_distance_ |
meter | divergenceDetectionLastCarrotLinearDistance_ |
double | transform_tolerance_ |
rclcpp::Duration | waitingTimeout_ |
rclcpp::Time | waitingStamp_ |
bool | goalReached_ |
bool | initialPureSpinningStage_ |
bool | straightBackwardsAndPureSpinningMode_ = false |
bool | enable_obstacle_checking_ = true |
bool | inGoalPureSpinningState_ = false |
bool | waiting_ |
int | currentCarrotPoseIndex_ |
Definition at line 40 of file backward_local_planner.hpp.
cl_nav2z::backward_local_planner::BackwardLocalPlanner::BackwardLocalPlanner | ( | ) |
Definition at line 46 of file backward_local_planner.cpp.
|
virtual |
|
override |
Definition at line 55 of file backward_local_planner.cpp.
References backwardsPlanPath_, goalMarkerPublisher_, nh_, planPub_, and updateParameters().
|
private |
Definition at line 384 of file backward_local_planner.cpp.
References backwardsPlanPath_, currentCarrotPoseIndex_, and nh_.
Referenced by computeVelocityCommands().
|
private |
Definition at line 419 of file backward_local_planner.cpp.
References backwardsPlanPath_, nh_, xy_goal_tolerance_, and yaw_goal_tolerance_.
Referenced by computeVelocityCommands().
|
private |
|
override |
Definition at line 73 of file backward_local_planner.cpp.
References backwardsPlanPath_, clearMarkers(), currentCarrotPoseIndex_, and nh_.
|
private |
Definition at line 1166 of file backward_local_planner.cpp.
References costmapRos_, goalMarkerPublisher_, and nh_.
Referenced by cleanup(), and deactivate().
|
private |
auxiliary functions
Definition at line 244 of file backward_local_planner.cpp.
References backwardsPlanPath_, currentCarrotPoseIndex_, and nh_.
Referenced by divergenceDetectionUpdate(), findInitialCarrotGoal(), and updateCarrotGoal().
|
private |
Definition at line 1156 of file backward_local_planner.cpp.
Referenced by generateTrajectory().
|
overridevirtual |
nav2_core computeVelocityCommands - calculates the best command given the current pose and velocity
It is presumed that the global plan is already set.
This is mostly a wrapper for the protected computeVelocityCommands function which has additional debugging info.
pose | Current robot pose |
velocity | Current robot velocity |
Definition at line 469 of file backward_local_planner.cpp.
References alpha_offset_, backwardsPlanPath_, betta_offset_, checkCarrotHalfPlainConstraint(), checkCurrentPoseInGoalRange(), costmapRos_, currentCarrotPoseIndex_, enable_obstacle_checking_, generateTrajectory(), goalReached_, inGoalPureSpinningState_, k_alpha_, k_betta_, k_rho_, max_angular_z_speed_, max_linear_x_speed_, nh_, publishGoalMarker(), straightBackwardsAndPureSpinCmd(), straightBackwardsAndPureSpinningMode_, updateCarrotGoal(), updateParameters(), waiting_, waitingStamp_, waitingTimeout_, xy_goal_tolerance_, and yaw_goal_tolerance_.
|
override |
Definition at line 96 of file backward_local_planner.cpp.
References carrot_angular_distance_, carrot_distance_, costmapRos_, currentCarrotPoseIndex_, declareOrSet(), enable_obstacle_checking_, goalMarkerPublisher_, k_alpha_, k_betta_, k_rho_, linear_mode_rho_error_threshold_, max_angular_z_speed_, max_linear_x_speed_, name_, nh_, planPub_, service_node_3::s, straightBackwardsAndPureSpinningMode_, tf_, waitingTimeout_, xy_goal_tolerance_, and yaw_goal_tolerance_.
|
override |
Definition at line 65 of file backward_local_planner.cpp.
References clearMarkers(), goalMarkerPublisher_, nh_, and planPub_.
|
private |
Definition at line 347 of file backward_local_planner.cpp.
References computeCurrentEuclideanAndAngularErrorsToCarrotGoal(), divergenceDetectionLastCarrotLinearDistance_, and nh_.
Referenced by setPlan().
|
private |
Definition at line 864 of file backward_local_planner.cpp.
References backwardsPlanPath_, carrot_angular_distance_, carrot_distance_, computeCurrentEuclideanAndAngularErrorsToCarrotGoal(), currentCarrotPoseIndex_, and nh_.
Referenced by setPlan().
|
private |
Definition at line 1091 of file backward_local_planner.cpp.
References computeNewPositions().
Referenced by computeVelocityCommands().
bool cl_nav2z::backward_local_planner::BackwardLocalPlanner::isGoalReached | ( | ) |
Definition at line 858 of file backward_local_planner.cpp.
References goalReached_, and nh_.
|
private |
Definition at line 1188 of file backward_local_planner.cpp.
References costmapRos_, goalMarkerPublisher_, nh_, and service_node_3::s.
Referenced by computeVelocityCommands().
|
private |
Definition at line 929 of file backward_local_planner.cpp.
References backwardsPlanPath_, carrot_angular_distance_, carrot_distance_, and nh_.
Referenced by setPlan().
|
private |
Definition at line 340 of file backward_local_planner.cpp.
References divergenceDetectionLastCarrotLinearDistance_.
Referenced by setPlan(), and updateCarrotGoal().
|
override |
nav2_core setPlan - Sets the global plan
path | The global plan |
Definition at line 1019 of file backward_local_planner.cpp.
References backwardsPlanPath_, costmapRos_, currentCarrotPoseIndex_, divergenceDetectionUpdate(), findInitialCarrotGoal(), goalReached_, inGoalPureSpinningState_, nh_, planPub_, resamplePrecisePlan(), resetDivergenceDetection(), tf_, and transform_tolerance_.
|
overridevirtual |
Definition at line 231 of file backward_local_planner.cpp.
References nh_.
|
private |
pureSpinningCmd()
Definition at line 448 of file backward_local_planner.cpp.
References k_alpha_, k_betta_, k_rho_, linear_mode_rho_error_threshold_, and yaw_goal_tolerance_.
Referenced by computeVelocityCommands().
|
private |
Definition at line 278 of file backward_local_planner.cpp.
References backwardsPlanPath_, carrot_angular_distance_, carrot_distance_, computeCurrentEuclideanAndAngularErrorsToCarrotGoal(), currentCarrotPoseIndex_, nh_, resetDivergenceDetection(), and xy_goal_tolerance_.
Referenced by computeVelocityCommands().
|
private |
Definition at line 168 of file backward_local_planner.cpp.
References carrot_angular_distance_, carrot_distance_, enable_obstacle_checking_, k_alpha_, k_betta_, k_rho_, linear_mode_rho_error_threshold_, max_angular_z_speed_, max_linear_x_speed_, name_, nh_, straightBackwardsAndPureSpinningMode_, cl_nav2z::backward_local_planner::tryGetOrSet(), xy_goal_tolerance_, and yaw_goal_tolerance_.
Referenced by activate(), and computeVelocityCommands().
|
private |
Definition at line 142 of file backward_local_planner.hpp.
Referenced by computeVelocityCommands().
|
private |
Definition at line 127 of file backward_local_planner.hpp.
Referenced by activate(), checkCarrotHalfPlainConstraint(), checkCurrentPoseInGoalRange(), cleanup(), computeCurrentEuclideanAndAngularErrorsToCarrotGoal(), computeVelocityCommands(), findInitialCarrotGoal(), resamplePrecisePlan(), setPlan(), and updateCarrotGoal().
|
private |
Definition at line 143 of file backward_local_planner.hpp.
Referenced by computeVelocityCommands().
|
private |
Definition at line 152 of file backward_local_planner.hpp.
Referenced by configure(), findInitialCarrotGoal(), resamplePrecisePlan(), updateCarrotGoal(), and updateParameters().
|
private |
Definition at line 151 of file backward_local_planner.hpp.
Referenced by configure(), findInitialCarrotGoal(), resamplePrecisePlan(), updateCarrotGoal(), and updateParameters().
|
private |
Definition at line 128 of file backward_local_planner.hpp.
Referenced by clearMarkers(), computeVelocityCommands(), configure(), publishGoalMarker(), and setPlan().
|
private |
Definition at line 169 of file backward_local_planner.hpp.
Referenced by checkCarrotHalfPlainConstraint(), cleanup(), computeCurrentEuclideanAndAngularErrorsToCarrotGoal(), computeVelocityCommands(), configure(), findInitialCarrotGoal(), setPlan(), and updateCarrotGoal().
|
private |
Definition at line 153 of file backward_local_planner.hpp.
Referenced by divergenceDetectionUpdate(), and resetDivergenceDetection().
|
private |
Definition at line 164 of file backward_local_planner.hpp.
Referenced by computeVelocityCommands(), configure(), and updateParameters().
|
private |
Definition at line 132 of file backward_local_planner.hpp.
Referenced by activate(), clearMarkers(), configure(), deactivate(), and publishGoalMarker().
|
private |
Definition at line 161 of file backward_local_planner.hpp.
Referenced by computeVelocityCommands(), isGoalReached(), and setPlan().
|
private |
Definition at line 165 of file backward_local_planner.hpp.
Referenced by computeVelocityCommands(), and setPlan().
|
private |
Definition at line 162 of file backward_local_planner.hpp.
|
private |
Definition at line 137 of file backward_local_planner.hpp.
Referenced by computeVelocityCommands(), configure(), straightBackwardsAndPureSpinCmd(), and updateParameters().
|
private |
Definition at line 138 of file backward_local_planner.hpp.
Referenced by computeVelocityCommands(), configure(), straightBackwardsAndPureSpinCmd(), and updateParameters().
|
private |
Definition at line 136 of file backward_local_planner.hpp.
Referenced by computeVelocityCommands(), configure(), straightBackwardsAndPureSpinCmd(), and updateParameters().
|
private |
Definition at line 140 of file backward_local_planner.hpp.
Referenced by configure(), straightBackwardsAndPureSpinCmd(), and updateParameters().
|
private |
Definition at line 146 of file backward_local_planner.hpp.
Referenced by computeVelocityCommands(), configure(), and updateParameters().
|
private |
Definition at line 145 of file backward_local_planner.hpp.
Referenced by computeVelocityCommands(), configure(), and updateParameters().
|
private |
Definition at line 125 of file backward_local_planner.hpp.
Referenced by configure(), and updateParameters().
|
private |
Definition at line 124 of file backward_local_planner.hpp.
Referenced by activate(), checkCarrotHalfPlainConstraint(), checkCurrentPoseInGoalRange(), cleanup(), clearMarkers(), computeCurrentEuclideanAndAngularErrorsToCarrotGoal(), computeVelocityCommands(), configure(), deactivate(), divergenceDetectionUpdate(), findInitialCarrotGoal(), isGoalReached(), publishGoalMarker(), resamplePrecisePlan(), setPlan(), setSpeedLimit(), updateCarrotGoal(), and updateParameters().
|
private |
Definition at line 133 of file backward_local_planner.hpp.
Referenced by activate(), configure(), deactivate(), and setPlan().
|
private |
Definition at line 139 of file backward_local_planner.hpp.
|
private |
Definition at line 163 of file backward_local_planner.hpp.
Referenced by computeVelocityCommands(), configure(), and updateParameters().
|
private |
Definition at line 129 of file backward_local_planner.hpp.
Referenced by configure(), and setPlan().
|
private |
Definition at line 155 of file backward_local_planner.hpp.
Referenced by setPlan().
|
private |
Definition at line 166 of file backward_local_planner.hpp.
Referenced by computeVelocityCommands().
|
private |
Definition at line 158 of file backward_local_planner.hpp.
Referenced by computeVelocityCommands().
|
private |
Definition at line 157 of file backward_local_planner.hpp.
Referenced by computeVelocityCommands(), and configure().
|
private |
Definition at line 149 of file backward_local_planner.hpp.
Referenced by checkCurrentPoseInGoalRange(), computeVelocityCommands(), configure(), updateCarrotGoal(), and updateParameters().
|
private |
Definition at line 148 of file backward_local_planner.hpp.
Referenced by checkCurrentPoseInGoalRange(), computeVelocityCommands(), configure(), straightBackwardsAndPureSpinCmd(), and updateParameters().