To get familiar with the Region of Attraction Codes i tried to estimate the RoA of an Acrobot for which i have an urdf description. Running these lines:
import numpy as np
from pydrake.all import DiagramBuilder, AddMultibodyPlantSceneGraph, Parser, MultibodyPlant, Variable, Simulator, ConstantVectorSource, RegionOfAttraction, LinearSystem,LinearQuadraticRegulator,Saturation
import pydot
#%% prepare and load urdf
builder = DiagramBuilder()
plant, scene_graph = AddMultibodyPlantSceneGraph(builder, time_step=0.0)
parser = Parser(plant, scene_graph)
parser.AddModelFromFile("acrobot.urdf")
plant.Finalize()
#%% create down context
q=np.array([0.0,0.0])
qd=np.array([0.0,0.0])
stable_ctxt = plant.CreateDefaultContext()
plant.SetPositions(stable_ctxt, q)
plant.SetVelocities(stable_ctxt, qd)
actuation_port = plant.get_actuation_input_port()
actuation_port.FixValue(stable_ctxt, 0)
#%% calc RoA
V = RegionOfAttraction(system=plant, context=stable_ctxt)
gave me this error:
SystemExit: Failure at systems/analysis/region_of_attraction.cc:126 in RegionOfAttraction(): condition 'xdot0.template lpNorm<Eigen::Infinity>() <= 1e-14' failed.
Which when looking at the comment in region_of_attraction.cc:123 indicates that x0 is not a stable fixed point. However it should be stable for the stable_ctxt provided to RegionOfAttraction().
Can the RegionOfAttraction() function be used to estimate the RoA of Multibody plants (and do they support conversion to Symbolic) or is there something else i have to consider/some obvious error in my thinking?
Thanks in advance!