- Posts: 198
- Thank you received: 0
jogging through Python interface fails for joints/axes != 0 (LinuxCNC master)
9 years 8 months ago #88628
by DaBit
At some point in time I ran into the problem that I cannot jog an axis or joint other than 0 through the Python interface.
LinuxCNC is master, up to date.
When running sim.axis, axis_mm.ini, this code fails:
Link to the doc for the Python interface: linuxcnc.org/docs/devel/html/config/pyth...ommand_tt_attributes
Previously it worked, but I don't know exactly when it stopped doing that. Bug or user error?
LinuxCNC is master, up to date.
When running sim.axis, axis_mm.ini, this code fails:
Code:
#!/usr/bin/env python
import linuxcnc
command = linuxcnc.command()
status = linuxcnc.stat()
status.poll()
if status.task_mode != linuxcnc.MODE_MANUAL:
print "Switching to manual mode.."
command.mode(linuxcnc.MODE_MANUAL)
# Switching TP mode does not make any difference
#if status.motion_type == linuxcnc.TRAJ_MODE_TELEOP:
#print "Switching to joint mode.."
#command.traj_mode(linuxcnc.MODE_FREE)
#command.teleop_enable(False)
# axis/joint 0, this works
command.jog(linuxcnc.JOG_INCREMENT,0,False,100,1)
# axis/joint 1, produces bad axis num cmd=48 error. It also fails if we want to jog in Joint mode.
command.jog(linuxcnc.JOG_INCREMENT,1,False,100,1)
Link to the doc for the Python interface: linuxcnc.org/docs/devel/html/config/pyth...ommand_tt_attributes
Previously it worked, but I don't know exactly when it stopped doing that. Bug or user error?
Please Log in to join the conversation.
9 years 8 months ago #88630
by dgarrett
Replied by dgarrett on topic jogging through Python interface fails for joints/axes != 0 (LinuxCNC master)
In the master branch, as updated for joints_axes, the second
parameter to the jog() command is a joint-flag to select
jointmode (True) or teleop (False) jogging and the third
parameter is an axis-or-joint-number
so your failing commmand:
updated docs:
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...a457bd6ffdece845920c
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...6fe92f55c04b30937edf
eventually these will show up here:
linuxcnc.org/docs/devel/html/config/python-interface.html
parameter to the jog() command is a joint-flag to select
jointmode (True) or teleop (False) jogging and the third
parameter is an axis-or-joint-number
so your failing commmand:
should probably be:command.jog(linuxcnc.JOG_INCREMENT,1,False,100,1)
command.jog(linuxcnc.JOG_INCREMENT,False,1,100,1)
updated docs:
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...a457bd6ffdece845920c
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...6fe92f55c04b30937edf
eventually these will show up here:
linuxcnc.org/docs/devel/html/config/python-interface.html
Please Log in to join the conversation.
9 years 8 months ago #88636
by DaBit
Replied by DaBit on topic jogging through Python interface fails for joints/axes != 0 (LinuxCNC master)
I can confirm that swapping axis-num and joint-flag solves the problem
Thanks!
Thanks!
Please Log in to join the conversation.
Time to create page: 0.151 seconds
