LIBRCSC Docs
Documentation for HELIOS's BASE LIBRCSC library for RoboCup 2D Simulation League.
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
coach_ball_object.h
Go to the documentation of this file.
1// -*-c++-*-
2
8/*
9 *Copyright:
10
11 Copyright (C) Hidehisa AKIYAMA
12
13 This code is free software; you can redistribute it and/or
14 modify it under the terms of the GNU Lesser General Public
15 License as published by the Free Software Foundation; either
16 version 3 of the License, or (at your option) any later version.
17
18 This library is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public
24 License along with this library; if not, write to the Free Software
25 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26
27 *EndCopyright:
28 */
29
31
32#ifndef RCSC_COACH_BALL_OBJECT_H
33#define RCSC_COACH_BALL_OBJECT_H
34
35#include <rcsc/geom/vector_2d.h>
36#include <rcsc/types.h>
37
38namespace rcsc {
39
45private:
46
47 Vector2D M_pos;
48 Vector2D M_vel;
49
50public:
51
56
61 const Vector2D & pos() const
62 {
63 return M_pos;
64 }
65
70 const Vector2D & vel() const
71 {
72 return M_vel;
73 }
74
82 const CoachBallObject & setValue( const double x,
83 const double y,
84 const double vx,
85 const double vy )
86 {
87 M_pos.assign( x, y );
88 M_vel.assign( vx, vy );
89 return *this;
90 }
91
96 {
97 M_pos.reverse();
98 M_vel.reverse();
99 }
100
101 // inertia movement calculators
102
108 Vector2D inertiaTravel( const int step ) const;
109
115 Vector2D inertiaPoint( const int cycle ) const;
116
117
123
124};
125
126}
127
128#endif
ball information for coath/trainer
Definition: coach_ball_object.h:44
Vector2D inertiaPoint(const int cycle) const
estimate the ball reach point
const Vector2D & vel() const
get global velocity
Definition: coach_ball_object.h:70
Vector2D inertiaFinalPoint() const
estimate the finally reached point
CoachBallObject()
initialize all data with 0.
const CoachBallObject & setValue(const double x, const double y, const double vx, const double vy)
set position
Definition: coach_ball_object.h:82
void reverseSide()
reverse positional value.
Definition: coach_ball_object.h:95
Vector2D inertiaTravel(const int step) const
estimate the vector of ball movement.
const Vector2D & pos() const
get global position
Definition: coach_ball_object.h:61
2D point vector class
Definition: vector_2d.h:46
Vector2D & assign(const double xx, const double yy)
assign XY value directly.
Definition: vector_2d.h:100
Vector2D & reverse()
reverse vector components
Definition: vector_2d.h:397
the type definition set for the RCSSServer2D
2d vector class Header File.