1#ifndef EPUCK_SIMPLE_GRID_WORLD_H
2#define EPUCK_SIMPLE_GRID_WORLD_H
8#include "rlenvs/bitrl_config.h"
12#include "rlenvs/envs/env_types.h"
13#include "rlenvs/envs/time_step.h"
14#include "rlenvs/envs/webots_envs/webots_base_env.h"
15#include "rlenvs/rigid_bodies/webots_robots/epuck_robot.h"
16#include "rlenvs/rlenvs_types_v2.h"
18#include <webots/PositionSensor.hpp>
19#include <webots/Robot.hpp>
32using namespace rlenvscpp::rigid_bodies::webots_robots;
45class EpuckSimpleGridWorld final
46 :
public WebotsEnvBase<TimeStep<std::vector<real_t>>,
47 ContinuousVectorStateDiscreteActionEnv<3,
57 static const std::string name;
62 typedef WebotsEnvBase<
64 envs::ContinuousVectorStateDiscreteActionEnv<3,
74 typedef typename base_type::time_step_type time_step_type;
79 typedef typename base_type::state_space_type state_space_type;
84 typedef typename base_type::action_space_type action_space_type;
89 typedef typename base_type::action_type action_type;
94 typedef typename base_type::state_type
state_type;
99 using base_type::reset;
104 EpuckSimpleGridWorld();
116 virtual void make(
const std::string &version,
117 const std::unordered_map<std::string, std::any> &options)
override final;
123 virtual void close() override final;
128 virtual
void pause_simulation() override final;
134 virtual time_step_type
136 const std::unordered_map<std::
string, std::any> & ) override final;
142 virtual time_step_type step(const action_type &action) override final;
147 uint_t n_actions() const noexcept {
return action_space_type::size; }
152 real_t compute_reward()
const;
157 EpuckRobot &get_robot() noexcept {
return robot_; }
162 const EpuckRobot &get_robot() const noexcept {
return robot_; }
174 void build_make_options_(
const std::unordered_map<std::string, std::any> &options);
179 void activate_robot_();
184 time_step_type on_stop_();
189 time_step_type on_move_();
double real_t
real_t
Definition bitrl_types.h:23
std::pair< uint_t, uint_t > state_type
Definition example_15.cpp:28
Definition quadcopter_sim_env.cpp:16