15 #include <lex_common_msgs/KeyValue.h> 33 lex_common_msgs::AudioTextConversationResponse&
operator<<(lex_common_msgs::AudioTextConversationResponse& ros_response,
37 ros_response.intent_name = lex_response.
intent_name;
40 ros_response.slots = std::vector<lex_common_msgs::KeyValue>();
41 std::transform(lex_response.
slots.begin(), lex_response.
slots.end(),
42 std::back_inserter(ros_response.slots), [](
const std::pair<std::string, std::string>& slot) {
43 lex_common_msgs::KeyValue key_value;
44 key_value.key = slot.first;
45 key_value.value = slot.second;
56 return ErrorCode::INVALID_ARGUMENT;
61 return ErrorCode::SUCCESS;
65 lex_common_msgs::AudioTextConversationResponse & response)
68 lex_request << request;
70 bool is_success = !
post_content_->PostContent(lex_request, lex_response);
72 response << lex_response;
std::shared_ptr< PostContentInterface > post_content_
std::vector< uint8_t > audio_request
ServiceServer advertiseService(const std::string &service, bool(T::*srv_func)(MReq &, MRes &), T *obj)
ErrorCode Init(std::shared_ptr< PostContentInterface > lex_interactor)
bool LexServerCallback(lex_common_msgs::AudioTextConversationRequest &request, lex_common_msgs::AudioTextConversationResponse &response)
std::ostream & operator<<(std::ostream &os, const Aws::LexRuntimeService::Model::PostContentRequest &request)
std::string message_format_type
std::unordered_map< std::string, std::string > slots
ros::ServiceServer lex_server_
std::string text_response
std::vector< uint8_t > audio_response
ros::NodeHandle node_handle_