op_ima_obj_pos_set_geocentric()
Abstract
Sets the position of a mobile site in the geocentric coordinate system.
Syntax
op_ima_obj_pos_set_geocentric (objid, x, y, z)
| 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().] |
x |
double |
Cartesian X coordinate to set for the site |
y |
double |
Cartesian Y coordinate to set for the site |
z |
double |
Cartesian Z coordinate to set for the site |
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_geocentric (mob_site_id, new_x, new_y, new_z);
}
Details
The site position set by this KP is stated in the geocentric Cartesian coordinate system, {X / Y / Z}. This coordinate system has units of meters for all three coordinates. See “Geocentric Coordinate System“ on page 317 for a description of this coordinate system.
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
Purpose
This function provides a way to set the position of a mobile node or subnet by specifying its coordinates in the geocentric 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 geocentric position for object (
<objid>); it is not a mobile node or subnet (object type is<obj_type>). - Recoverable Error: Unable to set geocentric position for object (
<objid>); it uses a trajectory. - Recoverable Error: Unable to set geocentric position for object (
<objid>); its position is defined by a query callback.