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");
300 virtual void render(SDL_Renderer*, b2WorldId)
const override;
351 std::vector<color_t>
leds = std::vector<color_t>(5, {0, 0, 0});
401 void sleep_µs(uint64_t microseconds);
417 virtual void do_init([[maybe_unused]] b2WorldId world_id)
override;
499 size_t _userdatasize,
500 float _communication_radius = 80.0f,
501 std::unique_ptr<MsgSuccessRate> _msg_success_rate = std::make_unique<ConstMsgSuccessRate>(0.5),
502 float _temporal_noise_stddev = 0.0f,
503 float _linear_damping = 0.0f,
float _angular_damping = 0.0f,
504 float _density = 10.0f,
float _friction = 0.3f,
float _restitution = 0.5f,
505 std::string
const& _category =
"robots");
519 std::string
const& _category =
"robots");
545 virtual void render(SDL_Renderer*, b2WorldId)
const override;
554 virtual void do_init([[maybe_unused]] b2WorldId world_id)
override;
585 Pogowall(uint16_t _id,
float _x,
float _y,
587 size_t _userdatasize,
588 float _communication_radius = 80.0f,
589 std::unique_ptr<MsgSuccessRate> _msg_success_rate = std::make_unique<ConstMsgSuccessRate>(0.5),
590 float _temporal_noise_stddev = 0.0f,
591 float _linear_damping = 0.0f,
float _angular_damping = 0.0f,
592 float _density = 10.0f,
float _friction = 0.3f,
float _restitution = 0.5f,
593 float _max_linear_speed = 100.0f,
float _max_angular_speed = 1.0f,
594 float _linear_noise_stddev = 0.0f,
float _angular_noise_stddev = 0.0f,
595 std::string
const& _category =
"robots");
609 std::string
const& _category =
"robots");
618 virtual void set_motor([[maybe_unused]]
motor_id motor, [[maybe_unused]]
int speed)
override { }
645 virtual void render(SDL_Renderer*, b2WorldId)
const override { }
667 virtual void move([[maybe_unused]]
float x, [[maybe_unused]]
float y, [[maybe_unused]]
float theta = NAN)
override { }
676 virtual void do_init([[maybe_unused]] b2WorldId world_id)
override;
718 size_t _userdatasize,
719 float _communication_radius = 80.0f,
720 std::unique_ptr<MsgSuccessRate> _msg_success_rate = std::make_unique<ConstMsgSuccessRate>(0.5),
721 float _temporal_noise_stddev = 0.0f,
722 float _linear_damping = 0.0f,
float _angular_damping = 0.0f,
723 float _density = 10.0f,
float _friction = 0.3f,
float _restitution = 0.5f,
724 float _max_linear_speed = 100.0f,
float _max_angular_speed = 1.0f,
725 float _linear_noise_stddev = 0.0f,
float _angular_noise_stddev = 0.0f,
726 unsigned int _num_dots = 100,
float _dot_radius = 10.0f,
int _cross_span = 3,
727 float _stiffness = 30.f,
728 bool _serialize_dot_pose =
false,
729 std::string _colormap =
"rainbow",
730 std::string
const& _category =
"robots");
744 std::string
const& _category =
"robots");
767 virtual void set_motor([[maybe_unused]]
motor_id motor, [[maybe_unused]]
int speed)
override { }
784 virtual void render(SDL_Renderer*, b2WorldId)
const override;
798 virtual void move([[maybe_unused]]
float x, [[maybe_unused]]
float y, [[maybe_unused]]
float theta = NAN)
override;
824 virtual void do_init([[maybe_unused]] b2WorldId world_id)
override;
844 float stiffness_scale = 1.0f);
873 size_t _userdatasize,
874 float _communication_radius = 80.0f,
875 std::unique_ptr<MsgSuccessRate> _msg_success_rate = std::make_unique<ConstMsgSuccessRate>(0.5),
876 float _temporal_noise_stddev = 0.0f,
877 float _linear_damping = 0.0f,
float _angular_damping = 0.0f,
878 float _density = 10.0f,
float _friction = 0.3f,
float _restitution = 0.5f,
879 float _max_linear_speed = 100.0f,
float _max_angular_speed = 1.0f,
880 float _linear_noise_stddev = 0.0f,
float _angular_noise_stddev = 0.0f,
881 unsigned int _num_dots = 100,
882 float _rect_thickness = 10.0f,
884 float _stiffness = 30.0f,
885 bool _serialize_dot_pose =
false,
886 std::string _colormap =
"rainbow",
887 std::string
const& _category =
"robots");
891 std::string
const& _category =
"robots");
901 virtual void render(SDL_Renderer* renderer, b2WorldId world_id)
const override;
902 virtual void move(
float x,
float y,
float theta = NAN)
override;
906 virtual void do_init(b2WorldId world_id)
override;
953 size_t _userdatasize,
954 float _communication_radius = 80.0f,
955 std::unique_ptr<MsgSuccessRate> _msg_success_rate = std::make_unique<ConstMsgSuccessRate>(0.5),
956 float _temporal_noise_stddev = 0.0f,
957 float _linear_damping = 0.0f,
float _angular_damping = 0.0f,
958 float _density = 10.0f,
float _friction = 0.3f,
float _restitution = 0.5f,
959 float _max_linear_speed = 100.0f,
float _max_angular_speed = 1.0f,
960 float _linear_noise_stddev = 0.0f,
float _angular_noise_stddev = 0.0f,
961 std::string _colormap =
"rainbow",
962 std::string
const& _category =
"active_objects");
976 std::string
const& _category =
"active_objects");
985 virtual void set_motor([[maybe_unused]]
motor_id motor, [[maybe_unused]]
int speed)
override { }
993 virtual void render(SDL_Renderer*, b2WorldId)
const override;
std::string colormap
Definition robot.h:1014
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:985
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:1001
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:26
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:767
virtual b2Vec2 get_position() const override
Retrieves the object's current position.
Definition robot.cpp:911
int num_dots
Definition robot.h:847
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:849
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:854
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:852
std::vector< Joint > joints
Definition robot.h:855
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:789
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:853
int cross_span
Definition robot.h:850
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:851
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:848
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:357
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:356
std::vector< color_t > leds
LED colors for the robot.
Definition robot.h:351
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:406
uint8_t percent_msgs_sent_per_ticks
Percentage of messages sent per tick.
Definition robot.h:249
float left_motor_speed
Current speed of the left motor.
Definition robot.h:289
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:443
size_t userdatasize
Definition robot.h:221
bool rotate_LEDs_45_deg
Definition robot.h:440
std::vector< std::vector< PogobotObject * > > neighbors
Pointers to neighboring robots.
Definition robot.h:354
uint32_t pogobot_ticks
Simulation ticks counter.
Definition robot.h:239
time_reference_t _global_timer
Global timer reference.
Definition robot.h:245
uint8_t motor_dir[3]
Definition robot.h:407
bool enable_user_steps() const
Check if user steps are enabled.
Definition robot.h:393
uint32_t _error_code_initial_time
Initial time for error code reporting.
Definition robot.h:248
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:355
void(* callback_robot_end)(void)
Callback per robot, called at end of experiment.
Definition robot.h:227
uint8_t max_nb_processed_msg_per_tick
Maximum number of messages processed per tick.
Definition robot.h:241
int8_t error_codes_led_idx
LED index for error codes.
Definition robot.h:244
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:466
void enable_stop_watches()
Enables all registered stop watches.
Definition robot.cpp:220
float angular_noise_stddev
Definition robot.h:439
float temporal_noise
Definition robot.h:432
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:240
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:438
std::set< time_reference_t * > stop_watches
Set of registered stop watches.
Definition robot.h:254
float right_motor_speed
Current speed of the right motor.
Definition robot.h:290
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:465
float max_linear_speed
Definition robot.h:436
void(* callback_robot_click)(void)
Callback called when this robot is clicked in the simulator.
Definition robot.h:228
float temporal_noise_stddev
Definition robot.h:433
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:408
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:247
uint32_t nb_msgs_recv
Counter for messages received.
Definition robot.h:251
float radius
Radius of this robot.
Definition robot.h:288
time_reference_t timer_main_loop
Main loop timer reference.
Definition robot.h:246
bool(* msg_tx_fn)(void)
Function pointer for message transmission.
Definition robot.h:243
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:242
uint64_t current_time_microseconds
Current time in microseconds.
Definition robot.h:403
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:468
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:291
float max_angular_speed
Definition robot.h:437
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:250
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:618
virtual void render_communication_channels(SDL_Renderer *, b2WorldId) const override
Renders the communication channels originating from this robot.
Definition robot.h:653
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:658
virtual void move(float x, float y, float theta=NAN) override
Move the object to a given coordinate.
Definition robot.h:667
virtual void render(SDL_Renderer *, b2WorldId) const override
Renders the robot on the given SDL renderer.
Definition robot.h:645
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:914
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:915
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:913
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:47
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:79
ir_direction
Definition spogobot.h:148
@ ir_all
Definition spogobot.h:153
motor_id
Definition spogobot.h:619
b2BodyId body_id
Definition robot.h:685
b2JointId joint_id
Definition robot.h:686
b2JointId joint_id
Definition robot.h:868
float half_length
Definition robot.h:863
b2BodyId body_id
Definition robot.h:862
float half_thickness
Definition robot.h:864
Definition spogobot.h:205
Definition spogobot.h:238
Definition spogobot.h:877