CARLA
CarlaRecorderQuery.h
Go to the documentation of this file.
1 // Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma
2 // de Barcelona (UAB).
3 //
4 // This work is licensed under the terms of the MIT license.
5 // For a copy, see <https://opensource.org/licenses/MIT>.
6 
7 #pragma once
8 
9 #include <fstream>
10 
20 #include "CarlaRecorderCollision.h"
21 #include "CarlaRecorderEventAdd.h"
22 #include "CarlaRecorderEventDel.h"
24 #include "CarlaRecorderFrames.h"
25 #include "CarlaRecorderInfo.h"
26 #include "CarlaRecorderPosition.h"
27 #include "CarlaRecorderState.h"
29 
31 {
32 
33  #pragma pack(push, 1)
34  struct Header
35  {
36  char Id;
37  uint32_t Size;
38  };
39  #pragma pack(pop)
40 
41 public:
42 
43  // get general info
44  std::string QueryInfo(std::string Filename, bool bShowAll = false);
45  // get info about collisions
46  std::string QueryCollisions(std::string Filename, char Category1 = 'a', char Category2 = 'a');
47  // get info about blocked actors
48  std::string QueryBlocked(std::string Filename, double MinTime = 30, double MinDistance = 10);
49 
50 private:
51 
52  std::ifstream File;
72 
73  // read next header packet
74  bool ReadHeader(void);
75 
76  // skip current packet
77  void SkipPacket(void);
78 
79  // read the start info structure and check the magic string
80  bool CheckFileInfo(std::stringstream &Info);
81 };
CarlaRecorderPosition Position
CarlaRecorderStateTrafficLight StateTraffic
bool CheckFileInfo(std::stringstream &Info)
CarlaRecorderCollision Collision
CarlaRecorderActorBoundingBox ActorBoundingBox
std::string QueryBlocked(std::string Filename, double MinTime=30, double MinDistance=10)
CarlaRecorderEventDel EventDel
std::string QueryCollisions(std::string Filename, char Category1='a', char Category2='a')
std::string QueryInfo(std::string Filename, bool bShowAll=false)
CarlaRecorderWalkerBones WalkerBones
CarlaRecorderEventAdd EventAdd
CarlaRecorderKinematics Kinematics
CarlaRecorderLightVehicle LightVehicle
CarlaRecorderPhysicsControl PhysicsControl
CarlaRecorderInfo RecInfo
CarlaRecorderPlatformTime PlatformTime
CarlaRecorderLightScene LightScene
CarlaRecorderFrame Frame
CarlaRecorderEventParent EventParent
CarlaRecorderAnimVehicle Vehicle
CarlaRecorderAnimWalker Walker
CarlaRecorderTrafficLightTime TrafficLightTime