Discussion:
Error in Python Interface documentation?
(too old to reply)
Kurt Jacobson
2017-04-09 19:54:57 UTC
Permalink
Raw Message
Greetings,

Since you all are so helpful I am going to bother you again!

As I learned yesterday I have to change motion mode to home and unhome
joints in 2.8, so I decided to add a "motion mode" indicator to my UI.

Based on the Python Interface docs[1] it looks like stat.motion_type should
return one of TRAJ_MODE_COORD, TRAJ_MODE_FREE, TRAJ_MODE_TELEOP, but as
far as I can tell it only returns 0, which is not equal to any of
TRAJ_MODE_COORD, TRAJ_MODE_FREE, TRAJ_MODE_TELEOP which are 2, 1, 3
respectively.

I think stat.motion_mode just might be returning the TRAJ_MODE instead of
stat.motion_type as stated in the docs.

Where would I look to prove (or disprove) this?

Thanks,

Kurt

[1] http://linuxcnc.org/docs/devel/html/config/python-interface.html
Sebastian Kuzminsky
2017-04-09 22:22:15 UTC
Permalink
Raw Message
Post by Kurt Jacobson
Based on the Python Interface docs[1] it looks like stat.motion_type should
return one of TRAJ_MODE_COORD, TRAJ_MODE_FREE, TRAJ_MODE_TELEOP, but as
far as I can tell it only returns 0, which is not equal to any of
TRAJ_MODE_COORD, TRAJ_MODE_FREE, TRAJ_MODE_TELEOP which are 2, 1, 3
respectively.
Oops, the documentation is wrong here.

stat.motion_type has the same value as the motion.motion_type HAL pin,
described in the motion(9) manpage:
http://linuxcnc.org/docs/devel/html/man/man9/motion.9.html#MOTION PINS

stat.motion_mode has the mode of the Motion controller, that's what
you're looking for.

I updated the python-interface webpage and the linuxcnc python module
doc strings to reflect this.
--
Sebastian Kuzminsky
Kurt Jacobson
2017-04-09 22:46:43 UTC
Permalink
Raw Message
Post by Sebastian Kuzminsky
Oops, the documentation is wrong here.
So I had a good reason to be confused this time, that does not happen to me
often :)
Post by Sebastian Kuzminsky
stat.motion_type has the same value as the motion.motion_type HAL pin,
http://linuxcnc.org/docs/devel/html/man/man9/motion.9.html#MOTION PINS
That explains why I did not notice stat.motion_type deviate from 0 when I
was testing, since I was only changing the motion mode. I guess if I had
issued an MDI is would have changed, and then I would have been really
confused.

I updated the python-interface webpage and the linuxcnc python module
Post by Sebastian Kuzminsky
doc strings to reflect this.
Thanks Sebastian!

Kurt
Post by Sebastian Kuzminsky
Post by Kurt Jacobson
Based on the Python Interface docs[1] it looks like stat.motion_type
should
Post by Kurt Jacobson
return one of TRAJ_MODE_COORD, TRAJ_MODE_FREE, TRAJ_MODE_TELEOP, but as
far as I can tell it only returns 0, which is not equal to any of
TRAJ_MODE_COORD, TRAJ_MODE_FREE, TRAJ_MODE_TELEOP which are 2, 1, 3
respectively.
Oops, the documentation is wrong here.
stat.motion_type has the same value as the motion.motion_type HAL pin,
http://linuxcnc.org/docs/devel/html/man/man9/motion.9.html#MOTION PINS
stat.motion_mode has the mode of the Motion controller, that's what
you're looking for.
I updated the python-interface webpage and the linuxcnc python module
doc strings to reflect this.
--
Sebastian Kuzminsky
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Emc-developers mailing list
https://lists.sourceforge.net/lists/listinfo/emc-developers
Loading...