56 lines
1.8 KiB
C
56 lines
1.8 KiB
C
#ifndef LINUXCNC_WEB_WASM_SIM_KINEMATICS_HOME_LIMIT_H
|
|
#define LINUXCNC_WEB_WASM_SIM_KINEMATICS_HOME_LIMIT_H
|
|
|
|
#include "sim_kinematics.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
enum sim_kinematics_home_limit_result {
|
|
SIM_KIN_HOME_OK = 0,
|
|
SIM_KIN_HOME_ERR_ARGUMENT = -840,
|
|
SIM_KIN_HOME_ERR_CONFIGURATION = -841,
|
|
SIM_KIN_HOME_ERR_UNHOMED = -842,
|
|
SIM_KIN_HOME_ERR_LIMIT = -843,
|
|
SIM_KIN_HOME_ERR_FORWARD = -844,
|
|
SIM_KIN_HOME_ERR_NONFINITE = -845,
|
|
SIM_KIN_HOME_ERR_SEQUENCE = -846,
|
|
};
|
|
|
|
typedef struct sim_kinematics_home_limit_state {
|
|
sim_posemath_pose pose;
|
|
double joints[SIM_KIN_MAX_JOINTS];
|
|
uint32_t joint_count;
|
|
uint32_t homed;
|
|
uint32_t home_sequence;
|
|
uint32_t tick;
|
|
int last_error;
|
|
int limit_error;
|
|
int kinematics_error;
|
|
} sim_kinematics_home_limit_state;
|
|
|
|
typedef struct sim_kinematics_home_limit {
|
|
sim_kinematics *kinematics;
|
|
sim_kinematics_home_limit_state state;
|
|
} sim_kinematics_home_limit;
|
|
|
|
int sim_kinematics_home_limit_init(sim_kinematics_home_limit *home_limit,
|
|
sim_kinematics *kinematics,
|
|
uint32_t joint_count);
|
|
int sim_kinematics_home_limit_reset(sim_kinematics_home_limit *home_limit);
|
|
int sim_kinematics_home_limit_home(sim_kinematics_home_limit *home_limit,
|
|
uint32_t home_sequence);
|
|
int sim_kinematics_home_limit_check(sim_kinematics_home_limit *home_limit,
|
|
const double *joints,
|
|
uint32_t joint_count);
|
|
int sim_kinematics_home_limit_read(const sim_kinematics_home_limit *home_limit,
|
|
sim_kinematics_home_limit_state *state);
|
|
uint64_t sim_kinematics_home_limit_state_hash(const sim_kinematics_home_limit *home_limit);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|