vrpn
07.33
Virtual Reality Peripheral Network
|
Go to the documentation of this file.
10 for (
int i = 0; i < 3; i++) {
37 if (full->
ana == NULL) {
38 fprintf(stderr,
"vrpn_Poser_Analog: Can't open Analog %s\n",
46 "vrpn_Poser_Analog: Can't open Analog: No name given\n");
57 , d_act_as_tracker(act_as_tracker)
65 fprintf(stderr,
"vrpn_Poser_Analog: No connection\n");
72 fprintf(stderr,
"vrpn_Poser_Analog: can't register position handler\n");
79 fprintf(stderr,
"vrpn_Poser_Analog: can't register velocity handler\n");
116 for (i = 0; i < 3; i++) {
133 for (i = 0; i < 3; i++) {
160 if (
rx.
ana != NULL) {
163 if (
ry.
ana != NULL) {
166 if (
rz.
ana != NULL) {
175 const char* params = (p.
buffer);
177 bool outside_bounds =
false;
181 fprintf(stderr,
"vrpn_Poser_Server: change message payload error\n");
182 fprintf(stderr,
" (got %d, expected %d)\n", p.
payload_len,
183 static_cast<int>(7 *
sizeof(vrpn_float64)));
188 for (i = 0; i < 3; i++) {
191 for (i = 0; i < 4; i++) {
196 for (i = 0; i < 3; i++) {
199 outside_bounds =
true;
203 outside_bounds =
true;
209 fprintf(stderr,
"vrpn_Poser_Analog: Error updating Analog values\n");
227 len = me->vrpn_Tracker::encode_to(msgbuf);
231 fprintf(stderr,
"vrpn_Poser_Analog::handle_change_message(): can't "
232 "write message: tossing\n");
244 const char* params = (p.
buffer);
246 bool outside_bounds =
false;
250 fprintf(stderr,
"vrpn_Poser_Server: velocity message payload error\n");
251 fprintf(stderr,
" (got %d, expected %d)\n", p.
payload_len,
252 static_cast<int>(8 *
sizeof(vrpn_float64)));
257 for (i = 0; i < 3; i++) {
260 for (i = 0; i < 4; i++) {
266 for (i = 0; i < 3; i++) {
269 outside_bounds =
true;
273 outside_bounds =
true;
294 len = me->vrpn_Tracker::encode_vel_to(msgbuf);
298 fprintf(stderr,
"vrpn_Poser_Analog::handle_vel_change_message(): "
299 "can't write message: tossing\n");
static int VRPN_CALLBACK handle_change_message(void *userdata, vrpn_HANDLERPARAM p)
vrpn_float64 p_vel_rot_max[3]
int register_autodeleted_handler(vrpn_int32 type, vrpn_MESSAGEHANDLER handler, void *userdata, vrpn_int32 sender=vrpn_ANY_SENDER)
Registers a handler with the connection, and remembers to delete at destruction.
virtual int pack_message(vrpn_uint32 len, struct timeval time, vrpn_int32 type, vrpn_int32 sender, const char *buffer, vrpn_uint32 class_of_service)
Pack a message that will be sent the next time mainloop() is called. Turn off the RELIABLE flag if yo...
virtual void mainloop()
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
vrpn_float64 pos_rot_min[3]
vrpn_float64 vel_rot_max[3]
vrpn_float64 p_vel_quat[4]
vrpn_float64 vel_rot_min[3]
virtual void mainloop()
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
static int VRPN_CALLBACK handle_vel_change_message(void *userdata, vrpn_HANDLERPARAM p)
class VRPN_API vrpn_Analog_Output_Remote
vrpn_float64 p_vel_min[3]
vrpn_Analog_Output_Remote * ana
const vrpn_uint32 vrpn_CONNECTION_LOW_LATENCY
VRPN_API int vrpn_unbuffer(const char **buffer, timeval *t)
Utility routine for taking a struct timeval from a buffer that was sent as a message.
vrpn_float64 p_pos_rot_max[3]
vrpn_int32 req_velocity_m_id
bool setup_channel(vrpn_PA_fullaxis *full)
vrpn_Connection * d_connection
Connection that this object talks to.
vrpn_float64 p_pos_rot_min[3]
This structure is what is passed to a vrpn_Connection message callback.
virtual ~vrpn_Poser_Analog()
vrpn_int32 d_sender_id
Sender ID registered with the connection.
vrpn_float64 p_pos_max[3]
virtual bool request_change_channel_value(unsigned int chan, vrpn_float64 val, vrpn_uint32 class_of_service=vrpn_CONNECTION_RELIABLE)
bool update_Analog_values()
Generic connection class not specific to the transport mechanism.
#define vrpn_gettimeofday
vrpn_float64 p_vel_rot_min[3]
vrpn_float64 p_pos_min[3]
vrpn_float64 pos_rot_max[3]
vrpn_float64 p_vel_quat_dt
vrpn_float64 p_vel_max[3]
vrpn_int32 req_position_m_id
vrpn_Poser_Analog(const char *name, vrpn_Connection *c, vrpn_Poser_AnalogParam *p, bool act_as_tracker=false)
void server_mainloop(void)
Handles functions that all servers should provide in their mainloop() (ping/pong, for example) Should...
struct timeval p_timestamp