int main()

in lex_node/src/main.cpp [42:73]


int main(int argc, char *argv[]) {
  ros::init(argc, argv, "lex_node");

  Aws::Utils::Logging::InitializeAWSLogging(
      Aws::MakeShared<Aws::Utils::Logging::AWSROSLogger>("lex_node"));
  Aws::SDKOptions options;
  Aws::InitAPI(options);

  Aws::Lex::LexNode lex_node;
  {
    // Build a lex interactor and give it to the lex node to use it.
    // Lex has an internal conversation session, therefore the lex interactor
    // should only be available for use by one point of entry.
    auto lex_interactor = std::make_shared<Aws::Lex::LexInteractor>();
    auto params = std::make_shared<Aws::Client::Ros1NodeParameterReader>();
    auto error_code = Aws::Lex::BuildLexInteractor(params, *lex_interactor);
    if (error_code != Aws::Lex::ErrorCode::SUCCESS) {
      shutdown(options);
      return error_code;
    }
    lex_node.Init(std::move(lex_interactor));
  }
  AWS_LOG_INFO(__func__, "Starting Lex Node...");

  // blocking here, waiting until shutdown.
  ros::spin();

  AWS_LOG_INFO(__func__, "Shutting down Lex Node...");
  shutdown(options);

  return Aws::Lex::ErrorCode::SUCCESS;
}