direct transcription for compass gait

主宰稳场 提交于 2021-01-29 19:32:02

问题


I'd like to set up trajectory optimization for the compass gait system (as hinted in the lecture video, using control authority can expand the region of attraction for stable walking).

In trying to use the DirectTranscription class on compass gait, I am running into the following issue:

plant = CompassGait()
context = plant.CreateDefaultContext()
DirectTranscription(plant, context, 21, TimeStep(0.01))

results in the following error:

An exception has occurred, use %tb to see the full traceback.

SystemExit: Failure at bazel-out/k8-opt/bin/systems/framework/_virtual_includes/context/drake/systems/framework/context.h:111 in num_total_states(): condition 'num_abstract_states() == 0' failed.

Is there a quick workaround for this issue? In looking at the compass gait implementation, the abstract state is only used for visualization. In principle, I could make a copy of the compass gait implementation and comment out the abstract state. But I'm using the colab notebook environment so I'm not sure how to easily do this.

Thanks!


回答1:


The DirectCollocation implementation has an option, assume_non_continuous_states_are_fixed which gets around this issue for the rimless wheel example I have here: http://underactuated.mit.edu/contact.html

I'll try to push this feature into DirectTranscription shortly. But you should be able to use DirectCollocation immediately. Does that work?



来源:https://stackoverflow.com/questions/61212887/direct-transcription-for-compass-gait

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!