10#include <box2d/box2d.h>
54 virtual double operator()(
double msg_size,
double p_send,
double cluster_size)
const = 0;
80 DynamicMsgSuccessRate(
double alpha = 0.000001,
double beta = 3.0708,
double gamma = 2.3234,
double delta = 1.1897);
90 double operator()(
double msg_size,
double p_send,
double cluster_size)
const override;
121 double operator()(
double msg_size,
double p_send,
double cluster_size)
const override;
173 size_t _userdatasize,
174 float _communication_radius = 80.0f,
175 std::unique_ptr<MsgSuccessRate> _msg_success_rate = std::make_unique<ConstMsgSuccessRate>(0.5),
176 float _temporal_noise_stddev = 0.0f,
177 float _linear_damping = 0.0f,
float _angular_damping = 0.0f,
178 float _density = 10.0f,
float _friction = 0.3f,
float _restitution = 0.5f,
179 float _max_linear_speed = 100.0f,
float _max_angular_speed = 1.0f,
180 float _linear_noise_stddev = 0.0f,
float _angular_noise_stddev = 0.0f,
181 bool _rotate_LEDs_45_deg =
false,
182 std::pair<int16_t, int16_t> angular_systematic_bias_domain = {0, 0},
183 std::pair<int16_t, int16_t> photosensors_systematic_bias_domain = {0, 0},
184 float _photosensors_noise_stddev = 0.0f,
185 std::string
const& _category =
"robots",
200 std::string
const& _category =
"robots");
298 virtual void render(SDL_Renderer*, b2WorldId)
const override;
349 std::vector<color_t>
leds = std::vector<color_t>(5, {0, 0, 0});
399 void sleep_µs(uint64_t microseconds);
415 virtual void do_init([[maybe_unused]] b2WorldId world_id)
override;
497 size_t _userdatasize,
498 float _communication_radius = 80.0f,
499 std::unique_ptr<MsgSuccessRate> _msg_success_rate = std::make_unique<ConstMsgSuccessRate>(0.5),
500 float _temporal_noise_stddev = 0.0f,
501 float _linear_damping = 0.0f,
float _angular_damping = 0.0f,
502 float _density = 10.0f,
float _friction = 0.3f,
float _restitution = 0.5f,
503 std::string
const& _category =
"robots");
517 std::string
const& _category =
"robots");
543 virtual void render(SDL_Renderer*, b2WorldId)
const override;
552 virtual void do_init([[maybe_unused]] b2WorldId world_id)
override;
583 Pogowall(uint16_t _id,
float _x,
float _y,
585 size_t _userdatasize,
586 float _communication_radius = 80.0f,
587 std::unique_ptr<MsgSuccessRate> _msg_success_rate = std::make_unique<ConstMsgSuccessRate>(0.5),
588 float _temporal_noise_stddev = 0.0f,
589 float _linear_damping = 0.0f,
float _angular_damping = 0.0f,
590 float _density = 10.0f,
float _friction = 0.3f,
float _restitution = 0.5f,
591 float _max_linear_speed = 100.0f,
float _max_angular_speed = 1.0f,
592 float _linear_noise_stddev = 0.0f,
float _angular_noise_stddev = 0.0f,
593 std::string
const& _category =
"robots");
607 std::string
const& _category =
"robots");
616 virtual void set_motor([[maybe_unused]]
motor_id motor, [[maybe_unused]]
int speed)
override { }
643 virtual void render(SDL_Renderer*, b2WorldId)
const override { }
665 virtual void move([[maybe_unused]]
float x, [[maybe_unused]]
float y, [[maybe_unused]]
float theta = NAN)
override { }
674 virtual void do_init([[maybe_unused]] b2WorldId world_id)
override;
716 size_t _userdatasize,
717 float _communication_radius = 80.0f,
718 std::unique_ptr<MsgSuccessRate> _msg_success_rate = std::make_unique<ConstMsgSuccessRate>(0.5),
719 float _temporal_noise_stddev = 0.0f,
720 float _linear_damping = 0.0f,
float _angular_damping = 0.0f,
721 float _density = 10.0f,
float _friction = 0.3f,
float _restitution = 0.5f,
722 float _max_linear_speed = 100.0f,
float _max_angular_speed = 1.0f,
723 float _linear_noise_stddev = 0.0f,
float _angular_noise_stddev = 0.0f,
724 unsigned int _num_dots = 100,
float _dot_radius = 10.0f,
int _cross_span = 3,
725 float _stiffness = 30.f,
726 bool _serialize_dot_pose =
false,
727 std::string _colormap =
"rainbow",
728 std::string
const& _category =
"robots");
742 std::string
const& _category =
"robots");
765 virtual void set_motor([[maybe_unused]]
motor_id motor, [[maybe_unused]]
int speed)
override { }
782 virtual void render(SDL_Renderer*, b2WorldId)
const override;
796 virtual void move([[maybe_unused]]
float x, [[maybe_unused]]
float y, [[maybe_unused]]
float theta = NAN)
override;
822 virtual void do_init([[maybe_unused]] b2WorldId world_id)
override;
842 float stiffness_scale = 1.0f);
871 size_t _userdatasize,
872 float _communication_radius = 80.0f,
873 std::unique_ptr<MsgSuccessRate> _msg_success_rate = std::make_unique<ConstMsgSuccessRate>(0.5),
874 float _temporal_noise_stddev = 0.0f,
875 float _linear_damping = 0.0f,
float _angular_damping = 0.0f,
876 float _density = 10.0f,
float _friction = 0.3f,
float _restitution = 0.5f,
877 float _max_linear_speed = 100.0f,
float _max_angular_speed = 1.0f,
878 float _linear_noise_stddev = 0.0f,
float _angular_noise_stddev = 0.0f,
879 unsigned int _num_dots = 100,
880 float _rect_thickness = 10.0f,
882 float _stiffness = 30.0f,
883 bool _serialize_dot_pose =
false,
884 std::string _colormap =
"rainbow",
885 std::string
const& _category =
"robots");
889 std::string
const& _category =
"robots");
899 virtual void render(SDL_Renderer* renderer, b2WorldId world_id)
const override;
900 virtual void move(
float x,
float y,
float theta = NAN)
override;
904 virtual void do_init(b2WorldId world_id)
override;
951 size_t _userdatasize,
952 float _communication_radius = 80.0f,
953 std::unique_ptr<MsgSuccessRate> _msg_success_rate = std::make_unique<ConstMsgSuccessRate>(0.5),
954 float _temporal_noise_stddev = 0.0f,
955 float _linear_damping = 0.0f,
float _angular_damping = 0.0f,
956 float _density = 10.0f,
float _friction = 0.3f,
float _restitution = 0.5f,
957 float _max_linear_speed = 100.0f,
float _max_angular_speed = 1.0f,
958 float _linear_noise_stddev = 0.0f,
float _angular_noise_stddev = 0.0f,
959 std::string _colormap =
"rainbow",
960 std::string
const& _category =
"active_objects");
974 std::string
const& _category =
"active_objects");
983 virtual void set_motor([[maybe_unused]]
motor_id motor, [[maybe_unused]]
int speed)
override { }
991 virtual void render(SDL_Renderer*, b2WorldId)
const override;
std::string colormap
Move the object to a given coordinate.
Definition robot.h:1012
virtual void set_motor(motor_id motor, int speed) override
Updates the motor speed of the robot and recalculates its velocities. Pogobjects do not move,...
Definition robot.h:983
virtual void render(SDL_Renderer *, b2WorldId) const override
Renders the robot on the given SDL renderer.
Definition robot.cpp:1467
ActiveObject(uint16_t _id, float _x, float _y, ObjectGeometry &geom, size_t _userdatasize, float _communication_radius=80.0f, std::unique_ptr< MsgSuccessRate > _msg_success_rate=std::make_unique< ConstMsgSuccessRate >(0.5), float _temporal_noise_stddev=0.0f, float _linear_damping=0.0f, float _angular_damping=0.0f, float _density=10.0f, float _friction=0.3f, float _restitution=0.5f, float _max_linear_speed=100.0f, float _max_angular_speed=1.0f, float _linear_noise_stddev=0.0f, float _angular_noise_stddev=0.0f, std::string _colormap="rainbow", std::string const &_category="active_objects")
Definition robot.cpp:1431
virtual void parse_configuration(Configuration const &config, Simulation *simulation) override
Parse a provided configuration and set associated members values.
Definition robot.cpp:1461
virtual void render_communication_channels(SDL_Renderer *, b2WorldId) const override
Renders the communication channels originating from this robot.
Definition robot.h:999
Class for managing hierarchical configuration parameters.
Definition configuration.h:64
double operator()(double msg_size, double p_send, double cluster_size) const override
Returns the constant success rate.
Definition robot.cpp:59
ConstMsgSuccessRate(double value)
Constructs a new ConstMsgSuccessRate object.
Definition robot.cpp:56
DataLogger class for writing data to a Feather file using Apache Arrow.
Definition data_logger.h:24
DynamicMsgSuccessRate(double alpha=0.000001, double beta=3.0708, double gamma=2.3234, double delta=1.1897)
Constructs a new DynamicMsgSuccessRate object.
Definition robot.cpp:47
double operator()(double msg_size, double p_send, double cluster_size) const override
Computes the dynamic success rate.
Definition robot.cpp:50
virtual void set_motor(motor_id motor, int speed) override
Updates the motor speed of the robot and recalculates its velocities. Pogobjects do not move,...
Definition robot.h:765
virtual b2Vec2 get_position() const override
Retrieves the object's current position.
Definition robot.cpp:911
int num_dots
Definition robot.h:845
virtual void do_init(b2WorldId world_id) override
Perform the base initialization (e.g. create Box2D objects). Called once by init(world_id).
Definition robot.cpp:865
float dot_radius
Definition robot.h:847
virtual void render(SDL_Renderer *, b2WorldId) const override
Renders the robot on the given SDL renderer.
Definition robot.cpp:921
std::vector< Dot > dots
Definition robot.h:852
void make_distance_joint(b2WorldId world_id, b2BodyId a, b2BodyId b, float stiffness_scale=1.0f)
Definition robot.cpp:949
bool serialize_dot_pose
Definition robot.h:850
std::vector< Joint > joints
Definition robot.h:853
virtual void serialize_base_values(DataLogger *data_logger, double t) override
Save base values of the object into a data logger row.
Definition robot.cpp:890
virtual bool is_tangible() const override
Returns whether this object is tangible (e.g. collisions, etc) or not.
Definition robot.h:787
MembraneObject(uint16_t _id, float _x, float _y, ObjectGeometry &geom, size_t _userdatasize, float _communication_radius=80.0f, std::unique_ptr< MsgSuccessRate > _msg_success_rate=std::make_unique< ConstMsgSuccessRate >(0.5), float _temporal_noise_stddev=0.0f, float _linear_damping=0.0f, float _angular_damping=0.0f, float _density=10.0f, float _friction=0.3f, float _restitution=0.5f, float _max_linear_speed=100.0f, float _max_angular_speed=1.0f, float _linear_noise_stddev=0.0f, float _angular_noise_stddev=0.0f, unsigned int _num_dots=100, float _dot_radius=10.0f, int _cross_span=3, float _stiffness=30.f, bool _serialize_dot_pose=false, std::string _colormap="rainbow", std::string const &_category="robots")
Definition robot.cpp:832
std::string colormap
Definition robot.h:851
int cross_span
Definition robot.h:848
virtual arena_polygons_t generate_contours(std::size_t points_per_contour=0) const override
Return one or more polygonal contours that represent the current geometry of the object.
Definition robot.cpp:1086
float stiffness
Definition robot.h:849
virtual void move(float x, float y, float theta=NAN) override
Move the object to a given coordinate.
Definition robot.cpp:1036
std::vector< size_t > size_contours
Definition robot.h:846
virtual void parse_configuration(Configuration const &config, Simulation *simulation) override
Parse a provided configuration and set associated members values.
Definition robot.cpp:872
virtual void create_serialization_fields(DataLogger *data_logger) override
Create serialization fields of the data logger.
Definition robot.cpp:883
void create_robot_body(b2WorldId world_id)
Creates the object's physical body in the simulation.
Definition robot.cpp:972
Abstract base class for message success rate calculations.
Definition robot.h:44
virtual double operator()(double msg_size, double p_send, double cluster_size) const =0
Computes the message success rate.
virtual ~MsgSuccessRate()=default
Virtual destructor.
Geometry of an object.
Definition objects_geometry.h:40
float y
Y position.
Definition objects.h:134
float x
X position.
Definition objects.h:133
ObjectGeometry * geom
Geometry of the object.
Definition objects.h:156
float theta
Orientation (in rad).
Definition objects.h:135
PhysicalObject(uint16_t _id, float _x, float _y, ObjectGeometry &geom, float _linear_damping=0.0f, float _angular_damping=0.0f, float _density=10.0f, float _friction=0.3f, float _restitution=0.5f, std::string const &_category="objects")
Constructs a PhysicalObject.
Definition objects.cpp:73
virtual void render(SDL_Renderer *, b2WorldId) const override
Renders the robot on the given SDL renderer.
Definition robot.cpp:737
PogobjectObject(uint16_t _id, float _x, float _y, ObjectGeometry &geom, size_t _userdatasize, float _communication_radius=80.0f, std::unique_ptr< MsgSuccessRate > _msg_success_rate=std::make_unique< ConstMsgSuccessRate >(0.5), float _temporal_noise_stddev=0.0f, float _linear_damping=0.0f, float _angular_damping=0.0f, float _density=10.0f, float _friction=0.3f, float _restitution=0.5f, std::string const &_category="robots")
Definition robot.cpp:690
virtual void set_motor(motor_id motor, int speed) override
Updates the motor speed of the robot and recalculates its velocities. Pogobjects do not move,...
Definition robot.cpp:716
virtual b2Vec2 get_IR_emitter_position(ir_direction dir) const override
Retrieves the IR emitters current positions.
Definition robot.cpp:733
virtual void do_init(b2WorldId world_id) override
Perform the base initialization (e.g. create Box2D objects). Called once by init(world_id).
Definition robot.cpp:710
Class representing a simulated Pogobot.
Definition robot.h:142
virtual b2Vec2 get_photosensor_position(uint8_t sensor_number) const
Returns the position of a photosensor.
Definition robot.cpp:564
std::unique_ptr< MsgSuccessRate > msg_success_rate
Probability of successfully sending a message.
Definition robot.h:355
void(* callback_export_data)(void)
Callback to export data.
Definition robot.h:226
float communication_radius
Communication radius of each IR emitter.
Definition robot.h:354
std::vector< color_t > leds
LED colors for the robot.
Definition robot.h:349
void initialize_time()
Initialize time-related operations.
Definition robot.cpp:670
virtual void render_communication_channels(SDL_Renderer *, b2WorldId) const
Renders the communication channels originating from this robot.
Definition robot.cpp:368
uint8_t motor_dir_mem[3]
Motors current direction and power ([R, L, B]).
Definition robot.h:404
uint8_t percent_msgs_sent_per_ticks
Percentage of messages sent per tick.
Definition robot.h:247
float left_motor_speed
Current speed of the left motor.
Definition robot.h:287
virtual void set_motor(motor_id motor, int speed)
Updates the motor speed of the robot and recalculates its velocities.
Definition robot.cpp:461
bool dummy
Definition robot.h:441
size_t userdatasize
Definition robot.h:221
bool rotate_LEDs_45_deg
Definition robot.h:438
std::vector< std::vector< PogobotObject * > > neighbors
Pointers to neighboring robots.
Definition robot.h:352
uint32_t pogobot_ticks
Simulation ticks counter.
Definition robot.h:237
time_reference_t _global_timer
Global timer reference.
Definition robot.h:243
uint8_t motor_dir[3]
Definition robot.h:405
bool enable_user_steps() const
Check if user steps are enabled.
Definition robot.h:391
uint32_t _error_code_initial_time
Initial time for error code reporting.
Definition robot.h:246
void * data
Pointer to user data.
Definition robot.h:222
virtual void serialize_base_values(DataLogger *data_logger, double t) override
Save base values of the object into a data logger row.
Definition robot.cpp:165
std::queue< message_t > messages
Queue of incoming messages.
Definition robot.h:353
uint8_t max_nb_processed_msg_per_tick
Maximum number of messages processed per tick.
Definition robot.h:239
int8_t error_codes_led_idx
LED index for error codes.
Definition robot.h:242
virtual float get_IR_emitter_angle(ir_direction dir) const
World-frame bearing of the chosen IR emitter.
Definition robot.cpp:531
void(* user_init)(void)
Pointer to a user-defined initialization function.
Definition robot.h:223
virtual void initialize_photosensors_bias(std::pair< int16_t, int16_t > &domain)
Initialize the level of bias each photosensor has, based on provided configuration/parameters.
Definition robot.cpp:172
float photosensors_noise_stddev
Stddev of the Gaussian noise to apply to photosensors light levels.
Definition robot.h:464
void enable_stop_watches()
Enables all registered stop watches.
Definition robot.cpp:220
float angular_noise_stddev
Definition robot.h:437
float temporal_noise
Definition robot.h:430
virtual void render(SDL_Renderer *, b2WorldId) const override
Renders the object on the given SDL renderer.
Definition robot.cpp:233
virtual void initialize_angular_bias(std::pair< int16_t, int16_t > &domain)
Initialize the level of angular bias, based on provided configuration/parameters.
Definition robot.cpp:183
uint8_t main_loop_hz
Main loop frequency in Hz.
Definition robot.h:238
virtual void do_init(b2WorldId world_id) override
Perform the base initialization (e.g. create Box2D objects). Called once by init(world_id).
Definition robot.cpp:129
float linear_noise_stddev
Definition robot.h:436
std::set< time_reference_t * > stop_watches
Set of registered stop watches.
Definition robot.h:252
float right_motor_speed
Current speed of the right motor.
Definition robot.h:288
bool _enable_user_steps
Whether we allow user programs to be executed.
Definition robot.h:225
virtual b2Vec2 get_IR_emitter_position(ir_direction dir) const
Retrieves the IR emitters current positions.
Definition robot.cpp:507
std::vector< int16_t > photosensors_biases
Level of systematic bias to apply to each photosensor.
Definition robot.h:463
float max_linear_speed
Definition robot.h:434
float temporal_noise_stddev
Definition robot.h:431
PogobotObject(uint16_t _id, float _x, float _y, ObjectGeometry &geom, size_t _userdatasize, float _communication_radius=80.0f, std::unique_ptr< MsgSuccessRate > _msg_success_rate=std::make_unique< ConstMsgSuccessRate >(0.5), float _temporal_noise_stddev=0.0f, float _linear_damping=0.0f, float _angular_damping=0.0f, float _density=10.0f, float _friction=0.3f, float _restitution=0.5f, float _max_linear_speed=100.0f, float _max_angular_speed=1.0f, float _linear_noise_stddev=0.0f, float _angular_noise_stddev=0.0f, bool _rotate_LEDs_45_deg=false, std::pair< int16_t, int16_t > angular_systematic_bias_domain={0, 0}, std::pair< int16_t, int16_t > photosensors_systematic_bias_domain={0, 0}, float _photosensors_noise_stddev=0.0f, std::string const &_category="robots", bool dummy=false)
Definition robot.cpp:91
uint16_t motor_power_mem[3]
Definition robot.h:406
void sleep_µs(uint64_t microseconds)
Simulate a sleep on a single robot.
Definition robot.cpp:682
virtual void parse_configuration(Configuration const &config, Simulation *simulation) override
Parse a provided configuration and set associated members values.
Definition robot.cpp:140
virtual void update_time()
Updates the object's current time.
Definition robot.cpp:678
uint32_t _current_time_milliseconds
Current time in milliseconds.
Definition robot.h:245
uint32_t nb_msgs_recv
Counter for messages received.
Definition robot.h:249
float radius
Radius of this robot.
Definition robot.h:286
time_reference_t timer_main_loop
Main loop timer reference.
Definition robot.h:244
bool(* msg_tx_fn)(void)
Function pointer for message transmission.
Definition robot.h:241
virtual void create_serialization_fields(DataLogger *data_logger) override
Create serialization fields of the data logger.
Definition robot.cpp:160
void(* msg_rx_fn)(message_t *)
Function pointer for message reception.
Definition robot.h:240
uint64_t current_time_microseconds
Current time in microseconds.
Definition robot.h:401
virtual void launch_user_step(float t) override
Launches the user-defined step function.
Definition robot.cpp:205
void create_robot_body(b2WorldId world_id)
Creates the object's physical body in the simulation.
Definition robot.cpp:194
int16_t angular_bias
Definition robot.h:466
void register_stop_watch(time_reference_t *sw)
Registers a stop watch with the robot.
Definition robot.cpp:216
void receive_message(message_t *const message, PogobotObject *source)
Receive a message from another robot.
Definition robot.cpp:636
bool show_lateral_leds
Whether to render lateral LEDs.
Definition robot.h:289
float max_angular_speed
Definition robot.h:435
void disable_stop_watches()
Disables all registered stop watches.
Definition robot.cpp:226
void(* user_step)(void)
Pointer to a user-defined step function.
Definition robot.h:224
void send_to_neighbors(ir_direction dir, short_message_t *const message)
Sends a short message to neighboring robots.
Definition robot.cpp:600
uint32_t nb_msgs_sent
Counter for messages sent.
Definition robot.h:248
Pogowall(uint16_t _id, float _x, float _y, ObjectGeometry &geom, size_t _userdatasize, float _communication_radius=80.0f, std::unique_ptr< MsgSuccessRate > _msg_success_rate=std::make_unique< ConstMsgSuccessRate >(0.5), float _temporal_noise_stddev=0.0f, float _linear_damping=0.0f, float _angular_damping=0.0f, float _density=10.0f, float _friction=0.3f, float _restitution=0.5f, float _max_linear_speed=100.0f, float _max_angular_speed=1.0f, float _linear_noise_stddev=0.0f, float _angular_noise_stddev=0.0f, std::string const &_category="robots")
Definition robot.cpp:784
virtual void set_motor(motor_id motor, int speed) override
Updates the motor speed of the robot and recalculates its velocities. Pogobjects do not move,...
Definition robot.h:616
virtual void render_communication_channels(SDL_Renderer *, b2WorldId) const override
Renders the communication channels originating from this robot.
Definition robot.h:651
virtual b2Vec2 get_IR_emitter_position(ir_direction dir) const override
Retrieves the IR emitters current positions.
Definition robot.cpp:821
virtual void do_init(b2WorldId world_id) override
Perform the base initialization (e.g. create Box2D objects). Called once by init(world_id).
Definition robot.cpp:815
virtual bool is_tangible() const override
Returns whether this object is tangible (e.g. collisions, etc) or not.
Definition robot.h:656
virtual void move(float x, float y, float theta=NAN) override
Move the object to a given coordinate.
Definition robot.h:665
virtual void render(SDL_Renderer *, b2WorldId) const override
Renders the robot on the given SDL renderer.
Definition robot.h:643
virtual float get_IR_emitter_angle(ir_direction dir) const override
World-frame bearing of the chosen IR emitter.
Definition robot.cpp:825
virtual void move(float x, float y, float theta=NAN) override
Move the object to a given coordinate.
Definition robot.cpp:1331
std::vector< Rect > rects
Definition robot.h:912
virtual void parse_configuration(Configuration const &config, Simulation *simulation) override
Parse a provided configuration and set associated members values.
Definition robot.cpp:1148
void create_rect_membrane(b2WorldId world_id)
Definition robot.cpp:1183
virtual void serialize_base_values(DataLogger *data_logger, double t) override
Save base values of the object into a data logger row.
Definition robot.cpp:1163
std::vector< Hinge > hinges
Definition robot.h:913
virtual void render(SDL_Renderer *renderer, b2WorldId world_id) const override
Renders the robot on the given SDL renderer.
Definition robot.cpp:1347
RectMembraneObject(uint16_t _id, float _x, float _y, ObjectGeometry &geom, size_t _userdatasize, float _communication_radius=80.0f, std::unique_ptr< MsgSuccessRate > _msg_success_rate=std::make_unique< ConstMsgSuccessRate >(0.5), float _temporal_noise_stddev=0.0f, float _linear_damping=0.0f, float _angular_damping=0.0f, float _density=10.0f, float _friction=0.3f, float _restitution=0.5f, float _max_linear_speed=100.0f, float _max_angular_speed=1.0f, float _linear_noise_stddev=0.0f, float _angular_noise_stddev=0.0f, unsigned int _num_dots=100, float _rect_thickness=10.0f, int _cross_span=3, float _stiffness=30.0f, bool _serialize_dot_pose=false, std::string _colormap="rainbow", std::string const &_category="robots")
Definition robot.cpp:1114
void make_center_distance_joint(b2WorldId world_id, b2BodyId a, b2BodyId b, float stiffness_scale=1.0f)
Definition robot.cpp:1299
float rect_thickness
Definition robot.h:911
virtual arena_polygons_t generate_contours(std::size_t points_per_contour=0) const override
Return one or more polygonal contours that represent the current geometry of the object.
Definition robot.cpp:1393
virtual void do_init(b2WorldId world_id) override
Perform the base initialization (e.g. create Box2D objects). Called once by init(world_id).
Definition robot.cpp:1153
void make_revolute_joint(b2WorldId world_id, b2BodyId a, b2BodyId b, b2Vec2 anchor_world)
Definition robot.cpp:1286
virtual b2Vec2 get_position() const override
Retrieves the object's current position.
Definition robot.cpp:1321
Class representing the simulation environment.
Definition simulator.h:43
std::vector< std::vector< b2Vec2 > > arena_polygons_t
Definition geometry.h:13
PogobotObject * current_robot
Definition robot.cpp:26
uint64_t sim_starting_time_microseconds
Definition robot.cpp:29
MsgSuccessRate * msg_success_rate_factory(Configuration const &config)
Factory of MsgSuccessRate, from a given configuration.
Definition robot.cpp:64
ShapeType
Enumeration to select the shape type of the robot's body.
Definition robot.h:32
@ Ellipse
Definition robot.h:34
@ Circle
Definition robot.h:33
@ Polygon
Definition robot.h:35
uint64_t get_current_time_microseconds()
Retrieves the current time in microseconds.
Definition spogobot.cpp:67
std::string log_current_robot()
Returns a log string for the current robot.
Definition spogobot.cpp:85
std::unique_ptr< Simulation > simulation
Global simulation instance.
Definition simulator.cpp:74
ir_direction
Definition spogobot.h:148
@ ir_all
Definition spogobot.h:153
motor_id
Definition spogobot.h:619
b2BodyId body_id
Definition robot.h:683
b2JointId joint_id
Definition robot.h:684
b2JointId joint_id
Definition robot.h:866
float half_length
Definition robot.h:861
b2BodyId body_id
Definition robot.h:860
float half_thickness
Definition robot.h:862
Definition spogobot.h:205
Definition spogobot.h:238
Definition spogobot.h:877