NASA Astrobee Robot Software  0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
command_conversion.h
Go to the documentation of this file.
1 /* Copyright (c) 2017, United States Government, as represented by the
2  * Administrator of the National Aeronautics and Space Administration.
3  *
4  * All rights reserved.
5  *
6  * The Astrobee platform is licensed under the Apache License, Version 2.0
7  * (the "License"); you may not use this file except in compliance with the
8  * License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15  * License for the specific language governing permissions and limitations
16  * under the License.
17  */
18 
19 
20 #ifndef EXECUTIVE_UTILS_SEQUENCER_COMMAND_CONVERSION_H_
21 #define EXECUTIVE_UTILS_SEQUENCER_COMMAND_CONVERSION_H_
22 
23 #include <memory>
24 #include <string>
25 #include <unordered_map>
26 
27 // Forward declarations
28 namespace jsonloader {
29 
30 class Command;
31 
32 } // namespace jsonloader
33 
34 namespace ff_msgs {
35 
36 template<class Allocator> struct CommandStamped_;
38 
39 } // namespace ff_msgs
40 
41 namespace sequencer {
42 namespace internal {
43 
44 // a function that takes plan command and generates a DDS-based command
45 // if the conversion is successful, return true. otherwise... don't.
46 using GenerateFn = bool (*)(const jsonloader::Command * plan_cmd,
48 
49 struct CommandInfo {
50  std::string name;
51  std::string subsystem;
53 };
54 
55 extern const std::unordered_map<std::string, CommandInfo> kCmdGenMap;
56 
57 } // namespace internal
58 } // namespace sequencer
59 
60 #endif // EXECUTIVE_UTILS_SEQUENCER_COMMAND_CONVERSION_H_
sequencer::internal::CommandInfo::name
std::string name
Definition: command_conversion.h:50
sequencer::internal::GenerateFn
bool(*)(const jsonloader::Command *plan_cmd, ff_msgs::CommandStamped *dds_cmd) GenerateFn
Definition: command_conversion.h:47
sequencer::internal::CommandInfo::fn
GenerateFn fn
Definition: command_conversion.h:52
jsonloader
Definition: command.h:28
ff_msgs::CommandStamped_
Definition: command_conversion.h:36
pmc_actuator::Command
Command
Definition: pmc_actuator.h:53
jsonloader::Command
Definition: command.h:30
sequencer::internal::CommandInfo::subsystem
std::string subsystem
Definition: command_conversion.h:51
sequencer::internal::CommandInfo
Definition: command_conversion.h:49
sequencer::internal::kCmdGenMap
const std::unordered_map< std::string, CommandInfo > kCmdGenMap
Definition: command_conversion.cc:303
ff_msgs
Definition: command_conversion.h:34
ff_msgs::CommandStamped
CommandStamped_< std::allocator< void > > CommandStamped
Definition: command_conversion.h:36
sequencer
Definition: command_conversion.h:41