Classes | Defines | Functions | Variables
dxl_monitor.cpp File Reference
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <time.h>
#include "dynamixel_sdk/dynamixel_sdk.h"
Include dependency graph for dxl_monitor.cpp:

Go to the source code of this file.

Classes

struct  motor

Defines

#define _USE_MATH_DEFINES
#define ADDR_MX_GOAL_ACCELERATION   73
#define ADDR_MX_GOAL_POSITION   30
#define ADDR_MX_GOAL_SPEED   32
#define ADDR_MX_MODEL_NUM   0
#define ADDR_MX_MOVING   46
#define ADDR_MX_PRESENT_LOAD   40
#define ADDR_MX_PRESENT_POSITION   36
#define ADDR_MX_PRESENT_SPEED   38
#define ADDR_MX_PRESENT_TEMPERATURE   43
#define ADDR_MX_TORQUE_ENABLE   24
#define ADDR_PRO_GOAL_ACCELERATION   606
#define ADDR_PRO_GOAL_POSITION   596
#define ADDR_PRO_GOAL_SPEED   600
#define ADDR_PRO_HARDWARE_ERROR   892
#define ADDR_PRO_MODEL_NUM   0
#define ADDR_PRO_MOVING   46
#define ADDR_PRO_PRESENT_CURRENT   621
#define ADDR_PRO_PRESENT_POSITION   611
#define ADDR_PRO_PRESENT_SPEED   615
#define ADDR_PRO_PRESENT_TEMPERATURE   43
#define ADDR_PRO_TORQUE_ENABLE   562
#define ADDR_XH_GOAL_ACCELERATION   40
#define ADDR_XH_GOAL_POSITION   116
#define ADDR_XH_GOAL_SPEED   104
#define ADDR_XH_HARDWARE_ERROR   70
#define ADDR_XH_MODEL_NUM   0
#define ADDR_XH_MOVING   123
#define ADDR_XH_PRESENT_CURRENT   126
#define ADDR_XH_PRESENT_POSITION   132
#define ADDR_XH_PRESENT_SPEED   128
#define ADDR_XH_PRESENT_TEMPERATURE   146
#define ADDR_XH_TORQUE_ENABLE   64
#define BAUDRATE   1000000
#define DEVICENAME   "/dev/USB2DYNAMIXEL"
#define PROTOCOL_VERSION1   1.0
#define PROTOCOL_VERSION2   2.0

Functions

bool bulk_read_err ()
bool bulk_read_load ()
bool bulk_read_pos ()
bool bulk_read_vel ()
bool bulk_write ()
int getch ()
int kbhit (void)
int main (int argc, char *argv[])
bool ping (struct motor &motor)
int32_t rad_s2ticks_s (double rads, struct motor &motor)
int32_t rads2ticks (double rads, struct motor &motor)
bool setTorque (struct motor &motor, bool onoff)
double ticks2rads (int32_t ticks, struct motor &motor)
double ticks_s2rad_s (int32_t ticks, struct motor &motor)

Variables

struct motormotors
int num_motors = 0
dynamixel::PacketHandlerpacketHandler
dynamixel::PortHandlerportHandler

Define Documentation

Definition at line 13 of file dxl_monitor.cpp.

#define ADDR_MX_GOAL_ACCELERATION   73

Definition at line 36 of file dxl_monitor.cpp.

#define ADDR_MX_GOAL_POSITION   30

Definition at line 29 of file dxl_monitor.cpp.

#define ADDR_MX_GOAL_SPEED   32

Definition at line 30 of file dxl_monitor.cpp.

#define ADDR_MX_MODEL_NUM   0

Definition at line 27 of file dxl_monitor.cpp.

#define ADDR_MX_MOVING   46

Definition at line 35 of file dxl_monitor.cpp.

#define ADDR_MX_PRESENT_LOAD   40

Definition at line 33 of file dxl_monitor.cpp.

#define ADDR_MX_PRESENT_POSITION   36

Definition at line 31 of file dxl_monitor.cpp.

#define ADDR_MX_PRESENT_SPEED   38

Definition at line 32 of file dxl_monitor.cpp.

#define ADDR_MX_PRESENT_TEMPERATURE   43

Definition at line 34 of file dxl_monitor.cpp.

#define ADDR_MX_TORQUE_ENABLE   24

Definition at line 28 of file dxl_monitor.cpp.

#define ADDR_PRO_GOAL_ACCELERATION   606

Definition at line 43 of file dxl_monitor.cpp.

#define ADDR_PRO_GOAL_POSITION   596

Definition at line 41 of file dxl_monitor.cpp.

#define ADDR_PRO_GOAL_SPEED   600

Definition at line 42 of file dxl_monitor.cpp.

#define ADDR_PRO_HARDWARE_ERROR   892

Definition at line 49 of file dxl_monitor.cpp.

#define ADDR_PRO_MODEL_NUM   0

Definition at line 39 of file dxl_monitor.cpp.

#define ADDR_PRO_MOVING   46

Definition at line 48 of file dxl_monitor.cpp.

#define ADDR_PRO_PRESENT_CURRENT   621

Definition at line 46 of file dxl_monitor.cpp.

#define ADDR_PRO_PRESENT_POSITION   611

Definition at line 44 of file dxl_monitor.cpp.

#define ADDR_PRO_PRESENT_SPEED   615

Definition at line 45 of file dxl_monitor.cpp.

Definition at line 47 of file dxl_monitor.cpp.

#define ADDR_PRO_TORQUE_ENABLE   562

Definition at line 40 of file dxl_monitor.cpp.

#define ADDR_XH_GOAL_ACCELERATION   40

Definition at line 57 of file dxl_monitor.cpp.

#define ADDR_XH_GOAL_POSITION   116

Definition at line 55 of file dxl_monitor.cpp.

#define ADDR_XH_GOAL_SPEED   104

Definition at line 56 of file dxl_monitor.cpp.

#define ADDR_XH_HARDWARE_ERROR   70

Definition at line 63 of file dxl_monitor.cpp.

#define ADDR_XH_MODEL_NUM   0

Definition at line 53 of file dxl_monitor.cpp.

#define ADDR_XH_MOVING   123

Definition at line 62 of file dxl_monitor.cpp.

#define ADDR_XH_PRESENT_CURRENT   126

Definition at line 60 of file dxl_monitor.cpp.

#define ADDR_XH_PRESENT_POSITION   132

Definition at line 58 of file dxl_monitor.cpp.

#define ADDR_XH_PRESENT_SPEED   128

Definition at line 59 of file dxl_monitor.cpp.

#define ADDR_XH_PRESENT_TEMPERATURE   146

Definition at line 61 of file dxl_monitor.cpp.

#define ADDR_XH_TORQUE_ENABLE   64

Definition at line 54 of file dxl_monitor.cpp.

#define BAUDRATE   1000000

Definition at line 71 of file dxl_monitor.cpp.

#define DEVICENAME   "/dev/USB2DYNAMIXEL"

Definition at line 70 of file dxl_monitor.cpp.

#define PROTOCOL_VERSION1   1.0

Definition at line 66 of file dxl_monitor.cpp.

#define PROTOCOL_VERSION2   2.0

Definition at line 67 of file dxl_monitor.cpp.


Function Documentation

bool bulk_read_err ( )

Definition at line 299 of file dxl_monitor.cpp.

bool bulk_read_load ( )

Definition at line 442 of file dxl_monitor.cpp.

bool bulk_read_pos ( )

Definition at line 346 of file dxl_monitor.cpp.

bool bulk_read_vel ( )

Definition at line 394 of file dxl_monitor.cpp.

bool bulk_write ( )

Definition at line 238 of file dxl_monitor.cpp.

int getch ( )

Definition at line 96 of file dxl_monitor.cpp.

int kbhit ( void  )

Definition at line 113 of file dxl_monitor.cpp.

int main ( int  argc,
char *  argv[] 
)

Definition at line 493 of file dxl_monitor.cpp.

bool ping ( struct motor motor)

Definition at line 187 of file dxl_monitor.cpp.

int32_t rad_s2ticks_s ( double  rads,
struct motor motor 
)

Definition at line 168 of file dxl_monitor.cpp.

int32_t rads2ticks ( double  rads,
struct motor motor 
)

Definition at line 156 of file dxl_monitor.cpp.

bool setTorque ( struct motor motor,
bool  onoff 
)

Definition at line 216 of file dxl_monitor.cpp.

double ticks2rads ( int32_t  ticks,
struct motor motor 
)

Definition at line 145 of file dxl_monitor.cpp.

double ticks_s2rad_s ( int32_t  ticks,
struct motor motor 
)

Definition at line 178 of file dxl_monitor.cpp.


Variable Documentation

struct motor* motors

Definition at line 89 of file dxl_monitor.cpp.

int num_motors = 0

Definition at line 90 of file dxl_monitor.cpp.

Definition at line 92 of file dxl_monitor.cpp.

Definition at line 93 of file dxl_monitor.cpp.



robotican_hardware_interface
Author(s):
autogenerated on Fri Oct 27 2017 03:02:48