dfki-ric-underactuated-lab / torque_limited_simple_pendulum

Torque Limited Simple Pendulum Underactuated System
BSD 3-Clause "New" or "Revised" License
54 stars 19 forks source link

AttributeError: 'LQRController' object has no attribute 'S' #26

Closed Jasonleeo-cpu closed 4 months ago

Jasonleeo-cpu commented 4 months ago

Traceback (most recent call last): File "plot_roa_estimations.py", line 48, in rho,S = mthd(pendulum,controller) File "/home/lee/.local/lib/python3.8/site-packages/simple_pendulum/controllers/lqr/roa/sampling.py", line 40, in najafi_based_sampling M = np.array(controller.S) AttributeError: 'LQRController' object has no attribute 'S'

Hi, when I tried to test some examples, I met the problem called "AttributeError: 'LQRController' object has no attribute 'S'", could you please tell me how can I fix it? Many thanks!

fwiebe commented 4 months ago

Hi @Jasonleeo-cpu , thanks for pointing that out. What was missing was setting the goal for the LQRController with

controller.set_goal([np.pi, 0.0])

I fixed the script in 7b256d5fd43b7e46a7905bbd1810708c097d17ed