Public Member Functions | Private Member Functions | Private Attributes | List of all members
rsm::WaypointFollowingVisualization Class Reference

Class for visualizing waypoints as interactive markers in RViz and handling their interaction. More...

#include <WaypointFollowingVisualization.h>

Public Member Functions

 WaypointFollowingVisualization ()
 
 ~WaypointFollowingVisualization ()
 

Private Member Functions

void addWaypointMarkerToServer (int waypoint_pos)
 
void periodicalRefreshTimerCallback (const ros::TimerEvent &event)
 
void processFeedback (const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback)
 
void removeWaypoint (const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback)
 
void setWaypointRoutine (const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback)
 
void timerCallback (const ros::TimerEvent &event)
 
bool waypointArrayChanged (const rsm_msgs::WaypointArray::ConstPtr &waypoint_array)
 
void waypointCallback (const rsm_msgs::WaypointArray::ConstPtr &waypoint_array)
 

Private Attributes

ros::ServiceClient _get_waypoint_routines_client
 
interactive_markers::MenuHandler _menu_handler
 
ros::ServiceClient _move_waypoint_client
 
ros::Timer _periodical_refresh_timer
 
bool _refresh_waypoint_markers
 
ros::ServiceClient _remove_waypoint_client
 
interactive_markers::MenuHandler::EntryHandle _routine_switch_handler
 
ros::Timer _service_call_delay_timer
 
ros::ServiceClient _set_waypoint_routine_client
 
std::vector< std::string > _waypoint_routines
 
interactive_markers::InteractiveMarkerServer _waypoint_server
 
ros::Subscriber _waypoint_subscriber
 
rsm_msgs::WaypointArray _waypoints
 

Detailed Description

Class for visualizing waypoints as interactive markers in RViz and handling their interaction.

Definition at line 19 of file WaypointFollowingVisualization.h.

Constructor & Destructor Documentation

rsm::WaypointFollowingVisualization::WaypointFollowingVisualization ( )

Constructor

Definition at line 5 of file WaypointFollowingVisualization.cpp.

rsm::WaypointFollowingVisualization::~WaypointFollowingVisualization ( )

Desctructor

Definition at line 31 of file WaypointFollowingVisualization.cpp.

Member Function Documentation

void rsm::WaypointFollowingVisualization::addWaypointMarkerToServer ( int  waypoint_pos)
private

Draws the interactive marker for the waypoints with position waypoint_pos in the waypoint array

Parameters
waypoint_posPosition in the waypoint array of the waypoint to visualize

Definition at line 85 of file WaypointFollowingVisualization.cpp.

void rsm::WaypointFollowingVisualization::periodicalRefreshTimerCallback ( const ros::TimerEvent event)
private

Timer callback for periodically refreshing the displayed markers

Parameters
eventTimer event

Definition at line 198 of file WaypointFollowingVisualization.cpp.

void rsm::WaypointFollowingVisualization::processFeedback ( const visualization_msgs::InteractiveMarkerFeedbackConstPtr &  feedback)
private

Method being called when moving the marker and changing it's position in the array calling ServiceProvider's service

Parameters
feedback

Definition at line 34 of file WaypointFollowingVisualization.cpp.

void rsm::WaypointFollowingVisualization::removeWaypoint ( const visualization_msgs::InteractiveMarkerFeedbackConstPtr &  feedback)
private

Method being called when selecting delete from the marker's menu, deletes the waypoint from the array calling ServiceProvider's service

Parameters
feedbackFeedback object generated from click

Definition at line 46 of file WaypointFollowingVisualization.cpp.

void rsm::WaypointFollowingVisualization::setWaypointRoutine ( const visualization_msgs::InteractiveMarkerFeedbackConstPtr &  feedback)
private

Method being called when selecting a routine from the marker's menu, changes the routine for the respective waypoint from the array calling ServiceProvider's service

Parameters
feedbackFeedback object generated from click

Definition at line 57 of file WaypointFollowingVisualization.cpp.

void rsm::WaypointFollowingVisualization::timerCallback ( const ros::TimerEvent event)
private

Timer callback for one-shot timer to initialize the menu handler with a delay, so the ServiceProvider's services will be available

Parameters
eventTimer event

Definition at line 158 of file WaypointFollowingVisualization.cpp.

bool rsm::WaypointFollowingVisualization::waypointArrayChanged ( const rsm_msgs::WaypointArray::ConstPtr &  waypoint_array)
private

Compare if waypoints send from the ServiceProvider match the ones here regarding array length, routine, visited- and unreachable-status.

Parameters
waypoint_arrayreceived from ServiceProvider
Returns
True if the waypoint array has changed, false otherwise

Definition at line 179 of file WaypointFollowingVisualization.cpp.

void rsm::WaypointFollowingVisualization::waypointCallback ( const rsm_msgs::WaypointArray::ConstPtr &  waypoint_array)
private

Callback for receiving the waypoint array published by the ServiceProvider

Parameters
waypoint_array

Definition at line 72 of file WaypointFollowingVisualization.cpp.

Member Data Documentation

ros::ServiceClient rsm::WaypointFollowingVisualization::_get_waypoint_routines_client
private

Definition at line 93 of file WaypointFollowingVisualization.h.

interactive_markers::MenuHandler rsm::WaypointFollowingVisualization::_menu_handler
private

Definition at line 86 of file WaypointFollowingVisualization.h.

ros::ServiceClient rsm::WaypointFollowingVisualization::_move_waypoint_client
private

Definition at line 90 of file WaypointFollowingVisualization.h.

ros::Timer rsm::WaypointFollowingVisualization::_periodical_refresh_timer
private

Timer to periodically refresh the drawn markers to synchronize with the waypoint array in case of high system load

Definition at line 114 of file WaypointFollowingVisualization.h.

bool rsm::WaypointFollowingVisualization::_refresh_waypoint_markers
private

If the waypoint markers should be redrawn on the next callback

Definition at line 106 of file WaypointFollowingVisualization.h.

ros::ServiceClient rsm::WaypointFollowingVisualization::_remove_waypoint_client
private

Definition at line 91 of file WaypointFollowingVisualization.h.

interactive_markers::MenuHandler::EntryHandle rsm::WaypointFollowingVisualization::_routine_switch_handler
private

Definition at line 87 of file WaypointFollowingVisualization.h.

ros::Timer rsm::WaypointFollowingVisualization::_service_call_delay_timer
private

Timer to call menu handle initialization with a delay so ServiceProvider's services will be available

Definition at line 110 of file WaypointFollowingVisualization.h.

ros::ServiceClient rsm::WaypointFollowingVisualization::_set_waypoint_routine_client
private

Definition at line 92 of file WaypointFollowingVisualization.h.

std::vector<std::string> rsm::WaypointFollowingVisualization::_waypoint_routines
private

List of all available waypoint routines

Definition at line 102 of file WaypointFollowingVisualization.h.

interactive_markers::InteractiveMarkerServer rsm::WaypointFollowingVisualization::_waypoint_server
private

Definition at line 85 of file WaypointFollowingVisualization.h.

ros::Subscriber rsm::WaypointFollowingVisualization::_waypoint_subscriber
private

Definition at line 89 of file WaypointFollowingVisualization.h.

rsm_msgs::WaypointArray rsm::WaypointFollowingVisualization::_waypoints
private

Waypoint array

Definition at line 98 of file WaypointFollowingVisualization.h.


The documentation for this class was generated from the following files:


rsm_rviz_plugins
Author(s): Marco Steinbrink
autogenerated on Tue Mar 16 2021 02:44:40