-
Notifications
You must be signed in to change notification settings - Fork 668
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(simple_plannign_simulator): add map acc model (#5688)
* (simple_planning_simulator):add delay converter model Signed-off-by: Takumi Ito <[email protected]> * refactoring rename and format read acc map path from config Signed-off-by: kosuke55 <[email protected]> * update docs Signed-off-by: kosuke55 <[email protected]> * remove noisy print Signed-off-by: kosuke55 <[email protected]> * update map Signed-off-by: kosuke55 <[email protected]> * fix pre-commit Signed-off-by: kosuke55 <[email protected]> * update acc map Signed-off-by: kosuke55 <[email protected]> * fix pre-commit and typo Signed-off-by: kosuke55 <[email protected]> typo typo * Update simulator/simple_planning_simulator/README.md Co-authored-by: Takamasa Horibe <[email protected]> * Update simulator/simple_planning_simulator/README.md Co-authored-by: Takamasa Horibe <[email protected]> * Update simulator/simple_planning_simulator/README.md Co-authored-by: Takamasa Horibe <[email protected]> * Update simulator/simple_planning_simulator/include/simple_planning_simulator/vehicle_model/sim_model_delay_steer_map_acc_geared.hpp Co-authored-by: Takamasa Horibe <[email protected]> * update error message Signed-off-by: kosuke55 <[email protected]> * simplify map exmaple Signed-off-by: kosuke55 <[email protected]> * use double Signed-off-by: kosuke55 <[email protected]> * style(pre-commit): autofix * Update simulator/simple_planning_simulator/README.md Co-authored-by: Takamasa Horibe <[email protected]> * add csv loader im sim pacakges Signed-off-by: kosuke55 <[email protected]> * revert raw vehicle cmd converter Signed-off-by: kosuke55 <[email protected]> * Update simulator/simple_planning_simulator/src/simple_planning_simulator/vehicle_model/sim_model_delay_steer_map_acc_geared.cpp Co-authored-by: Takamasa Horibe <[email protected]> * Update simulator/simple_planning_simulator/include/simple_planning_simulator/utils/csv_loader.hpp Co-authored-by: Takamasa Horibe <[email protected]> * Update simulator/simple_planning_simulator/src/simple_planning_simulator/utils/csv_loader.cpp Co-authored-by: Takamasa Horibe <[email protected]> --------- Signed-off-by: Takumi Ito <[email protected]> Signed-off-by: kosuke55 <[email protected]> Co-authored-by: Takumi Ito <[email protected]> Co-authored-by: Takamasa Horibe <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
703d91f
commit e68ddf2
Showing
14 changed files
with
3,118 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
simulator/simple_planning_simulator/include/simple_planning_simulator/utils/csv_loader.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright 2023 Autoware Foundation | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef SIMPLE_PLANNING_SIMULATOR__UTILS__CSV_LOADER_HPP_ | ||
#define SIMPLE_PLANNING_SIMULATOR__UTILS__CSV_LOADER_HPP_ | ||
|
||
#include <fstream> | ||
#include <iostream> | ||
#include <sstream> | ||
#include <string> | ||
#include <vector> | ||
|
||
using Table = std::vector<std::vector<std::string>>; | ||
using Map = std::vector<std::vector<double>>; | ||
class CSVLoader | ||
{ | ||
public: | ||
explicit CSVLoader(const std::string & csv_path); | ||
|
||
bool readCSV(Table & result, const char delim = ','); | ||
static bool validateData(const Table & table, const std::string & csv_path); | ||
static bool validateMap(const Map & map, const bool is_col_decent); | ||
static Map getMap(const Table & table); | ||
static std::vector<double> getRowIndex(const Table & table); | ||
static std::vector<double> getColumnIndex(const Table & table); | ||
static double clampValue( | ||
const double val, const std::vector<double> & ranges, const std::string & name); | ||
|
||
private: | ||
std::string csv_path_; | ||
}; | ||
|
||
#endif // SIMPLE_PLANNING_SIMULATOR__UTILS__CSV_LOADER_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.