Skip to content

optas.Visualize.sphere throwing TypeError in Python 3.12 #156

@hello-binit

Description

@hello-binit

Hello, thanks for creating this library! I ran into a bug trying to visualize a sphere in Python 3.12. I know 3.12 isn't listed as an supported platform (https://github.com/cmower/optas#support), but I thought this might be helpful if you're intending to support 3.12 in the future.

Steps to reproduce:

  1. Create a 3.12 environment (e.g. mamba create -n optas python=3.12)
  2. Copy the following into a script and run it:
from optas.visualize import Visualizer

vis = Visualizer(camera_position=[3, 3, 3])
vis.sphere(position=[0.0, 0.0, 0.0], radius=0.01, rgb=[1, 0, 0])
vis.grid_floor()
vis.start()

You'll see an exception like the following:

Traceback (most recent call last):
  File "/home/path/visualize_error.py", line 4, in <module>
    vis.sphere(position=[0.0, 0.0, 0.0], radius=0.01, rgb=[1, 0, 0])
  File "/home/path/miniforge3/envs/optas/lib/python3.12/site-packages/optas/spatialmath.py", line 68, in wrap
    return fun(*args_use, **kwargs_use)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/path/miniforge3/envs/optas/lib/python3.12/site-packages/optas/visualize.py", line 318, in sphere
    sphere.SetThetaResolution(theta_resolution)
TypeError: SetThetaResolution argument 1:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions