17#include "vrpn_Analog.h"
18#include "vrpn_Button.h"
19#include "vrpn_Analog_Output.h"
20#include "vrpn_Configure.h"
21#include "vrpn_Connection.h"
22#include "vrpn_Shared.h"
23#include "vrpn_Types.h"
32 ,
int run_speed_tics_sec = 3200
33 ,
int start_speed_tics_sec = 1200
34 ,
int end_speed_tics_sec = 2000
35 ,
int accel_rate_tics_sec_sec = 40000
36 ,
int decel_rate_tics_sec_sec = 100000
37 ,
int run_current = 290
38 ,
int hold_current = 0
39 ,
int accel_current = 290
40 ,
int decel_current = 290
43 ,
int high_limit_index = -1
44 ,
int low_limit_index = -1
45 ,
int output_1_setting = -1
46 ,
int output_2_setting = -1
47 ,
int output_3_setting = -1
48 ,
int output_4_setting = -1
49 ,
double initial_move = 0
50 ,
double fractional_c_a = 1.0
51 ,
double reset_location = 0.0
59 unsigned char d_buffer[512];
62 struct timeval d_timestamp;
64 int d_run_speed_tics_sec;
65 int d_start_speed_tics_sec;
66 int d_end_speed_tics_sec;
67 int d_accel_rate_tics_sec_sec;
68 int d_decel_rate_tics_sec_sec;
75 int d_high_limit_index;
76 int d_low_limit_index;
77 int d_output_1_setting;
78 int d_output_2_setting;
79 int d_output_3_setting;
80 int d_output_4_setting;
81 double d_initial_move;
82 double d_fractional_c_a;
83 double d_reset_location;
84 struct timeval d_last_poll;
86 virtual int reset(
void);
87 virtual int get_report(
void);
117 (vrpn_uint32 class_of_service = vrpn_CONNECTION_RELIABLE);
120 (vrpn_uint32 class_of_service = vrpn_CONNECTION_RELIABLE);
定义 vrpn_Analog_Output.h:26
Generic connection class not specific to the transport mechanism.
定义 vrpn_Connection.h:562
bool send_move_request(vrpn_float64 location_in_steps, double scale=1.0)
Request a move from the motor to the specified location.
static int VRPN_CALLBACK handle_request_message(void *userdata, vrpn_HANDLERPARAM p)
virtual void mainloop()
Called once through each main loop iteration to handle updates.
int convert_report_to_position(unsigned char *buf)
Parses a position report. Returns -1 on failure, 0 on no value
int convert_report_to_buttons(unsigned char *buf)
Parses an input/output report. Returns -1 on failure, 0 on no value
bool send_command(const char *cmd)
Appends carriage-return and then sends the command.
virtual void report_changes(vrpn_uint32 class_of_service=vrpn_CONNECTION_RELIABLE)
send report iff changed
static int VRPN_CALLBACK handle_request_channels_message(void *userdata, vrpn_HANDLERPARAM p)
Responds to a request to change multiple channels at once.
bool move_until_done_or_error(vrpn_float64 location_in_steps, double scale=1.0)
Send a move request and then wait for the move to complete. Repeat
virtual void report(vrpn_uint32 class_of_service=vrpn_CONNECTION_RELIABLE)
send report whether or not changed
static int VRPN_CALLBACK handle_connect_message(void *userdata, vrpn_HANDLERPARAM p)
Responds to a connection request with a report of the values
This structure is what is passed to a vrpn_Connection message callback.
定义 vrpn_Connection.h:41