如何理解continuous_state向量? [英] How to make sense of the continuous_state vector?
问题描述
我正在尝试平衡移动的倒立摆(即segway).
I am trying to balance a mobile inverted pendulum (i.e. segway).
对于仿真,我创建了一个简单的机器人,该机器人包含一个通过旋转接头连接到圆柱(车轮)上的杆.
For the simulation, I created a simple robot that involves a pole attached to a cylinder (wheel) through a revolute joint.
构造我的MIP工厂后,plant.num_positions()
返回8
,而plant.num_velocities()
返回7
,即continuous_state
的总大小为15
After constructing my MIP plant, plant.num_positions()
returns 8
and plant.num_velocities()
returns 7
, i.e. the total continuous_state
size is 15
- 我如何理解如此众多的州? 我假设其中之一代表杆与垂直线所成的角度.我怎么找到那个?
- 还有,为什么
num_positions()
不等于num_velocities()
?
- How do I make sense of this large number of states?
- I suppose one of these represents the angle that the pole makes with the vertical. How do I find that?
- Also, why is
num_positions()
not equal tonum_velocities()
?
推荐答案
默认情况下,urdf/sdf解析器为系统添加基于四元数的浮动基数.该浮动基础关节具有7个位置变量(x,y,z +四元数)和6个速度(xdot,ydot,zdot和空间速度).您应该使用多实体API以正确的顺序获取变量.
By default, the urdf/sdf parser adds the system with a quaternion-based floating base. This floating base joint has 7 position variables (x,y,z + quaternion) and 6 velocities (xdot, ydot, zdot, + spatial velocity). You should use the multibody API to get the variable in the right order.
您可以在世界链接和您的基地之间添加接缝(在urdf/sdf或代码中),以将隐含的浮动接缝替换为例如.底部的棱柱形接头.
You can add a joint between the world link and your base (either in the urdf/sdf or in your code) to replace that implied floating joint with e.g. a prismatic joint at the base.
在drake中有许多如何进行模拟的示例,但在 http://underactuated.mit上也有. edu
There are lots of examples of how to simulate it, in drake, but also at http://underactuated.mit.edu
这篇关于如何理解continuous_state向量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!