Common (C++)#
-
class Session#
Public Functions
-
inline explicit Session(net::io_context &ioc, ssl::context &ctx)#
-
void set_api_key(const std::string &api_key)#
Set your own api key here.
-
void connect()#
Connect the session to the host. You can connect once and use the shared session for different request.
-
void shutdown()#
Shutdown the session.
-
const std::string request(const std::string &mode, const std::string &body_str, const std::string &url_params)#
Use the mode(“location_info”, “initialize”, “drive”) to construct a request, sent the request to host, and return the body string of the response.
-
inline explicit Session(net::io_context &ioc, ssl::context &ctx)#
-
struct AgentState#
The current or predicted state of a given agent at a given point.
-
struct AgentAttributes#
Static attributes of the agent, which don’t change over the course of a simulation. We assume every agent is a rectangle obeying a kinematic bicycle model.
-
struct TrafficLightState#
Dynamic state of a traffic light.
-
struct InfractionIndicator#
Infractions committed by a given agent, as returned from invertedai::drive().
Public Members
-
bool collisions#
True if the agent’s bounding box overlaps with another agent’s bounding box.
-
bool offroad#
True if the agent is outside the designated driveable area specified by the map.
-
bool wrong_way#
True if the cross product of the agent’s and its lanelet’s directions is negative.
-
bool collisions#
-
struct StaticMapActor#
Specifies a traffic light placement. We represent traffic lights as rectangular bounding boxes of the associated stop lines, with orientation matching the direction of traffic going through it.
Public Members
-
int actor_id#
ID as used in invertedai::initialize() and invertedai::drive().
-
std::string agent_type#
Not currently used, there may be more traffic signals in the future.
-
double x#
The position of the stop line.
-
double y#
-
double orientation#
Natural direction of traffic going through the stop line, in radians like in AgentState.
-
std::optional<double> length#
Size of the stop line, in meters, along its orientation.
-
std::optional<double> width#
-
std::vector<int> dependant#
-
int actor_id#
-
struct Point2d#
2D coordinates of a point in a given location. Each location comes with a canonical coordinate system, where the distance units are meters.