QtDragon USB gamepad jogging
02 Mar 2021 03:38 - 02 Mar 2021 03:44 #200755
by turbostew
QtDragon USB gamepad jogging was created by turbostew
Hello All,
I am trying to get my USB game pad to do jogging with buttons just like the arrow/pgu/dn buttons. I have the hal getting all the signals from the game pad and I can see them working on the hal meter but I am a bit confused how to connect it to the QtGragon GUI (using linuxcnc 2.9). I read a few tutorials but they are older and for analog jogging. I connected them in my main HAL like so but no luck, also tried many, many other things.
net axis-select-x input.0.abs-a-is-pos => halui.axis.x.select
net jog-x-pos input.0.abs-hat0x-is-pos => halui.axis.x.plus halui.joint.0.plus
net jog-x-neg input.0.abs-hat0x-is-neg => halui.axis.x.minus halui.joint.0.minus
Idears???
I am trying to get my USB game pad to do jogging with buttons just like the arrow/pgu/dn buttons. I have the hal getting all the signals from the game pad and I can see them working on the hal meter but I am a bit confused how to connect it to the QtGragon GUI (using linuxcnc 2.9). I read a few tutorials but they are older and for analog jogging. I connected them in my main HAL like so but no luck, also tried many, many other things.
net axis-select-x input.0.abs-a-is-pos => halui.axis.x.select
net jog-x-pos input.0.abs-hat0x-is-pos => halui.axis.x.plus halui.joint.0.plus
net jog-x-neg input.0.abs-hat0x-is-neg => halui.axis.x.minus halui.joint.0.minus
Idears???
Last edit: 02 Mar 2021 03:44 by turbostew.
Please Log in or Create an account to join the conversation.
02 Mar 2021 04:17 #200756
by persei8
Replied by persei8 on topic QtDragon USB gamepad jogging
This is how I do mine.
It uses 2 OR2's but I need a third for other stuff.
This works for a sixaxis PS3 controller so you may need some adjustments.
Jim
loadrt or2 count=3
loadrt mux4 count=1
addf or2.0 servo-thread
addf or2.1 servo-thread
addf or2.2 servo-thread
addf mux4.0 servo-thread
..... bunch of other stuff
setp mux4.0.in0 0 # this one must be 0 to prevent motion unless a button is pressed
setp mux4.0.in1 600
setp mux4.0.in2 1200
setp mux4.0.in3 2400
# the following sets the jog speeds
net remote-speed-slow or2.1.in0 input.0.btn-a
net remote-speed-medium or2.0.in0 input.0.btn-b
net remote-speed-fast or2.1.in1 or2.0.in1 input.0.btn-x
net joy-speed-1 mux4.0.sel0 <= or2.1.out
net joy-speed-2 mux4.0.sel1 <= or2.0.out
net joy-speed-final halui.axis.jog-speed <= mux4.0.out
net joy-x-jog halui.axis.x.analog <= input.0.abs-x-position
net joy-y-jog halui.axis.y.analog <= input.0.abs-y-position
net joy-z-jog halui.axis.z.analog <= input.0.abs-ry-position
setp input.0.abs-y-scale -127.5
setp input.0.abs-z-scale -127.5
It uses 2 OR2's but I need a third for other stuff.
This works for a sixaxis PS3 controller so you may need some adjustments.
Jim
Please Log in or Create an account to join the conversation.
02 Mar 2021 13:06 #200780
by cmorley
Replied by cmorley on topic QtDragon USB gamepad jogging
Your code probably would have worked except you didn't set a jog speed in halui.
Jogging with dragon and jogging with halui are completely separate.
Jogging with dragon and jogging with halui are completely separate.
Please Log in or Create an account to join the conversation.
02 Mar 2021 15:49 #200794
by turbostew
Replied by turbostew on topic QtDragon USB gamepad jogging
Thanks Jim and Chris,
Ok, got it working, one of my problems was I was not homing first. Did not know it only works when homed. How do I make jog work when not homed?
Ok, got it working, one of my problems was I was not homing first. Did not know it only works when homed. How do I make jog work when not homed?
Please Log in or Create an account to join the conversation.
02 Mar 2021 17:39 #200803
by turbostew
Replied by turbostew on topic QtDragon USB gamepad jogging
i found a hint, had to add joint. that works for unhomed...
net jog-speed halui.axis.jog-speed halui.joint.jog-speed
net joy-x-jog input.0.abs-hat0x-position => halui.axis.x.analog halui.joint.0.analog
Kent
net jog-speed halui.axis.jog-speed halui.joint.jog-speed
net joy-x-jog input.0.abs-hat0x-position => halui.axis.x.analog halui.joint.0.analog
Kent
Please Log in or Create an account to join the conversation.
03 Mar 2021 12:42 #200897
by cmorley
Replied by cmorley on topic QtDragon USB gamepad jogging
Yes I should probably add optional jog pins to qtvcp to avoid HALUI altogether.
Please Log in or Create an account to join the conversation.
Moderators: cmorley
Time to create page: 0.097 seconds