#include <mesh_controller.h>
Public Types | |
typedef boost::shared_ptr< mesh_controller::MeshController > | Ptr |
shared pointer typedef to simplify pointer access of the mesh controller More... | |
![]() | |
typedef boost::shared_ptr< mbf_mesh_core::MeshController > | Ptr |
![]() | |
typedef boost::shared_ptr< ::mbf_abstract_core::AbstractController > | Ptr |
Public Member Functions | |
virtual bool | cancel () |
Requests the planner to cancel, e.g. if it takes too much time. More... | |
virtual uint32_t | computeVelocityCommands (const geometry_msgs::PoseStamped &pose, const geometry_msgs::TwistStamped &velocity, geometry_msgs::TwistStamped &cmd_vel, std::string &message) |
Given the current position, orientation, and velocity of the robot, compute the next velocity commands to move the robot towards the goal. More... | |
float | gaussValue (const float &sigma_squared, const float &value) |
virtual bool | initialize (const std::string &plugin_name, const boost::shared_ptr< tf2_ros::Buffer > &tf_ptr, const boost::shared_ptr< mesh_map::MeshMap > &mesh_map_ptr) |
Initializes the controller plugin with a name, a tf pointer and a mesh map pointer. More... | |
virtual bool | isGoalReached (double dist_tolerance, double angle_tolerance) |
Checks if the robot reached to goal pose. More... | |
MeshController () | |
Constructor. More... | |
std::array< float, 2 > | naiveControl (const mesh_map::Vector &robot_pos, const mesh_map::Normal &robot_dir, const mesh_map::Vector &mesh_dir, const mesh_map::Normal &mesh_normal, const float &mesh_cost) |
mesh_map::Normal | poseToDirectionVector (const geometry_msgs::PoseStamped &pose, const tf2::Vector3 &axis=tf2::Vector3(1, 0, 0)) |
mesh_map::Vector | poseToPositionVector (const geometry_msgs::PoseStamped &pose) |
void | reconfigureCallback (mesh_controller::MeshControllerConfig &cfg, uint32_t level) |
reconfigure callback function which is called if a dynamic reconfiguration were triggered. More... | |
virtual bool | setPlan (const std::vector< geometry_msgs::PoseStamped > &plan) |
Sets the current plan to follow, it also sets the vector field. More... | |
virtual | ~MeshController () |
Destructor. More... | |
![]() | |
virtual | ~AbstractController () |
Private Attributes | |
ros::Publisher | angle_pub |
publishes the angle between the robots orientation and the goal vector field for debug purposes More... | |
std::atomic_bool | cancel_requested |
flag to handle cancel requests More... | |
MeshControllerConfig | config |
current mesh controller configuration More... | |
dynamic_reconfigure::Server< mesh_controller::MeshControllerConfig >::CallbackType | config_callback |
dynamic reconfigure callback function binding More... | |
lvr2::OptionalFaceHandle | current_face |
The triangle on which the robot is located. More... | |
vector< geometry_msgs::PoseStamped > | current_plan |
the current set plan More... | |
mesh_map::Normal | goal_dir |
the goal's and robot's orientation More... | |
mesh_map::Vector | goal_pos |
the goal and robot pose More... | |
boost::shared_ptr< mesh_map::MeshMap > | map_ptr |
shared pointer to the used mesh map More... | |
boost::shared_ptr< dynamic_reconfigure::Server< mesh_controller::MeshControllerConfig > > | reconfigure_server_ptr |
shared pointer to dynamic reconfigure server More... | |
mesh_map::Normal | robot_dir |
mesh_map::Vector | robot_pos |
lvr2::DenseVertexMap< mesh_map::Vector > | vector_map |
The vector field to the goal. More... | |
Additional Inherited Members | |
![]() | |
MeshController () | |
![]() | |
AbstractController () | |
Definition at line 46 of file mesh_controller.h.
shared pointer typedef to simplify pointer access of the mesh controller
Definition at line 51 of file mesh_controller.h.
mesh_controller::MeshController::MeshController | ( | ) |
Constructor.
Definition at line 61 of file mesh_controller.cpp.
|
virtual |
Destructor.
Reimplemented from mbf_mesh_core::MeshController.
Definition at line 65 of file mesh_controller.cpp.
|
virtual |
Requests the planner to cancel, e.g. if it takes too much time.
Implements mbf_mesh_core::MeshController.
Definition at line 197 of file mesh_controller.cpp.
|
virtual |
Given the current position, orientation, and velocity of the robot, compute the next velocity commands to move the robot towards the goal.
pose | The current pose of the robot |
velocity | The current velocity of the robot |
cmd_vel | Computed velocity command |
message | Detailed outcome as string message |
Implements mbf_mesh_core::MeshController.
Definition at line 69 of file mesh_controller.cpp.
float mesh_controller::MeshController::gaussValue | ( | const float & | sigma_squared, |
const float & | value | ||
) |
A normal distribution / gaussian function
sigma_squared | The squared sigma / variance |
value | The value to be evaluated |
Definition at line 217 of file mesh_controller.cpp.
|
virtual |
Initializes the controller plugin with a name, a tf pointer and a mesh map pointer.
plugin_name | The controller plugin name, defined by the user. It defines the controller namespace |
tf_ptr | A shared pointer to a transformation buffer |
mesh_map_ptr | A shared pointer to the mesh map |
Implements mbf_mesh_core::MeshController.
Definition at line 246 of file mesh_controller.cpp.
|
virtual |
Checks if the robot reached to goal pose.
pose | The current pose of the robot |
angle_tolerance | The angle tolerance in which the current pose will be partly accepted as reached goal |
dist_tolerance | The distance tolerance in which the current pose will be partly accepted as reached goal |
Implements mbf_mesh_core::MeshController.
Definition at line 174 of file mesh_controller.cpp.
std::array< float, 2 > mesh_controller::MeshController::naiveControl | ( | const mesh_map::Vector & | robot_pos, |
const mesh_map::Normal & | robot_dir, | ||
const mesh_map::Vector & | mesh_dir, | ||
const mesh_map::Normal & | mesh_normal, | ||
const float & | mesh_cost | ||
) |
Computes the angular and linear velocity
robot_pos | robot position |
robot_dir | robot orientation |
mesh_dir | supposed orientation |
mesh_cost | cost value at robot position |
Definition at line 222 of file mesh_controller.cpp.
mesh_map::Normal mesh_controller::MeshController::poseToDirectionVector | ( | const geometry_msgs::PoseStamped & | pose, |
const tf2::Vector3 & | axis = tf2::Vector3(1,0,0) |
||
) |
Converts the orientation of a geometry_msgs/PoseStamped message to a direction vector
pose | the pose to convert |
Definition at line 204 of file mesh_controller.cpp.
mesh_map::Vector mesh_controller::MeshController::poseToPositionVector | ( | const geometry_msgs::PoseStamped & | pose | ) |
Converts the position of a geometry_msgs/PoseStamped message to a position vector
pose | the pose to convert |
Definition at line 212 of file mesh_controller.cpp.
void mesh_controller::MeshController::reconfigureCallback | ( | mesh_controller::MeshControllerConfig & | cfg, |
uint32_t | level | ||
) |
reconfigure callback function which is called if a dynamic reconfiguration were triggered.
Definition at line 241 of file mesh_controller.cpp.
|
virtual |
Sets the current plan to follow, it also sets the vector field.
plan | The plan to follow |
Implements mbf_mesh_core::MeshController.
Definition at line 181 of file mesh_controller.cpp.
|
private |
publishes the angle between the robots orientation and the goal vector field for debug purposes
Definition at line 186 of file mesh_controller.h.
|
private |
flag to handle cancel requests
Definition at line 189 of file mesh_controller.h.
|
private |
current mesh controller configuration
Definition at line 183 of file mesh_controller.h.
|
private |
dynamic reconfigure callback function binding
Definition at line 180 of file mesh_controller.h.
|
private |
The triangle on which the robot is located.
Definition at line 171 of file mesh_controller.h.
|
private |
the current set plan
Definition at line 162 of file mesh_controller.h.
|
private |
the goal's and robot's orientation
Definition at line 168 of file mesh_controller.h.
|
private |
the goal and robot pose
Definition at line 165 of file mesh_controller.h.
|
private |
shared pointer to the used mesh map
Definition at line 159 of file mesh_controller.h.
|
private |
shared pointer to dynamic reconfigure server
Definition at line 177 of file mesh_controller.h.
|
private |
Definition at line 168 of file mesh_controller.h.
|
private |
Definition at line 165 of file mesh_controller.h.
|
private |
The vector field to the goal.
Definition at line 174 of file mesh_controller.h.