Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions include/ypspur-md.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,53 +121,53 @@ typedef struct
int connection_error;
} YPSpur;

/** init */
// init
int YPSpur_md_init(YPSpur* dev);
int YPSpur_md_initex(YPSpur* dev, int msq_key);
int YPSpur_md_init_socket(YPSpur* dev, char* ip, int port);

/** freeze */
// freeze
int YPSpur_md_isfreeze(YPSpur* dev);
int YPSpur_md_freeze(YPSpur* dev);
int YPSpur_md_unfreeze(YPSpur* dev);

/** motor servo */
// motor servo
int YPSpur_md_stop(YPSpur* dev);
int YPSpur_md_free(YPSpur* dev);
int YP_md_openfree(YPSpur* dev);

/** Spur_md */
// Spur_md
int YPSpur_md_line(YPSpur* dev, int cs, double x, double y, double theta);
int YPSpur_md_stop_line(YPSpur* dev, int cs, double x, double y, double theta);
int YPSpur_md_circle(YPSpur* dev, int cs, double x, double y, double r);
int YPSpur_md_spin(YPSpur* dev, int cs, double theta);
int YPSpur_md_orient(YPSpur* dev, int cs, double theta);

/** setter */
// setter
int YPSpur_md_set_pos(YPSpur* dev, int cs, double x, double y, double theta);
int YPSpur_md_adjust_pos(YPSpur* dev, int cs, double x, double y, double theta);
int YPSpur_md_set_vel(YPSpur* dev, double v);
int YPSpur_md_set_angvel(YPSpur* dev, double w);
int YPSpur_md_set_accel(YPSpur* dev, double v);
int YPSpur_md_set_angaccel(YPSpur* dev, double w);

/** getter */
// getter
double YPSpur_md_get_pos(YPSpur* dev, int cs, double* x, double* y, double* theta);
double YPSpur_md_get_vel(YPSpur* dev, double* v, double* w);
double YPSpur_md_get_force(YPSpur* dev, double* trans, double* angular);

/** check position */
// check position
int YPSpur_md_near_pos(YPSpur* dev, int cs, double x, double y, double r);
int YPSpur_md_near_ang(YPSpur* dev, int cs, double th, double d);
int YPSpur_md_over_line(YPSpur* dev, int cs, double x, double y, double theta);

/** direct */
// direct
int YPSpur_md_vel(YPSpur* dev, double v, double w);

/** tilt */
// tilt
int YPSpur_md_tilt(YPSpur* dev, int cs, double dir, double tilt);

/* 裏コマンド集 */
// 裏コマンド集
int YP_md_get_error_state(YPSpur* dev);
void YP_md_request_device_dump(YPSpur* dev, int id, int block);

Expand Down
22 changes: 11 additions & 11 deletions include/ypspur.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ extern "C"
{
#endif // __cplusplus

/* YPSpurコマンド集 */
// YPSpurコマンド集
#define Spur_init() YPSpur_init()
#define Spur_initex(msq) YPSpur_initex(msq)
#define Spur_init_socket(ip, port) YPSpur_init_socket(ip, port)
Expand Down Expand Up @@ -115,53 +115,53 @@ extern "C"
#define Spur_tilt_BS(d, t) YPSpur_tilt(CS_BS, d, t)
#define Spur_tilt_BL(d, t) YPSpur_tilt(CS_BL, d, t)

/** init */
// init
int YPSpur_init(void);
int YPSpur_initex(int msq_key);
int YPSpur_init_socket(char* ip, int port);

/** freeze */
// freeze
int YPSpur_isfreeze(void);
int YPSpur_freeze(void);
int YPSpur_unfreeze(void);

/** motor servo */
// motor servo
int YPSpur_stop(void);
int YPSpur_free(void);
int YP_openfree(void);

/** spur */
// spur
int YPSpur_line(int cs, double x, double y, double theta);
int YPSpur_stop_line(int cs, double x, double y, double theta);
int YPSpur_circle(int cs, double x, double y, double r);
int YPSpur_spin(int cs, double theta);
int YPSpur_orient(int cs, double theta);

/** setter */
// setter
int YPSpur_set_pos(int cs, double x, double y, double theta);
int YPSpur_adjust_pos(int cs, double x, double y, double theta);
int YPSpur_set_vel(double v);
int YPSpur_set_angvel(double w);
int YPSpur_set_accel(double v);
int YPSpur_set_angaccel(double w);

/** getter */
// getter
double YPSpur_get_pos(int cs, double* x, double* y, double* theta);
double YPSpur_get_vel(double* v, double* w);
double YPSpur_get_force(double* trans, double* angular);

/** check position */
// check position
int YPSpur_near_pos(int cs, double x, double y, double r);
int YPSpur_near_ang(int cs, double th, double d);
int YPSpur_over_line(int cs, double x, double y, double theta);

/** direct */
// direct
int YPSpur_vel(double v, double w);

/** tilt */
// tilt
int YPSpur_tilt(int cs, double dir, double tilt);

/* 裏コマンド集 */
// 裏コマンド集
int YP_get_error_state(void);
void YP_request_device_dump(int id, int block);

Expand Down
10 changes: 5 additions & 5 deletions include/ypspur/command.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void message_return(struct ipcmd_t* ipcmd, long retpid, YPSpur_msg* res_msg);
void init_command_thread(pthread_t* thread);
SpurUserParamsPtr get_spur_user_param_ptr();

/* command_run.c */
// command_run.c
void line_com(int cs, double* data, SpurUserParamsPtr spur);
void stop_line_com(int cs, double* data, SpurUserParamsPtr spur);
void circle_com(int cs, double* data, SpurUserParamsPtr spur);
Expand All @@ -110,7 +110,7 @@ void vel_com(double* data, SpurUserParamsPtr spur);
void wheel_vel_com(double* data, SpurUserParamsPtr spur);
void wheel_angle_com(double* data, SpurUserParamsPtr spur);

/* command_set.c */
// command_set.c
void set_pos_com(int cs, double* data, SpurUserParamsPtr spur);
void set_GL_on_GL_com(double* data, SpurUserParamsPtr spur);
void set_adjust_com(int cs, double* data, SpurUserParamsPtr spur);
Expand All @@ -123,7 +123,7 @@ void set_torque_com(double* data, SpurUserParamsPtr spur);
void set_wheel_vel_com(double* data, SpurUserParamsPtr spur);
void set_wheel_accel_com(double* data, SpurUserParamsPtr spur);

/* command_get.c */
// command_get.c
void get_pos_com(int cs, double* data, double* resdata, SpurUserParamsPtr spur);
void get_vel_com(int cs, double* data, double* resdata, SpurUserParamsPtr spur);
void get_vref_com(int cs, double* data, double* resdata, SpurUserParamsPtr spur);
Expand All @@ -136,12 +136,12 @@ void get_wheel_ang_com(double* data, double* resdata, SpurUserParamsPtr spur);
void get_force_com(int cs, double* data, double* resdata, SpurUserParamsPtr spur);
void get_wheel_torque_com(int cs, double* data, double* resdata, SpurUserParamsPtr spur);

/* command_param.c */
// command_param.c
void param_set_com(int cs, double* data, SpurUserParamsPtr spur);
int param_get_com(int cs, double* resdata, SpurUserParamsPtr spur);
void param_state_com(int cs, double* data, SpurUserParamsPtr spur);

/* command_ad.c */
// command_ad.c
void get_ad_com(double* data, double* resdata);
void set_io_dir_com(double* data, double* resdata);
void set_io_data_com(double* data, double* resdata);
Expand Down
32 changes: 16 additions & 16 deletions include/ypspur/msq.win32.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,32 +65,32 @@ typedef unsigned long int msglen_t;

struct ipc_perm
{
key_t __key; /* Key. */
uid_t uid; /* Owner's user ID. */
gid_t gid; /* Owner's group ID. */
uid_t cuid; /* Creator's user ID. */
gid_t cgid; /* Creator's group ID. */
unsigned short int mode; /* Read/write permission. */
key_t __key; // Key.
uid_t uid; // Owner's user ID.
gid_t gid; // Owner's group ID.
uid_t cuid; // Creator's user ID.
gid_t cgid; // Creator's group ID.
unsigned short int mode; // Read/write permission.
unsigned short int __pad1;
unsigned short int __seq; /* Sequence number. */
unsigned short int __seq; // Sequence number.
unsigned short int __pad2;
unsigned long int __unused1;
unsigned long int __unused2;
};
struct msqid_ds
{
struct ipc_perm msg_perm; /* structure describing operation permission */
time_t msg_stime; /* time of last msgsnd command */
struct ipc_perm msg_perm; // structure describing operation permission
time_t msg_stime; // time of last msgsnd command
unsigned long int __unused1;
time_t msg_rtime; /* time of last msgrcv command */
time_t msg_rtime; // time of last msgrcv command
unsigned long int __unused2;
time_t msg_ctime; /* time of last change */
time_t msg_ctime; // time of last change
unsigned long int __unused3;
unsigned long int __msg_cbytes; /* current number of bytes on queue */
msgqnum_t msg_qnum; /* number of messages currently on queue */
msglen_t msg_qbytes; /* max number of bytes allowed on queue */
pid_t msg_lspid; /* pid of last msgsnd() */
pid_t msg_lrpid; /* pid of last msgrcv() */
unsigned long int __msg_cbytes; // current number of bytes on queue
msgqnum_t msg_qnum; // number of messages currently on queue
msglen_t msg_qbytes; // max number of bytes allowed on queue
pid_t msg_lspid; // pid of last msgsnd()
pid_t msg_lrpid; // pid of last msgrcv()
unsigned long int __unused4;
unsigned long int __unused5;
};
Expand Down
3 changes: 1 addition & 2 deletions include/ypspur/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#define DEFAULT_BAUDRATE 38400

/* for measurement time estimation */
// for measurement time estimation
extern double SER_BAUDRATE; /// (Byte/sec) シリアルの通信速度
#define SER_INTERVAL 0.0050
// #define SER_BYTES 13.0
Expand All @@ -36,7 +36,6 @@ int serial_tryconnect(char* device_name);
int serial_connect(char* device_name);
int serial_change_baudrate(int baud);

/*----------------PBS_close------------------*/
int serial_close(void);
int serial_write(char* buf, int len);
int serial_recieve(int (*serial_event)(char*, int, double, void*), void* data);
Expand Down
12 changes: 4 additions & 8 deletions include/ypspur/ypparam.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ typedef int pid_t;

#endif // defined(_WIN32)

/* コマンドナンバー */
// コマンドナンバー
enum
{
YPSPUR_FREE = 0x10,
Expand Down Expand Up @@ -113,9 +113,8 @@ enum
YPSPUR_GET_JOINT_TORQUE,
};

/* パラメータナンバー */
/* set_parameter用 */
/* マイコンに送る情報は反映されない */
// パラメータナンバー
// set_parameter用でマイコンに送る値とは異なる
typedef enum
{
// システム
Expand Down Expand Up @@ -221,7 +220,7 @@ typedef enum
YP_PARAM_MAX_TIME_JUMP,
YP_PARAM_MAX_TIME_JUMP_NEG,

YP_PARAM_NUM ///< パラメータの最大値
YP_PARAM_NUM /// パラメータの最大値
} YPSpur_param;

// 自分で指定しない(できない)パラメータは最初の文字が'_'で始まっている
Expand Down Expand Up @@ -480,8 +479,6 @@ enum motor_id
#define YP_PARAM_REQUIRED_VERSION 4.0
#define YP_PARAM_SUPPORTED_VERSION 5.0

/* パラメータの有効・無効 */
/* control_state用   */
typedef enum
{
YP_STATE_MOTOR = 0,
Expand All @@ -493,7 +490,6 @@ typedef enum
YP_STATE_NUM
} YPSpur_state;

/** メッセージ関連 */
typedef enum
{
CS_BS = 0,
Expand Down
4 changes: 2 additions & 2 deletions include/ypspur/ypprotocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ extern "C"
{
#endif // __cplusplus

/** Structure of VV command */
/// Structure of VV command
typedef struct VERSION_INFO
{
char vender[128];
Expand All @@ -39,7 +39,7 @@ typedef struct VERSION_INFO
char serialno[128];
} Ver_t;

/** Structure of PP command */
/// Structure of PP command
typedef struct PARAMETER_INFO
{
char pwm_resolution[128];
Expand Down
10 changes: 5 additions & 5 deletions src/adinput.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
#include <sys/types.h>
#include <time.h>

/* yp-spur用 */
// yp-spur用
#include <ypspur/odometry.h>
#include <ypspur/serial.h>
#include <ypspur/utility.h>

/* ライブラリ用 */
// ライブラリ用
#include <ypspur.h>

int ad[16]; // ad値保存用バッファ
Expand All @@ -60,7 +60,7 @@ int process_addata(unsigned char* buf, int len)
return ad_num;
}

/* read ad data func for ssm write */
// read ad data func for ssm write
const int* get_addataptr()
{
return ad;
Expand Down Expand Up @@ -98,7 +98,7 @@ int admask_receive(char* buf, int len, double receive_time, void* data)

int set_admask(unsigned char mask)
{
/* Send & Recive Buffer */
// Send & Recive Buffer
char buf[2048];
int i;

Expand Down Expand Up @@ -132,7 +132,7 @@ int set_admask(unsigned char mask)

int set_diomask(unsigned char enable)
{
/* Send & Recive Buffer */
// Send & Recive Buffer
char buf[2048];
dio_num = 0;

Expand Down
Loading
Loading