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
|
2015-02-26 15:02:31 +00:00
|
|
|
#include "sim_services/Integrator/include/regula_falsi.h"
|
|
|
|
#include "trick_utils/comm/include/tc.h"
|
|
|
|
#include "trick_utils/comm/include/tc_proto.h"
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
2016-11-01 23:16:26 +00:00
|
|
|
double vel0[2] ; /* *i m Init velocity of cannonball */
|
|
|
|
double pos0[2] ; /* *i m Init position of cannonball */
|
2016-10-19 22:39:47 +00:00
|
|
|
double init_speed ; /* *i m/s Init barrel speed */
|
|
|
|
double init_angle ; /* *i rad Angle of cannon */
|
|
|
|
|
2016-11-01 23:16:26 +00:00
|
|
|
double acc[2] ; /* m/s2 xy-acceleration */
|
|
|
|
double vel[2] ; /* m/s xy-velocity */
|
|
|
|
double pos[2] ; /* m xy-position */
|
|
|
|
|
|
|
|
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-01 23:16:26 +00:00
|
|
|
int impact ; /* -- Has impact occured? */
|
|
|
|
double impactTime; /* s Time of Impact */
|
2015-02-26 15:02:31 +00:00
|
|
|
|
|
|
|
/* Impact */
|
|
|
|
REGULA_FALSI rf ; /* -- Dynamic event params for impact */
|
|
|
|
|
|
|
|
/* 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 ;
|
|
|
|
|
|
|
|
#endif
|