#include <pomdp.h>
Public Member Functions | |
void | mainLoop (void) |
main node thread | |
Pomdp () | |
constructor | |
Private Member Functions | |
bool | execution_flow_controlCallback (std_srvs::Empty::Request &req, std_srvs::Empty::Response &res) |
void | pomdp_action2wam_action (int pomdp_action, int &wam_action, int &zone, int &hand) |
void | publish_belief () |
Private Attributes | |
int | actioncount |
iri_wam_common_msgs::belief | belief_msg |
ros::Publisher | belief_publisher |
iri_wam_common_msgs::belief_summary | belief_summary_msg |
ros::Publisher | belief_summary_publisher |
bool | execution_flag |
ros::ServiceServer | execution_flow_control_server |
CMutex | execution_mutex |
ros::Publisher | focused_obj_label_publisher |
Policy * | myPolicy |
ros::NodeHandle | node_handle_ |
std_msgs::Int32 | ObjLabel_msg |
ros::ServiceClient | obs_client |
iri_wam_common_msgs::obs_request | obs_request_srv |
std::vector< int > | probablestates |
ros::ServiceClient | wam_action_client |
iri_wam_common_msgs::wamaction | wam_actions_client_srv |
Pomdp::Pomdp | ( | ) |
constructor
This constructor mainly creates and initializes the WamActions topics through the given NodeHandle object. CIriNode attributes may be also modified to suit node specifications.
All kind of ROS topics (publishers, subscribers, servers or clients) can be easyly generated with the scripts in the iri_ros_scripts package. Refer to ROS and IRI Wiki pages for more details:
http://www.ros.org/wiki/ROS/Tutorials/WritingPublisherSubscriber(c++) http://www.ros.org/wiki/ROS/Tutorials/WritingServiceClient(c++) http://wikiri.upc.es/index.php/Robotics_Lab
nh | a reference to the node handle object to manage all ROS topics. |
bool Pomdp::execution_flow_controlCallback | ( | std_srvs::Empty::Request & | req, |
std_srvs::Empty::Response & | res | ||
) | [private] |
void Pomdp::mainLoop | ( | void | ) |
main node thread
This is the main thread node function. Code written here will be executed in every node loop while the driver is on running state. Loop frequency can be tuned my modifying loop_rate attribute.
Here data related to the process loop or to ROS topics (mainly data structs related to the MSG and SRV files) must be updated. ROS publisher objects must publish their data in this process. ROS client servers may also request data to the corresponding server topics.
void Pomdp::pomdp_action2wam_action | ( | int | pomdp_action, |
int & | wam_action, | ||
int & | zone, | ||
int & | hand | ||
) | [private] |
void Pomdp::publish_belief | ( | ) | [private] |
int Pomdp::actioncount [private] |
iri_wam_common_msgs::belief Pomdp::belief_msg [private] |
ros::Publisher Pomdp::belief_publisher [private] |
iri_wam_common_msgs::belief_summary Pomdp::belief_summary_msg [private] |
bool Pomdp::execution_flag [private] |
CMutex Pomdp::execution_mutex [private] |
Policy* Pomdp::myPolicy [private] |
ros::NodeHandle Pomdp::node_handle_ [private] |
std_msgs::Int32 Pomdp::ObjLabel_msg [private] |
ros::ServiceClient Pomdp::obs_client [private] |
iri_wam_common_msgs::obs_request Pomdp::obs_request_srv [private] |
std::vector<int> Pomdp::probablestates [private] |
ros::ServiceClient Pomdp::wam_action_client [private] |
iri_wam_common_msgs::wamaction Pomdp::wam_actions_client_srv [private] |