Normalizes the three directions for a magnetometer into a unit vector. 更多...
#include <vrpn_Tracker_IMU.h>
Public 成员函数 | |
VRPN_API | vrpn_IMU_Magnetometer (std::string const &name, vrpn_Connection *output_con, vrpn_IMU_Axis_Params params, float update_rate, bool report_changes=VRPN_FALSE) |
Constructor | |
virtual VRPN_API void | mainloop () |
Override base class function. | |
![]() | |
vrpn_Analog_Server (const char *name, vrpn_Connection *c, vrpn_int32 numChannels=vrpn_CHANNEL_MAX) | |
virtual void | report_changes (vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY, const struct timeval time=vrpn_ANALOG_NOW) |
Makes public the protected base class function | |
virtual void | report (vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY, const struct timeval time=vrpn_ANALOG_NOW) |
Makes public the protected base class function | |
vrpn_float64 * | channels (void) |
Exposes an array of values for the user to write into. | |
vrpn_int32 | setNumChannels (vrpn_int32 sizeRequested) |
![]() | |
vrpn_Analog (const char *name, vrpn_Connection *c=NULL) | |
void | print (void) |
vrpn_int32 | getNumChannels (void) const |
![]() | |
vrpn_BaseClass (const char *name, vrpn_Connection *c=NULL) | |
![]() | |
vrpn_Connection * | connectionPtr () |
Returns a pointer to the connection this object is using | |
Protected 成员函数 | |
int | setup_vector (vrpn_IMU_Vector *vector) |
int | teardown_vector (vrpn_IMU_Vector *vector) |
![]() | |
virtual int | register_types (void) |
virtual vrpn_int32 | encode_to (char *buf) |
![]() | |
virtual int | init (void) |
virtual int | register_senders (void) |
![]() | |
int | register_autodeleted_handler (vrpn_int32 type, vrpn_MESSAGEHANDLER handler, void *userdata, vrpn_int32 sender=vrpn_ANY_SENDER) |
int | send_text_message (const char *msg, struct timeval timestamp, vrpn_TEXT_SEVERITY type=vrpn_TEXT_NORMAL, vrpn_uint32 level=0) |
Sends a NULL-terminated text message from the device d_sender_id | |
SendTextMessageBoundCall | send_text_message (vrpn_TEXT_SEVERITY type=vrpn_TEXT_NORMAL) |
void | server_mainloop (void) |
void | client_mainloop (void) |
静态 Protected 成员函数 | |
static void VRPN_CALLBACK | handle_analog_update (void *userdata, const vrpn_ANALOGCB info) |
![]() | |
static int | encode_text_message_to_buffer (char *buf, vrpn_TEXT_SEVERITY severity, vrpn_uint32 level, const char *msg) |
static int | decode_text_message_from_buffer (char *msg, vrpn_TEXT_SEVERITY *severity, vrpn_uint32 *level, const char *buf) |
Decodes the body of the text message from a buffer from the connection | |
Protected 属性 | |
double | d_update_interval |
struct timeval | d_prevtime |
bool | d_report_changes |
vrpn_IMU_Vector | d_vector |
Axes to handle gathering and scaling the required data. | |
double | d_mins [3] |
Minimum, maximum, and current values for each axis. | |
double | d_maxes [3] |
![]() | |
vrpn_float64 | channel [vrpn_CHANNEL_MAX] |
vrpn_float64 | last [vrpn_CHANNEL_MAX] |
vrpn_int32 | num_channel |
struct timeval | timestamp |
vrpn_int32 | channel_m_id |
int | status |
![]() | |
vrpn_Connection * | d_connection |
Connection that this object talks to | |
char * | d_servicename |
vrpn_int32 | d_sender_id |
part | |
vrpn_int32 | d_text_message_id |
ID for text messages | |
vrpn_int32 | d_ping_message_id |
Ask the server if they are there | |
vrpn_int32 | d_pong_message_id |
Server telling that it is there | |
额外继承的成员函数 | |
![]() | |
bool | shutup |
Normalizes the three directions for a magnetometer into a unit vector.
This class acts as an analog-to-analog filter. It is given three axes to manage. For each axis, it keeps track of the minimum and maximum value it has ever received and maps the current value into the range -1..1 based on that range. It then normalizes the resulting vector, producing a unit vector that should auto-calibrate itself over time to provide a unit direction vector (as a 3-output analog) pointing in the direction of magnetic north.
VRPN_API vrpn_IMU_Magnetometer | ( | std::string const & | name, |
vrpn_Connection * | output_con, | ||
vrpn_IMU_Axis_Params | params, | ||
float | update_rate, | ||
bool | report_changes = VRPN_FALSE ) |
Constructor
name | The name to give to the Analog_Server output device. |
output_con | The connection to report on. |
x | The parameters for the X axis. |
y | The parameters for the Y axis. |
z | The parameters for the Z axis. |
update_rate | How often to send reports. If report_changes is true, it will only report at most this often. If report_changes is false, it will send reports at this rate whether it has received new values or not. |
report_changes | If true, only reports values when at least one of them a changed. If false, report values at the specified rate whether or not they have changed. |
|
virtual |
Override base class function.
重载 vrpn_Analog_Server .
|
protected |
Minimum, maximum, and current values for each axis.
|
protected |
Axes to handle gathering and scaling the required data.