2015-02-26 15:02:31 +00:00
|
|
|
|
|
|
|
/*************************************************************************
|
2016-11-01 23:16:26 +00:00
|
|
|
PURPOSE: (Represent the state and initial conditions of a cannonball)
|
2015-02-26 15:02:31 +00:00
|
|
|
**************************************************************************/
|
2015-03-23 21:03:14 +00:00
|
|
|
#ifndef CANNON_H
|
|
|
|
#define CANNON_H
|
2017-06-06 18:04:12 +00:00
|
|
|
#include "trick/regula_falsi.h"
|
2015-02-26 15:02:31 +00:00
|
|
|
#include "trick_utils/comm/include/tc.h"
|
|
|
|
#include "trick_utils/comm/include/tc_proto.h"
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
2016-11-17 22:04:07 +00:00
|
|
|
double vel0[2] ; /* *i m Init velocity of cannonball */
|
|
|
|
double pos0[2] ; /* *i m Init position of cannonball */
|
|
|
|
double init_speed ; /* *i m/s Init barrel speed */
|
|
|
|
double init_angle ; /* *i rad Angle of cannon */
|
2016-10-19 22:39:47 +00:00
|
|
|
|
2016-11-17 22:04:07 +00:00
|
|
|
double acc[2] ; /* m/s2 xy-acceleration */
|
|
|
|
double vel[2] ; /* m/s xy-velocity */
|
|
|
|
double pos[2] ; /* m xy-position */
|
2016-11-01 23:16:26 +00:00
|
|
|
|
2016-11-17 22:04:07 +00:00
|
|
|
double time; /* s Model time */
|
|
|
|
double timeRate; /* -- Model time per Sim time. */
|
|
|
|
/* =1.0 when cannon ball in flight. =0.0 otherwise. */
|
2016-10-19 22:39:47 +00:00
|
|
|
|
2016-11-17 22:04:07 +00:00
|
|
|
int impact ; /* -- Has impact occured? */
|
|
|
|
double impactTime; /* s Time of Impact */
|
2015-02-26 15:02:31 +00:00
|
|
|
|
2016-11-17 22:04:07 +00:00
|
|
|
/* Impact */
|
|
|
|
REGULA_FALSI rf ; /* -- Dynamic event params for impact */
|
2015-02-26 15:02:31 +00:00
|
|
|
|
2016-11-17 22:04:07 +00:00
|
|
|
/* Communication Connection */
|
|
|
|
TCDevice connection ; /* -- Socket connection for sending position */
|
2016-11-01 23:16:26 +00:00
|
|
|
|
2015-02-26 15:02:31 +00:00
|
|
|
} CANNON ;
|
|
|
|
|
2016-11-17 22:04:07 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
int cannon_default_data(CANNON*) ;
|
|
|
|
int cannon_init(CANNON*) ;
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-02-26 15:02:31 +00:00
|
|
|
#endif
|