op_ima_traj_info_get()
Abstract
Returns the ground speed and ascent rate of a site in the trajectory segment corresponding to a given time, and the time until which the site will have those speeds.
Syntax
op_ima_traj_info_get (objid, time, ground_speed_ptr, ascent_rate_ptr, end_time_ptr)
| Argument | Type | Description |
|---|---|---|
objid |
Objid |
object ID of the site of interest |
time |
double |
simulation time of interest (must be op_sim_time() or later) |
ground_speed_ptr |
double * |
variable to be filled with the ground speed at time |
ascent_rate_ptr |
double * |
variable to be filled with the ascent rate at time |
end_time_ptr |
double * |
variable to be filled with the next simulation time at which one or both of the trajectory velocities change |
Return Type
Compcode
OPC_COMPCODE_SUCCESS if the trajectory information is obtained; OPC_COMPCODE_FAILURE otherwise.
Example
/* Display ground speed, ascent rate, and end time for each trajectory segment */
/* of current object’s parent. */
double start_time, end_time, ground_speed, ascent_rate;
op_ima_obj_hname_get (op_id_parent (op_id_self ()), name, 256);
start_time = 0;
end_time = OPC_DBL_INFINITY;
do
{
retval = op_ima_traj_info_get (op_id_parent (op_id_self ()),
start_time, &ground_speed, &ascent_rate, &end_time);
start_time = end_time;
if (retval == OPC_COMPCODE_SUCCESS)
printf ("%-40sspd: %g, asc: %g, end: %g\n",
name, ground_speed, ascent_rate, end_time);
else
printf ("%-40s: failed\n", name);
}
while (end_time != OPC_DBL_INFINITY);
Details
If the specified site is fixed, the speeds returned will be those of a parent (possibly moving) site. An end time value of OPC_DBL_INFINITY is returned if there is no time limit on the movement. Ground speed and ascent rate are given in meters/second.
Purpose
Provides a way to obtain information about the ground speed and ascent rate of a site during a particular trajectory segment.
Errors
- Recoverable Error: Object ID (
<objid>) is out-of-range. - Recoverable Error: Object ID (
<objid>) refers to a restricted object. - Recoverable Error: Object (
<objid>) has incorrect type (<type>); node or antenna objects are expected. - Recoverable Error: Can't compute vector mobility for a mobile site inside a mobile subnet
- Recoverable Error: Can't compute vector mobility for a mobile site inside a satellite subnet
Reference
- Use the KP op_ima_traj_remaining_duration_get() to get the time remaining until a site reaches the end of its trajectory
- Use the KP op_ima_traj_set() to assign a new trajectory to a site
- Use the KP op_ima_traj_speed_set() to override the speed set by the trajectory