Skip to content
Snippets Groups Projects

Opendrive lib

Merged Fernando Herrero requested to merge opendrive_lib into master
22 files
+ 314
59270
Compare changes
  • Side-by-side
  • Inline
Files
22
+ 0
121
#ifndef _ADC_CIRCUIT_H
#define _ADC_CIRCUIT_H
#include <string>
#include <vector>
#include "adc_road.h"
#include <vector>
#ifdef _HAVE_XSD
#include "../src/xml/OpenDRIVE_1.4H.hxx"
#endif
#define SIGNS_LAUNCH_FILE "spawn_signs.launch"
#define OBJECTS_LAUNCH_FILE "spawn_objects.launch"
/**
* \class CAdcCircuit
*
* \brief Class to store all the useful information of a OpenDrive circuit.
*
* It has access to each road information.
*
*/
class CAdcCircuit
{
private:
std::vector<CAdcRoad*> roads;///< Variable to store an access each road data.
double road_scale;///< The scale of the road to divide by the objects and signals poses.
/**
* \brief Function to add a road.
*
* \param road The road to add.
*
*/
inline void add_road(CAdcRoad* &road);
/**
* \brief Function to clear roads.
*
*/
inline void clear_roads(void);
public:
/**
* \brief Default constructor.
*
*/
CAdcCircuit();
/**
* \brief Default destructor.
*
* It deletes each road geometry pointer.
*
*/
~CAdcCircuit();
/**
* \brief Function to print each road info.
*
* It calls CAdcRoad::debug function of each road.
*
*/
void debug(void);
/**
* \brief Function to calculate the world pose of each sign and object.
*
* It calls CAdcRoad::calculate_signals_pose and CAdcRoad::calculate_objects_pose function of each road.
*
* \param debug Boolean to print all the information stored on each signal nad object at
* the end of the function.
*/
void calculate_world_poses(bool debug = false);
/**
* \brief Function to get all the signs presents on circuit.
*
* It calls CAdcRoad::get_signals function of each road.
*
* \param signals Variable to store the information.
*/
void get_signals(std::vector<CAdcSignals*> &signals);
/**
* \brief Function to generate a .launch to spwan all
* the recognized signs and another for the objects.
*
* First it saves the header of the file. Secondly it
* calls CAdcRoad::append_signs_spwan. Finally, it saves
* the end of the launch file.
*
* It follows the same steps to generate the objects launch file
* calling CAdcRoad::append_objects_spwan.
*
* \param dir The route to the output launch directory with the base name for both launch files.
*
* \throws CException If the output file can't be opened.
*/
void generate_spawn_launch_files(std::string &dir);
/**
* \brief Function to load the .xodr info.
*
* \param open_drive The objects generated with XSD.
*
*/
void load(std::unique_ptr<OpenDRIVE> &open_drive);
/**
* \brief Function to set road_Scale.
*
* \param road_scale The scale of the road to divide by the objects and signals poses.
*
*/
void set_road_scale(double road_scale=1.0);
};
#endif
Loading