SMACC2
Loading...
Searching...
No Matches
Public Member Functions | List of all members
cl_nitrosz::CbSaveSlamMap Struct Reference

#include <cb_save_slam_map.hpp>

Inheritance diagram for cl_nitrosz::CbSaveSlamMap:
Inheritance graph
Collaboration diagram for cl_nitrosz::CbSaveSlamMap:
Collaboration graph

Public Member Functions

 CbSaveSlamMap ()
 
void onExit () override
 
std::shared_ptr< nav2_msgs::srv::SaveMap::Request > getRequest ()
 
- Public Member Functions inherited from smacc2::client_behaviors::CbServiceCall< ServiceType >
 CbServiceCall (const char *serviceName)
 
 CbServiceCall (const char *serviceName, std::shared_ptr< typename ServiceType::Request > request, std::chrono::milliseconds pollRate=100ms)
 
void onEntry () override
 
- Public Member Functions inherited from smacc2::SmaccAsyncClientBehavior
template<typename TOrthogonal , typename TSourceObject >
void onOrthogonalAllocation ()
 
virtual ~SmaccAsyncClientBehavior ()
 
template<typename TCallback , typename T >
boost::signals2::connection onSuccess (TCallback callback, T *object)
 
template<typename TCallback , typename T >
boost::signals2::connection onFinished (TCallback callback, T *object)
 
template<typename TCallback , typename T >
boost::signals2::connection onFailure (TCallback callback, T *object)
 
void requestForceFinish ()
 
void executeOnEntry () override
 
void executeOnExit () override
 
void waitOnEntryThread (bool requestFinish)
 
template<typename TCallbackMethod , typename T >
boost::signals2::connection onSuccess (TCallbackMethod callback, T *object)
 
template<typename TCallbackMethod , typename T >
boost::signals2::connection onFinished (TCallbackMethod callback, T *object)
 
template<typename TCallbackMethod , typename T >
boost::signals2::connection onFailure (TCallbackMethod callback, T *object)
 
- Public Member Functions inherited from smacc2::ISmaccClientBehavior
 ISmaccClientBehavior ()
 
virtual ~ISmaccClientBehavior ()
 
ISmaccStateMachinegetStateMachine ()
 
std::string getName () const
 
template<typename SmaccClientType >
void requiresClient (SmaccClientType *&storage)
 
template<typename SmaccComponentType >
void requiresComponent (SmaccComponentType *&storage, bool throwExceptionIfNotExist=false)
 

Additional Inherited Members

- Public Attributes inherited from smacc2::client_behaviors::CbServiceCall< ServiceType >
std::shared_future< std::shared_ptr< typename ServiceType::Response > > resultFuture_
 
std::shared_ptr< typename ServiceType::Response > result_
 
std::chrono::milliseconds pollRate_
 
- Protected Member Functions inherited from smacc2::client_behaviors::CbServiceCall< ServiceType >
virtual void onServiceResponse (std::shared_ptr< typename ServiceType::Response >)
 
- Protected Member Functions inherited from smacc2::SmaccAsyncClientBehavior
void postSuccessEvent ()
 
void postFailureEvent ()
 
virtual void dispose () override
 
bool isShutdownRequested ()
 onEntry is executed in a new thread. However the current state cannot be left until the onEntry thread finishes. This flag can be checked from the onEntry thread to force finishing the thread.
 
- Protected Member Functions inherited from smacc2::ISmaccClientBehavior
virtual void runtimeConfigure ()
 
template<typename EventType >
void postEvent (const EventType &ev)
 
template<typename EventType >
void postEvent ()
 
ISmaccStategetCurrentState ()
 
virtual rclcpp::Node::SharedPtr getNode () const
 
virtual rclcpp::Logger getLogger () const
 
- Protected Attributes inherited from smacc2::client_behaviors::CbServiceCall< ServiceType >
std::shared_ptr< rclcpp::Client< ServiceType > > client_
 
std::string serviceName_
 
std::shared_ptr< typename ServiceType::Request > request_
 

Detailed Description

Definition at line 35 of file cb_save_slam_map.hpp.

Constructor & Destructor Documentation

◆ CbSaveSlamMap()

cl_nitrosz::CbSaveSlamMap::CbSaveSlamMap ( )

Definition at line 37 of file cb_save_slam_map.cpp.

37 : CbServiceCall("/map_saver/save_map", getRequest())
38{
39 // : CbServiceCall("/slam_toolbox/save_map",
40 // getRequest()) {
41
42 // map_name.data = "saved_map";
43 // auto request = getRequest(map_name);
44 // RCLCPP_INFO_STREAM(getLogger(), "Save Slam Map builded");
45}
smacc2::client_behaviors::CbServiceCall< TService > CbServiceCall
std::shared_ptr< nav2_msgs::srv::SaveMap::Request > getRequest()

Member Function Documentation

◆ getRequest()

std::shared_ptr< nav2_msgs::srv::SaveMap::Request > cl_nitrosz::CbSaveSlamMap::getRequest ( )

Definition at line 51 of file cb_save_slam_map.cpp.

53{
54 nav2_msgs::srv::SaveMap_Request map_save;
55 std_msgs::msg::String map_name;
56
57 // // map_name.data = "saved_map";
58 // map_save.map_topic = "map";
59 // map_save.map_url = "${workspacesFolder}/maps/saved_map";
60 // map_save.image_format = "png";
61 // map_save.occupied_thresh = 0.65;
62 // map_save.free_thresh = 0.25;
63 // map_save.map_mode = "trinary";
64
65 // // auto request = std::make_shared<slam_toolbox::srv::SaveMap::Request>();
66 // // // request->name = saved_map_name;
67 // // request->name = map_name;
68 // // return request;
69 // auto request = std::make_shared<nav2_msgs::srv::SaveMap::Request>(map_save);
70
71 auto request = std::make_shared<nav2_msgs::srv::SaveMap::Request>();
72 request->map_topic = "map";
73 request->map_url = "/tmp/saved_map";
74 request->image_format = "png";
75 request->occupied_thresh = 0.65;
76 request->free_thresh = 0.25;
77 request->map_mode = "trinary";
78
79 return request;
80}

◆ onExit()

void cl_nitrosz::CbSaveSlamMap::onExit ( )
overridevirtual

Reimplemented from smacc2::ISmaccClientBehavior.

Definition at line 49 of file cb_save_slam_map.cpp.

49{}

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