Template Class free_block_pickup

Inheritance Relationships

Base Type

  • public rer::client< free_block_pickup< TController, TControllerSpecMap > >

Class Documentation

template<typename TController, typename TControllerSpecMap>
class free_block_pickup : public rer::client<free_block_pickup<TController, TControllerSpecMap>>

Handle’s (possible) free block pickup event on a given timestep, updating the robot and the arena map state as needed if the conditions for the pickup are met.

  1. The type of the arena map to use.

  2. The type of the penalty handler for the free block pickup operation to use.

  3. The return type of the operator() function to use.

  4. The type of the block vanished visitor to use, for when the block a robot is trying to pickup vanishes as it is serving its penalty.

  5. The type of the visitor to visit the controller in order to process the block pickup on the robot side (arena map side is already generic).

Template Parameters:
  • TController – The type of the robot controller

  • TControllerSpecMap – Compiler time map mapping the type of the controller to a set of types specifying:

Public Types

using arena_map_type = typename controller_spec::arena_map_type
using controller_spec = typename boost::mpl::at<TControllerSpecMap, TController>::type
using interactor_status_type = typename controller_spec::interactor_status_type
using penalty_handler_type = typename controller_spec::penalty_handler_type
using penalty_init_status_type = typename controller_spec::penalty_init_status_type
using robot_block_pickup_visitor_type = typename controller_spec::robot_block_pickup_visitor_type
using robot_block_vanished_visitor_type = typename controller_spec::robot_block_vanished_visitor_type

Public Functions

inline free_block_pickup(arena_map_type *const map, ::argos::CFloorEntity *const floor, penalty_handler_type *const penalty_handler)
free_block_pickup(const free_block_pickup&) = delete
free_block_pickup(free_block_pickup&&) = default
~free_block_pickup(void) override = default
inline interactor_status_type operator()(TController &controller, const rtypes::timestep &t)

Handle robot-arena interactions for the specified controller instance on this timestep.

Parameters:
  • controller – The controller to handle interactions for.

  • t – The current timestep.

free_block_pickup &operator=(const free_block_pickup&) = delete
virtual bool robot_goal_acquired(const TController &controller) const = 0

Determine if the robot has acquired its goal (a block in this case). This callback is needed because the exact parameters/method of determining when this has occurred are project specific (e.g., checking if the controller’s acquisition_goal() function returns a certain integer).

virtual penalty_init_status_type robot_penalty_init(const TController &controller, const rtypes::timestep &t, penalty_handler_type *handler) = 0

If the robot is not currently serving a penalty, then this callback is used to attempt to initialized one. It is needed because the penalty handler type is unknown, and therefore so are the arguments needed for initializing the penalty, beyond the controller and the timestep.

inline virtual void robot_post_penalty_init_hook(TController&, const penalty_init_status_type&) const

Called after robot_penalty_init, and passed whatever the return status from that function was.

inline virtual void robot_previsit_hook(TController&, const ctv::temporal_penalty&) const

Called right before the robot is visited by the block pickup event, in order to provide a hook for derived classes to update controller bookkeeping before the pickup.