File: init_urdf.lua

package info (click to toggle)
bullet 2.83.7%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 48,772 kB
  • sloc: cpp: 355,312; lisp: 12,087; ansic: 11,969; python: 644; makefile: 116; xml: 27
file content (20 lines) | stat: -rw-r--r-- 619 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
-- Very basic Lua script to create some Bullet objects. 
-- See also Demos3/AllBullet2Demos using Demos3/bullet2/LuaDemo

--right now we cannot interleave adding instances of different shapes, they have to be added in-order
--hence the two loops. this will be fixed soon

world = createDefaultDynamicsWorld()

cubeshape = createCubeShape(world, 30,30,1)
pos={0,0,-3.0}
orn = {0,0,0,1}
mass = 0
body = createRigidBody(world,cubeshape,mass,pos,orn)

pos={0,10,0}
orn = {0,0,0,1}
mb = loadMultiBodyFromUrdf(world,"r2d2.urdf", pos, orn);
pos={2,2,0}
orn = {0,0,0,1}
mb = loadMultiBodyFromUrdf(world,"r2d2.urdf", pos, orn);