Record g-code live.

More
24 Jan 2012 15:03 #17097 by dab77
Record g-code live. was created by dab77
Hi, I just managed one way to record the teleop joystick manual movements into a g-code program.
I know maybe is not anything useful for cnc'ers, but i write here just for the sake of knowledge..
I wrote a handler into python that is called when one button on my joystick is pushed. This function open a file and append into it
the speed, xpos,ypos and zpos every "interval", i.e. every second.
output is like this:
G1 F 'speed' X 'xpos' Y 'ypos' Z 'zpos'

for the timing i use this routine:
prev_time = time.time()

def on_recording:
if (time.time() - prev_time) > 1:
write_into_your_file
prev_time = time.time()

I still need to find a clever way to add at the end an M2. maybe wasting another joystick button..

Any other suggestion or comments are welcome.
Davide.

Please Log in or Create an account to join the conversation.

More
24 Jan 2012 18:45 #17101 by andypugh
Replied by andypugh on topic Re:Record g-code live.
dab77 wrote:

I still need to find a clever way to add at the end an M2. maybe wasting another joystick button..


Does teach_in.py do that? (Does it do anything? I have only ever seen the filename :-)
git.linuxcnc.org/gitweb?p=emc2.git;a=blo.../scripts/teach-in.py
Hmm, no, it seems to output positions, but not in G-code.

Please Log in or Create an account to join the conversation.

Time to create page: 0.942 seconds
Powered by Kunena Forum