Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
map.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <map>
4#include <memory>
5#include <string>
6
7#include "adapter/eufs.hpp"
8#include "adapter/pacsim.hpp"
9#include "adapter/vehicle.hpp"
10#include "ros_node/ros_node.hpp"
11
12/*
13 * Map of control adapters, with the key being the type of the adapter and the value being a lambda
14 * function that creates the adapter
15 */
16const std::map<std::string, std::function<std::shared_ptr<ControlNode>(const ControlParameters&)>,
17 std::less<>>
18 adapter_map = {{"pacsim",
19 [](const ControlParameters& params) -> std::shared_ptr<ControlNode> {
20 return std::make_shared<PacSimAdapter>(params);
21 }},
22 {"vehicle",
23 [](const ControlParameters& params) -> std::shared_ptr<ControlNode> {
24 return std::make_shared<VehicleAdapter>(params);
25 }},
26 {"eufs", [](const ControlParameters& params) -> std::shared_ptr<ControlNode> {
27 return std::make_shared<EufsAdapter>(params);
28 }}};
const std::map< std::string, std::function< std::shared_ptr< ControlNode >(const ControlParameters &)>, std::less<> > adapter_map
Definition map.hpp:18