1. 程式人生 > >1.5 VREP之仿生機器人

1.5 VREP之仿生機器人

說明

本章只是看tutorial的一些要點記錄,比較零碎,僅作個人筆記之用,有所叨擾,敬請原諒!

記錄

  • shift+select可對場景中物體進行框式選擇
  • 三角形編輯模式式為了便於觀察,可切換PAGE SELECTOR
  • 提取形狀,新增關節,位置修改,根據關節朝向與世界座標系的關係,姿態修改,即

All joints are in position now, however, only the first added joint has the correct orientation. Select the two last added joints, then enter (-90,0,0) for the Alpha, Beta and Gamma items in the orientation dialog, on the orientation tab, then click the Apply to selection button.

  • 設定初始關節值,使得機器人水平伸展時所有關節值為0.

Now let’s set the initial joint values so that when the leg is horizontally stretched, all joint values are zero: in the joint dialog, item Position, set -30 and +120 for “hexa_joint2” and “hexa_joint3”

  • 想要控制機器人關節處於逆運動模式,並且希望逆運動學結果能作為動態位置控制值被使用,所以set the joints in inverse kinematics mode

In our case we want to be able to control those joints in inverse kinematics mode, but we also want the inverse kinematics results to be applied as dynamics position control values. To do this, we will set the joints in inverse kinematics mode

  • 作如上設定後要為機器人指定逆運動學任務(defined an inverse kinematics task for our kinematic chain representing the leg)

  • Hybrid operation表示逆運動學結果將作為動態目標值被應用到關節上(?)
    activate the Hybrid operation for that joint (this tells V-REP that the inverse kinematics calculation results will be applied to the joint as dynamic target value

defined an inverse kinematics task

新增dummy,並將其放在機器人leg的tip處,接著在層次樹中拖拽到與其相連的連桿上,此命名為hexa_footTip,再複製貼上一份,命名為hexa_footTarget,接著讓這兩個dummy成為逆運動解析的tip-target對,具體參照運動學模組內容,最後要將target和基座繫結

控制指令碼

  • 控制方式:先產生一條腿的運動方式,然後將其應用到所有的六條腿,但每條腿有不同的delay
  • 實現:一個child script來產生一條腿的移動方式,然後用六個child scripts來將這種運動方式以delay的形式應用到六條腿上,選中關節,然後繫結指令碼,即 [Menu bar --> Add --> Associated child script --> Non threaded]

We will control the hexapod robot by generating the movement for one leg, and applying it in a delayed way for all 6 legs, where each leg will have a different delay. We implement this by having one child script generating the movement sequence for one leg, and having 6 additional child scripts applying that movement sequence in a delayed manner. Select “hexa_joint1” and click [Menu bar --> Add --> Associated child script --> Non threaded]. We just attached a child script to the “hexa_joint1” object.


add a new dummy to the scene and rename it “hexa_base”. Also send it to the visibility layer 11. Then make it child of “hexapod”. “hexa_base” represents the position of our hexapod robot, that we selected to be (0;0;0)

Tips

disable動力學的方法:open the general dynamics properties dialog, then unchecking Dynamics enabled