Skip to content

JacobiRobot import crashes with NumPy 2.x because matplotlib is imported eagerly #21

Description

@MNikoliCC

Moved from SpesRobotics/teleop-pro#7 because the fix belongs in the public teleop core.

Summary

teleop-pro Webots imports teleop.utils.jacobi_robot.JacobiRobot. That module imports matplotlib.pyplot at module import time, even when visualization is unused.

On a machine with user-site NumPy 2.5.0 and system Matplotlib compiled against NumPy 1.x, the eager Matplotlib import crashes the Webots bridge before robot logic starts.

Observed error

A module that was compiled using NumPy 1.x cannot be run in NumPy 2.5.0
ImportError: numpy.core.multiarray failed to import

Expected behavior

Importing JacobiRobot for non-visual servoing should not import Matplotlib.

Acceptance criteria

  • Move matplotlib.pyplot import into the visualization methods that actually use it.
  • from teleop.utils.jacobi_robot import JacobiRobot works without Matplotlib being importable.
  • teleop-pro Webots bridge starts without requiring a NumPy downgrade solely because of Matplotlib.
  • Add or update a lightweight import test if practical.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingteleop proTeleop Pro product-related integration

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions