SPIN Framework
Public Types | Public Member Functions

spin::MeasurementNode Class Reference

Reports geometric measurements in relation to another node. More...

#include <MeasurementNode.h>

Inheritance diagram for spin::MeasurementNode:
spin::ReferencedNode

List of all members.

Public Types

enum  reportMode { REPORT_NONE, REPORT_BASIC, REPORT_ANGLES }

Public Member Functions

 MeasurementNode (SceneManager *sceneManager, const char *initID)
virtual void callbackUpdate (osg::NodeVisitor *nv)
void sendMeasurements ()
void setTarget (const char *targetID)
void setReportingLevel (reportMode level)
const char * getTarget () const
int getReportingLevel () const
virtual std::vector< lo_message > getState () const

Detailed Description

Reports geometric measurements in relation to another node.

A targetNode must be specified, and then measurements (such as distance, relative orientation, etc.) are computed and broadcasted.

The following items are measured:

distance the distance to the target direction the absolute direction (angle) on the XY plane incidence the angle difference between the measurement node's current orientation to that which would point at the target eulers the angle difference separated into pitch, roll, and yaw components (NOTE: possible inaccuracies due to gimbal lock) quaternion the rotation required to point at the target

Other notes:


Member Enumeration Documentation

Level of reporting that is sent (see setReportingLevel for more details)

Enumerator:
REPORT_NONE 

sends no measurements

REPORT_BASIC 

sends distance, absolute direction and incidence of orientation

REPORT_ANGLES 

sends the same as REPORT_BASIC, plus rotation information to target with respect to the MeasurementNode's current position and orientation (available as either euler angles or quaternion)


Member Function Documentation

void spin::MeasurementNode::callbackUpdate ( osg::NodeVisitor *  nv) [virtual]

The update callback for MeasurementNode checks to see if the target's or the MeasurementNode's global matrix has changed (ie, whether it has been moved or not). If so, it updates the internal matrices, and calls sendMeasurements()

Reimplemented from spin::ReferencedNode.

int spin::MeasurementNode::getReportingLevel ( ) const [inline]

Returns an integer representing the level of reporting as set in the ReportMode enum.

std::vector< lo_message > spin::MeasurementNode::getState ( ) const [virtual]

For each subclass of ReferencedNode, we override the getState() method to fill the vector with the correct set of methods for this particular node

Reimplemented from spin::ReferencedNode.

const char* spin::MeasurementNode::getTarget ( ) const [inline]

Returns the name of the target node (the node being measured.

void spin::MeasurementNode::sendMeasurements ( )

sendMeasurements is where the actual computation takes place, and, depending on the reportMode, the measurements are sent out on the network

void spin::MeasurementNode::setReportingLevel ( reportMode  level)

This sets the level of reporting (choose a reportMode)

void spin::MeasurementNode::setTarget ( const char *  targetID)

MeasurementNode requires a targetNode to be set, which defines which node in the scene is being measured.


The documentation for this class was generated from the following files: