op_ima_obj_pos_set_geodetic()
Abstract
Sets the position of a mobile site in the geodetic coordinate system.
Syntax
op_ima_obj_pos_set_geodetic (objid, lat, lon, alt)
| Argument | Type | Description |
|---|---|---|
objid |
Objid |
object ID of the mobile site of interest (node or subnet) [A site object ID can be obtained from several KPs in the Id and Topo packages: op_topo_parent(), op_topo_child(), op_id_from_userid(), and op_id_from_name().] |
lat |
double |
latitude to set for the site |
lon |
double |
longitude to set for the site |
alt |
double |
altitude to set for the site, or OPC_IMA_GEODETIC_ALTITUDE_UNCHANGED (see Details) |
Return Type
Compcode
OPC_COMPCODE_FAILURE if an error occurs (see Errors section); OPC_COMPCODE_SUCCESS otherwise.
Example
obj_type = op_id_to_type (mob_site_id);
if (obj_type == OPC_OBJTYPE_NODE_MOB || obj_type == OPC_OBJTYPE_SUBNET_MOB)
{
op_ima_obj_pos_set_geodetic (mob_site_id, new_lat, new_lon, new_alt);
}
Details
The site position set by this KP is stated in the geodetic coordinate system, {latitude / longitude / altitude}. This coordinate system has units of degrees (for latitude and longitude) and meters (for altitude).
The mobile site specified by objid must not use other methods of assigning position, such as:
- A trajectory
- A query procedure (as set by op_ima_obj_pos_query_proc_set())
- Random mobility
If alt is specified as OPC_IMA_GEODETIC_ALTITUDE_UNCHANGED, only lat and lon will be set for the new position.
Purpose
This function provides a way to set the position of a mobile node or subnet by specifying its coordinates in the geodetic coordinate system.
Errors
- Recoverable Error: Object ID (
<objid>) is out-of-range. - Recoverable Error: Object ID (
<objid>) refers to a restricted object. - Recoverable Error: Unable to set geodetic position for object (
<objid>); it is not a mobile node or subnet (object type is<obj_type>). - Recoverable Error: Unable to set geodetic position for object (
<objid>); it uses a trajectory. - Recoverable Error: Unable to set geodetic position for object (
<objid>); its position is defined by a query callback.