cmower / optas

OpTaS: An optimization-based task specification library for trajectory optimization and model predictive control.
https://cmower.github.io/optas/
Other
105 stars 14 forks source link

Visualizer and draw_sphere are missing #102

Closed Tianhuanyu closed 1 year ago

Tianhuanyu commented 1 year ago

Based on default branch, the example.py can not be run. The error code is shown here:

Traceback (most recent call last):
  File "optas/example/example.py", line 66, in <module>
    vis = optas.RobotVisualizer(robot, q=q_solution, params=params)  # solution
AttributeError: module 'optas' has no attribute 'RobotVisualizer'

However, I don't find these classes in optas.

cmower commented 1 year ago

Thanks for pointing this out @Tianhuanyu. I have recently re-vamped OpTaS's internal visualizer and clearly I forgot to update this example script.

Tianhuanyu commented 1 year ago

I find this works: `# Visualize the robot params = {"link_axis_scale": 0.5} vis = Visualizer() vis.sphere(0.05, rgb=[0, 1, 0], position=p_goal.toarray().flatten().tolist()) vis.robot(robot, q=q_solution)

vis.start() `

cmower commented 1 year ago

Fixed in #103