Apollo 10.0
自动驾驶开放平台
sim_control_manager.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2017 The Apollo Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16
17#pragma once
18
19#include <limits>
20#include <memory>
21#include <string>
22
23#include "cyber/cyber.h"
24#include "cyber/common/macros.h"
29
34namespace apollo {
35namespace dreamview {
36
41 public:
42 bool IsEnabled() const { return enabled_; }
43 nlohmann::json LoadDynamicModels();
44 bool AddDynamicModel(const std::string &dynamic_model_name);
45 bool ChangeDynamicModel(const std::string &dynamic_model_name);
46 bool DeleteDynamicModel(const std::string &dynamic_model_name);
47 void ResetDynamicModel();
48 void Restart(double x, double y, double v = 0.0, double a = 0.0);
49 void ReSetPoinstion(double x, double y, double heading);
50 void Restart();
51 void Reset();
52
53 virtual ~SimControlManager() { Stop(); }
54
55 std::string Name() const;
56
57 void RunOnce();
58
63 bool Init(bool set_start_point, double start_velocity = 0.0,
64 double start_acceleration = 0.0,
65 double start_heading = std::numeric_limits<double>::max());
66
70 void Start();
71
75 void Stop();
76
77 private:
78 SimControlBase *model_ptr_ = nullptr;
79 std::string current_dynamic_model_ = "";
80 bool enabled_ = false;
81
83};
84
85} // namespace dreamview
86} // namespace apollo
Interface of simulated control algorithm
bool DeleteDynamicModel(const std::string &dynamic_model_name)
bool AddDynamicModel(const std::string &dynamic_model_name)
bool Init(bool set_start_point, double start_velocity=0.0, double start_acceleration=0.0, double start_heading=std::numeric_limits< double >::max())
module initialization function
bool ChangeDynamicModel(const std::string &dynamic_model_name)
void ReSetPoinstion(double x, double y, double heading)
#define DECLARE_SINGLETON(classname)
Definition macros.h:52
class register implement
Definition arena_queue.h:37