5 #ifndef WAK_GAME_SHARED_H
6 #define WAK_GAME_SHARED_H
9 #include <walk_and_kick/wak_common.h>
10 #include <walk_and_kick/wak_config.h>
11 #include <walk_and_kick/wak_game_vars.h>
12 #include <walk_and_kick/wak_sensor_vars.h>
13 #include <walk_and_kick/wak_ros_interface.h>
14 #include <walk_and_kick/wak_utils.h>
15 #include <walk_and_kick/wak_vis.h>
16 #include <rc_utils/math_funcs.h>
17 #include <rc_utils/ros_time.h>
20 namespace walk_and_kick
41 plot_msgs::PlotManagerFS& PM;
47 void registerState(
WAKGameState* state,
int ID,
const std::string& name)
const;
56 bool gameStateIsNew()
const;
59 cycle_t wakCycle()
const;
60 cycle_t stateCycle()
const;
61 float wakTime()
const;
62 float stateTime()
const;
65 bool obstacleBallHandling(
GameVars& GV)
const;
66 Vec2f applyGoalSign(
const Vec2f& pose)
const {
return (SV.goalSign > 0 ? pose : Vec2f(-pose.x(), -pose.y())); }
67 Vec3f applyGoalSign(
const Vec3f& pose)
const {
return (SV.goalSign > 0 ? Vec3f(pose.x(), pose.y(), rc_utils::picut(pose.z())) : Vec3f(-pose.x(), -pose.y(), rc_utils::picut(pose.z() + M_PI))); }
68 Vec3f getKickoffPoseTarget()
const;
69 bool poseIsLegalForKickoff(
const Vec3f& pose)
const;
100 void clear() { m_targetPose.setZero(); m_targetPoseExists =
false; rc_utils::zeroRosTime(m_targetPoseTime); }
101 void set(
const Vec3f& targetPose,
const ros::Time& now) { m_targetPose = targetPose; m_targetPoseExists =
true; m_targetPoseTime = now; }
104 bool exists()
const {
return m_targetPoseExists; }
105 const Vec3f& value()
const {
return m_targetPose; }
106 float timeSinceSet(
const ros::Time& now)
const {
return (m_targetPoseExists ? (now - m_targetPoseTime).toSec() : INFINITY); }
107 bool hasExpired(
float expireTime,
const ros::Time& now) {
return (!m_targetPoseExists || (now - m_targetPoseTime).toSec() >= expireTime); }
112 bool m_targetPoseExists;
113 ros::Time m_targetPoseTime;
Configuration struct for the walk and kick node.
Definition: wak_config.h:20
Simple class that encapsulates the variables needed to easily dynamically calculate a target pose...
Definition: wak_game_shared.h:93
Visualisation marker manager for the walk and kick node.
Definition: wak_vis.h:21
An interface class for encapsulating all of the ROS input data to the walk and kick node...
Definition: wak_sensor_vars.h:29
A class that shares the required walk and kick variables amongst the game state classes.
Definition: wak_game_shared.h:31
The base class for all walk and kick game states.
Definition: wak_game_state.h:26
A simple class for abstracting away the source of the field dimensions.
Definition: wak_utils.h:216
A class that manages and executes the walk and kick game states.
Definition: wak_game_manager.h:38
An interface class for encapsulating all of the data that the walk and kick game states should comman...
Definition: wak_game_vars.h:21
An interface class between the walk and kick and ROS worlds.
Definition: wak_ros_interface.h:54