Skip to content

vismach: unify static and Hal* transform and primitive classes - #4944

Open
Sigma1912 wants to merge 1 commit into
LinuxCNC:masterfrom
Sigma1912:vismach_Merge_static_and_Hal_classes
Open

Sigma1912 wants to merge 1 commit into
LinuxCNC:masterfrom
Sigma1912:vismach_Merge_static_and_Hal_classes

Conversation

@Sigma1912

@Sigma1912 Sigma1912 commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

This is step 1 of #4932

Consolidate separate static and HAL-animated transform and geometry classes into single unified implementations while maintaining full backwards compatibility:

  • Merge Translate, Scale, Rotate, RotateEuler, and Show to accept both static values and an optional hal.component with HAL pin names.

  • Merge Line, Grid, Plane, and Coords primitives to support origin, normal, and normal+direction modes with optional HAL component arguments.

  • Consolidate CylinderX, CylinderY, and CylinderZ using a shared _CylinderAxis base class.

  • Retain all legacy Hal* class names as aliases for backwards compatibility.

  • Update vismach.adoc to document the unified classes and legacy aliases.

  • Also removed a double 'import hal'

Checked:

  • All in-tree models load without errors and move correctly.
  • All transform and primitive classes had their signature call forms tested and verified by a test script.

@BsAtHome

BsAtHome commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Why does the package test fail? Have you rebased to master to include #4890 that was merged today, which fixes some issue(s)?

Running test: /__w/linuxcnc/linuxcnc/tests/kins-limits/box
*** /__w/linuxcnc/linuxcnc/tests/kins-limits/box: FAIL: checkresult exited with 1
************** result:
        === test.ini
        Machine configuration file is 'test.ini'
        Starting LinuxCNC...
        linuxcnc TPMOD=tpmod HOMEMOD=homemod EMCMOT=motmod
        Found file(REL): ./sim.hal
        task: main loop took 0.018376 seconds
        task: main loop took 0.018145 seconds
        Must be in MDI mode to issue MDI command
        Must be in MDI mode to issue MDI command
        Must be in MDI mode to issue MDI command
        Must be in MDI mode to issue MDI command
        task: main loop took 0.018999 seconds
        
        !!! switchkins-type 0 is 5axiskins
        task: main loop took 0.018786 seconds
        task: main loop took 0.018311 seconds
        task: main loop took 0.019129 seconds
        task: main loop took 0.018268 seconds
        task: main loop took 0.019333 seconds
        task: main loop took 0.018884 seconds
        carriage X 0.000, tip X 0.000
        *** ERROR the tip is 0.000 from the carriage, not 300
        *** ERROR G0 X600 was refused: Must be in MDI mode to issue MDI command
        *** ERROR G0 X-300 was accepted
        *** ERROR G0 X-300 moved the joints
        refused as expected: Linear move on line 0 would exceed X's negative limit
        refused as expected: Joint interpolated move on line 0 would exceed X's negative limit
        accepted as expected: G53.5 G0 X400            carriage X 400.000
        Exiting with 4 errors
        Shutting down and cleaning up LinuxCNC...
        task: 1042 cycles, min=0.000003, max=0.019333, avg=0.001131, 9 latency excursions (> 10x expected cycle time of 0.001000s)
        
        !!! switchkins-type 0 is 5axiskins
        switchkins-type 0 declared: primary
        switchkins-type 1 declared: identity machine
        LinuxCNC terminated with an error.  You can find more information in the log:
            /home/testrunner/linuxcnc_debug.txt
        and
            /home/testrunner/linuxcnc_print.txt
        as well as in the output of the shell command 'dmesg' and in the terminal
        === maxkins.ini
        Machine configuration file is 'maxkins.ini'
        Starting LinuxCNC...
        linuxcnc TPMOD=tpmod HOMEMOD=homemod EMCMOT=motmod
        Found file(REL): ./maxkins.hal
        task: main loop took 0.020108 seconds
        task: main loop took 0.018888 seconds
        task: main loop took 0.019155 seconds
        task: main loop took 0.018227 seconds
        task: main loop took 0.018400 seconds
        task: main loop took 0.018268 seconds
        task: main loop took 0.018787 seconds
        task: main loop took 0.018249 seconds
        task: main loop took 0.018977 seconds
        task: main loop took 0.018834 seconds
        carriage X -300.000, tip X 0.000
        accepted as expected: G0 X700                  carriage X 400.000
        refused as expected: Linear move on line 0 would exceed X's negative limit
        refused as expected: Linear move on line 0 would exceed X's negative limit
        refused as expected: Joint interpolated move on line 0 would exceed X's negative limit
        accepted as expected: G53.5 G0 X400            carriage X 400.000
        Exiting with 0 errors
        Shutting down and cleaning up LinuxCNC...
        task: 1194 cycles, min=0.000003, max=0.019155, avg=0.001156, 10 latency excursions (> 10x expected cycle time of 0.001000s)
************** stderr:
        + for ini in test.ini maxkins.ini
        + rm -f sim.var sim.var.bak
        + echo '=== test.ini'
        + linuxcnc -r test.ini
        /__w/linuxcnc/linuxcnc/tests/kins-limits/box/test.ini: info: [KINS]KINEMATICS=5axiskins: Unchecked
        Note: realtime scheduling unavailable (sched_setscheduler SCHED_FIFO: Operation not permitted).
          Process capabilities: cap_sys_nice=no cap_ipc_lock=no.
          Falling back to POSIX non-realtime.
          Fix: 'sudo make setcap' (preferred) or 'sudo make setuid' on rtapi_app.
          Override (testing only): set LINUXCNC_FORCE_REALTIME=1.
        Note: Using POSIX non-realtime
        link (updating variable file): No such file or directory
        all joints must be homed before going into coordinated mode
        USRMOT: ERROR: invalid command
        Linear move on line 0 would exceed X's negative limit
        invalid params in linear command
        USRMOT: ERROR: invalid command
        Joint interpolated move on line 0 would exceed X's negative limit
        invalid params in joint interpolated move
        + for ini in test.ini maxkins.ini
        + rm -f sim.var sim.var.bak
        + echo '=== maxkins.ini'
        + linuxcnc -r maxkins.ini
        /__w/linuxcnc/linuxcnc/tests/kins-limits/box/maxkins.ini: info: [KINS]KINEMATICS=maxkins: Unchecked
        Note: realtime scheduling unavailable (sched_setscheduler SCHED_FIFO: Operation not permitted).
          Process capabilities: cap_sys_nice=no cap_ipc_lock=no.
          Falling back to POSIX non-realtime.
          Fix: 'sudo make setcap' (preferred) or 'sudo make setuid' on rtapi_app.
          Override (testing only): set LINUXCNC_FORCE_REALTIME=1.
        Note: Using POSIX non-realtime
        link (updating variable file): No such file or directory
        USRMOT: ERROR: invalid command
        Linear move on line 0 would exceed X's negative limit
        invalid params in linear command
        USRMOT: ERROR: invalid command
        Linear move on line 0 would exceed X's negative limit
        Linear move on line 0 would exceed joint 0's negative limit min:[-1000.000000]
        invalid params in linear command
        USRMOT: ERROR: invalid command
        Joint interpolated move on line 0 would exceed X's negative limit
        invalid params in joint interpolated move
**************

@Sigma1912
Sigma1912 force-pushed the vismach_Merge_static_and_Hal_classes branch 2 times, most recently from e8bff69 to 38abf60 Compare December 1, 2026 14:48
@Sigma1912

Copy link
Copy Markdown
Contributor Author

Thanks for the hint. I was wondering about that.

@Sigma1912

Sigma1912 commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Seems to have gotten worse after the rebase.
I can't really see how any of my changes could be causing any test to fail, but just to be sure I ran the tests locally and they all pass.

@BsAtHome

BsAtHome commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

These errors are probably race conditions. @grandixximo needs to have a look at these. Both instances failed almost identically.

Error copied from CI:
pkg-arch-arm-debian-sid.txt
pkg-arch-arm-debian-trixie.txt

Consolidate separate static and HAL-animated transform and geometry classes
into single unified implementations while maintaining full backwards
compatibility:

- Merge Translate, Scale, Rotate, RotateEuler, and Show to accept both
  static values and an optional hal.component with HAL pin names.
- Merge Line, Grid, Plane, and Coords primitives to support origin, normal,
  and normal+direction modes with optional HAL component arguments.
- Consolidate CylinderX, CylinderY, and CylinderZ using a shared
  _CylinderAxis base class.
- Retain all legacy Hal* class names as aliases for backwards compatibility.
- Update vismach.adoc to document the unified classes and legacy aliases.
- Also fixed along the way is a double import hal
@BsAtHome

BsAtHome commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

These errors are probably race conditions. @grandixximo needs to have a look at these. Both instances failed almost identically.

@grandixximo Few more errors in #4930. It is similar to the other two posted here. Just that this is on the x86 CI arch test.
pkg-arch-amd64-debian-trixie.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants