From 5f27eb84959081e2b899b9758bc159da411d8879 Mon Sep 17 00:00:00 2001 From: Yi-Shin Li Date: Wed, 23 Mar 2011 02:09:45 +0800 Subject: [PATCH] [BUGFIX] to handle_jog_wheel() + there's NULL pointer for joint.*.jog_vel_mode --- src/emc/motion/control.c | 3 ++- src/emc/motion/motion.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/emc/motion/control.c b/src/emc/motion/control.c index 9e394dfe9..251954e3f 100644 --- a/src/emc/motion/control.c +++ b/src/emc/motion/control.c @@ -1015,6 +1015,7 @@ static void handle_jogwheels(void) if (pos < joint->min_jog_limit) { continue; } + /* The default is to move exactly as far as the wheel commands, even if that move takes much longer than the wheel movement that commanded it. Some folks prefer that the move stop as @@ -1058,7 +1059,7 @@ static void get_pos_cmds(long period) emcmot_axis_t *axis; double positions[EMCMOT_MAX_JOINTS]/*, tmp_pos[EMCMOT_MAX_JOINTS], tmp_vel[EMCMOT_MAX_JOINTS]*/; double old_pos_cmd, new_pos_cmd, new_vel_cmd; - double vel_lim; + // double vel_lim; /* used in teleop mode to compute the max accell requested */ int onlimit = 0; int joint_limit[EMCMOT_MAX_JOINTS][2]; diff --git a/src/emc/motion/motion.c b/src/emc/motion/motion.c index 17ecf71c5..b292ce974 100644 --- a/src/emc/motion/motion.c +++ b/src/emc/motion/motion.c @@ -504,6 +504,7 @@ static int export_joint(int num, joint_hal_t * addr) if ((retval = hal_pin_bit_newf(HAL_IN, &(addr->amp_fault), mot_comp_id, "joint.%d.amp-fault-in", num)) != 0) return retval; if ((retval = hal_pin_s32_newf(HAL_IN, &(addr->jog_counts), mot_comp_id, "joint.%d.jog-counts", num)) != 0) return retval; if ((retval = hal_pin_bit_newf(HAL_IN, &(addr->jog_enable), mot_comp_id, "joint.%d.jog-enable", num)) != 0) return retval; + if ((retval = hal_pin_bit_newf(HAL_IN, &(addr->jog_vel_mode), mot_comp_id, "joint.%d.jog-vel-mode", num)) != 0) return retval; if ((retval = hal_pin_float_newf(HAL_IN, &(addr->jog_scale), mot_comp_id, "joint.%d.jog-scale", num)) != 0) return retval; if ((retval = hal_pin_float_newf(HAL_OUT, &(addr->joint_vel_cmd), mot_comp_id, "joint.%d.vel-cmd", num)) != 0) return retval; if ((retval = hal_pin_float_newf(HAL_OUT, &(addr->backlash_corr), mot_comp_id, "joint.%d.backlash-corr", num)) != 0) return retval;