diff --git a/build_visual_studio_vr_pybullet_double.bat b/build_visual_studio_vr_pybullet_double.bat
index c98d916b2..0211b7489 100644
--- a/build_visual_studio_vr_pybullet_double.bat
+++ b/build_visual_studio_vr_pybullet_double.bat
@@ -18,7 +18,7 @@ del tmp1234.txt
cd build3
-premake4 --double --midi --enable_static_vr_plugin --enable_openvr --enable_pybullet --python_include_dir="%myvar%/include" --python_lib_dir="%myvar%/libs" --targetdir="../bin" vs2010
+premake4 --double --enable_multithreading --midi --enable_static_vr_plugin --enable_openvr --enable_pybullet --python_include_dir="%myvar%/include" --python_lib_dir="%myvar%/libs" --targetdir="../bin" vs2010
#premake4 --serial --audio --double --midi --enable_openvr --enable_pybullet --python_include_dir="%myvar%/include" --python_lib_dir="%myvar%/libs" --targetdir="../bin" vs2010
diff --git a/data/quadruped/vision/chassis.mtl b/data/quadruped/vision/chassis.mtl
new file mode 100644
index 000000000..89e23e69c
--- /dev/null
+++ b/data/quadruped/vision/chassis.mtl
@@ -0,0 +1,12 @@
+# Blender MTL File: 'None'
+# Material Count: 1
+
+newmtl None.002
+Ns 0.000000
+Ka 0.000000 0.000000 0.000000
+Kd 0.800000 0.800000 0.800000
+Ks 0.800000 0.800000 0.800000
+Ke 0.000000 0.000000 0.000000
+Ni 1.000000
+d 1.000000
+illum 2
diff --git a/data/quadruped/vision/chassis.obj b/data/quadruped/vision/chassis.obj
new file mode 100644
index 000000000..e554523ef
--- /dev/null
+++ b/data/quadruped/vision/chassis.obj
@@ -0,0 +1,32 @@
+# Blender v2.78 (sub 0) OBJ File: ''
+# www.blender.org
+mtllib chassis.mtl
+o Cube.002
+v -0.150000 -0.065000 0.043500
+v -0.150000 0.065000 -0.043500
+v -0.150000 -0.065000 -0.043500
+v -0.150000 0.065000 0.043500
+v 0.150000 0.065000 -0.043500
+v 0.150000 0.065000 0.043500
+v 0.150000 -0.065000 -0.043500
+v 0.150000 -0.065000 0.043500
+vn -1.0000 -0.0000 0.0000
+vn -0.0000 1.0000 0.0000
+vn 1.0000 0.0000 0.0000
+vn 0.0000 -1.0000 0.0000
+vn -0.0000 0.0000 -1.0000
+vn -0.0000 0.0000 1.0000
+usemtl None.002
+s 1
+f 1//1 2//1 3//1
+f 4//2 5//2 2//2
+f 6//3 7//3 5//3
+f 8//4 3//4 7//4
+f 5//5 3//5 2//5
+f 4//6 8//6 6//6
+f 1//1 4//1 2//1
+f 4//2 6//2 5//2
+f 6//3 8//3 7//3
+f 8//4 1//4 3//4
+f 5//5 7//5 3//5
+f 4//6 1//6 8//6
diff --git a/data/quadruped/vision/chassis2.mtl b/data/quadruped/vision/chassis2.mtl
new file mode 100644
index 000000000..70d3ba1da
--- /dev/null
+++ b/data/quadruped/vision/chassis2.mtl
@@ -0,0 +1,10 @@
+# Blender MTL File: 'None'
+# Material Count: 1
+
+newmtl None
+Ns 0
+Ka 0.000000 0.000000 0.000000
+Kd 0.8 0.8 0.8
+Ks 0.8 0.8 0.8
+d 1
+illum 2
diff --git a/data/quadruped/vision/chassis2.obj b/data/quadruped/vision/chassis2.obj
new file mode 100644
index 000000000..35f1f5df7
--- /dev/null
+++ b/data/quadruped/vision/chassis2.obj
@@ -0,0 +1,1906 @@
+# Blender v2.78 (sub 0) OBJ File: ''
+# www.blender.org
+mtllib chassis2.mtl
+o Cylinder.007_Cylinder.009
+v -0.307782 0.002140 -0.037175
+v 0.306165 0.002140 -0.037175
+v -0.307782 0.002100 -0.037582
+v 0.306165 0.002100 -0.037582
+v -0.307782 0.001981 -0.037973
+v 0.306165 0.001981 -0.037973
+v -0.307782 0.001789 -0.038333
+v 0.306165 0.001789 -0.038333
+v -0.307782 0.001529 -0.038649
+v 0.306165 0.001530 -0.038649
+v -0.307782 0.001213 -0.038909
+v 0.306165 0.001214 -0.038909
+v -0.307782 0.000853 -0.039101
+v 0.306165 0.000853 -0.039101
+v -0.307782 0.000462 -0.039220
+v 0.306165 0.000462 -0.039220
+v -0.307782 0.000055 -0.039260
+v 0.306165 0.000055 -0.039260
+v -0.307782 -0.000352 -0.039220
+v 0.306165 -0.000352 -0.039220
+v -0.307782 -0.000743 -0.039101
+v 0.306165 -0.000743 -0.039101
+v -0.307782 -0.001103 -0.038909
+v 0.306165 -0.001103 -0.038909
+v -0.307782 -0.001419 -0.038649
+v 0.306165 -0.001419 -0.038649
+v -0.307782 -0.001679 -0.038333
+v 0.306165 -0.001679 -0.038333
+v -0.307782 -0.001871 -0.037973
+v 0.306165 -0.001871 -0.037973
+v -0.307782 -0.001990 -0.037582
+v 0.306165 -0.001990 -0.037582
+v -0.307782 -0.002030 -0.037175
+v 0.306165 -0.002030 -0.037175
+v -0.307782 -0.001990 -0.036768
+v 0.306165 -0.001990 -0.036768
+v -0.307782 -0.001871 -0.036377
+v 0.306165 -0.001871 -0.036377
+v -0.307782 -0.001679 -0.036017
+v 0.306165 -0.001679 -0.036016
+v -0.307782 -0.001419 -0.035701
+v 0.306165 -0.001419 -0.035700
+v -0.307782 -0.001103 -0.035441
+v 0.306165 -0.001103 -0.035441
+v -0.307782 -0.000743 -0.035249
+v 0.306165 -0.000743 -0.035248
+v -0.307782 -0.000352 -0.035130
+v 0.306165 -0.000352 -0.035130
+v -0.307782 0.000055 -0.035090
+v 0.306165 0.000055 -0.035090
+v -0.307782 0.000462 -0.035130
+v 0.306165 0.000462 -0.035130
+v -0.307782 0.000853 -0.035249
+v 0.306165 0.000853 -0.035248
+v -0.307782 0.001213 -0.035441
+v 0.306165 0.001214 -0.035441
+v -0.307782 0.001529 -0.035701
+v 0.306165 0.001530 -0.035700
+v -0.307782 0.001789 -0.036017
+v 0.306165 0.001789 -0.036016
+v -0.307782 0.001981 -0.036377
+v 0.306165 0.001981 -0.036377
+v -0.307782 0.002100 -0.036768
+v 0.306165 0.002100 -0.036768
+vn -0.0000 0.9952 -0.0980
+vn -0.0000 0.9569 -0.2903
+vn -0.0000 0.8819 -0.4714
+vn 0.0000 0.7730 -0.6344
+vn 0.0000 0.6344 -0.7730
+vn 0.0000 0.4714 -0.8819
+vn 0.0000 0.2903 -0.9569
+vn 0.0000 0.0980 -0.9952
+vn 0.0000 -0.0980 -0.9952
+vn 0.0000 -0.2903 -0.9569
+vn 0.0000 -0.4714 -0.8819
+vn 0.0000 -0.6344 -0.7730
+vn 0.0000 -0.7730 -0.6344
+vn 0.0000 -0.8819 -0.4714
+vn 0.0000 -0.9569 -0.2903
+vn 0.0000 -0.9952 -0.0980
+vn 0.0000 -0.9952 0.0980
+vn 0.0000 -0.9569 0.2903
+vn 0.0000 -0.8819 0.4714
+vn -0.0000 -0.7730 0.6344
+vn -0.0000 -0.6344 0.7730
+vn -0.0000 -0.4714 0.8819
+vn -0.0000 -0.2903 0.9569
+vn -0.0000 -0.0980 0.9952
+vn -0.0000 0.0980 0.9952
+vn -0.0000 0.2903 0.9569
+vn -0.0000 0.4714 0.8819
+vn -0.0000 0.6344 0.7730
+vn -0.0000 0.7730 0.6344
+vn -0.0000 0.8819 0.4714
+vn 1.0000 0.0000 0.0000
+vn -0.0000 0.9569 0.2903
+vn -0.0000 0.9952 0.0980
+vn -1.0000 -0.0000 0.0000
+vn 1.0000 -0.0009 0.0000
+vn 1.0000 -0.0002 0.0000
+vn 1.0000 0.0002 0.0000
+vn 1.0000 -0.0018 0.0000
+vn 1.0000 0.0004 0.0000
+vn 1.0000 -0.0004 0.0000
+vn 1.0000 0.0001 0.0000
+vn 1.0000 -0.0001 0.0000
+vn -1.0000 -0.0009 0.0000
+vn -1.0000 -0.0004 0.0000
+vn -1.0000 0.0002 0.0000
+vn -1.0000 -0.0002 0.0000
+vn -1.0000 0.0004 0.0000
+vn -1.0000 0.0001 0.0000
+vn -1.0000 -0.0001 0.0000
+usemtl None
+s off
+f 1//1 4//1 3//1
+f 4//2 5//2 3//2
+f 5//3 8//3 7//3
+f 8//4 9//4 7//4
+f 10//5 11//5 9//5
+f 12//6 13//6 11//6
+f 14//7 15//7 13//7
+f 16//8 17//8 15//8
+f 18//9 19//9 17//9
+f 20//10 21//10 19//10
+f 22//11 23//11 21//11
+f 24//12 25//12 23//12
+f 26//13 27//13 25//13
+f 28//14 29//14 27//14
+f 30//15 31//15 29//15
+f 32//16 33//16 31//16
+f 34//17 35//17 33//17
+f 36//18 37//18 35//18
+f 37//19 40//19 39//19
+f 40//20 41//20 39//20
+f 42//21 43//21 41//21
+f 44//22 45//22 43//22
+f 46//23 47//23 45//23
+f 48//24 49//24 47//24
+f 50//25 51//25 49//25
+f 52//26 53//26 51//26
+f 54//27 55//27 53//27
+f 56//28 57//28 55//28
+f 58//29 59//29 57//29
+f 59//30 62//30 61//30
+f 30//31 22//31 6//31
+f 62//32 63//32 61//32
+f 64//33 1//33 63//33
+f 31//34 47//34 63//34
+f 1//1 2//1 4//1
+f 4//2 6//2 5//2
+f 5//3 6//3 8//3
+f 8//4 10//4 9//4
+f 10//5 12//5 11//5
+f 12//6 14//6 13//6
+f 14//7 16//7 15//7
+f 16//8 18//8 17//8
+f 18//9 20//9 19//9
+f 20//10 22//10 21//10
+f 22//11 24//11 23//11
+f 24//12 26//12 25//12
+f 26//13 28//13 27//13
+f 28//14 30//14 29//14
+f 30//15 32//15 31//15
+f 32//16 34//16 33//16
+f 34//17 36//17 35//17
+f 36//18 38//18 37//18
+f 37//19 38//19 40//19
+f 40//20 42//20 41//20
+f 42//21 44//21 43//21
+f 44//22 46//22 45//22
+f 46//23 48//23 47//23
+f 48//24 50//24 49//24
+f 50//25 52//25 51//25
+f 52//26 54//26 53//26
+f 54//27 56//27 55//27
+f 56//28 58//28 57//28
+f 58//29 60//29 59//29
+f 59//30 60//30 62//30
+f 6//31 4//31 2//31
+f 2//35 64//35 62//35
+f 62//31 60//31 58//31
+f 58//36 56//36 54//36
+f 54//37 52//37 50//37
+f 50//36 48//36 46//36
+f 46//31 44//31 42//31
+f 42//31 40//31 38//31
+f 38//38 36//38 34//38
+f 34//39 32//39 30//39
+f 30//40 28//40 26//40
+f 26//36 24//36 22//36
+f 22//36 20//36 18//36
+f 18//37 16//37 14//37
+f 14//31 12//31 10//31
+f 10//39 8//39 6//39
+f 6//31 2//31 62//31
+f 62//31 58//31 6//31
+f 54//31 50//31 38//31
+f 46//31 42//31 38//31
+f 38//31 34//31 30//31
+f 30//41 26//41 22//41
+f 22//31 18//31 6//31
+f 14//42 10//42 6//42
+f 6//31 58//31 54//31
+f 50//31 46//31 38//31
+f 38//31 30//31 6//31
+f 18//41 14//41 6//41
+f 6//31 54//31 38//31
+f 62//32 64//32 63//32
+f 64//33 2//33 1//33
+f 63//43 1//43 3//43
+f 3//44 5//44 7//44
+f 7//34 9//34 11//34
+f 11//45 13//45 15//45
+f 15//34 17//34 19//34
+f 19//46 21//46 23//46
+f 23//34 25//34 27//34
+f 27//47 29//47 31//47
+f 31//34 33//34 35//34
+f 35//47 37//47 39//47
+f 39//34 41//34 43//34
+f 43//46 45//46 47//46
+f 47//34 49//34 51//34
+f 51//34 53//34 55//34
+f 55//47 57//47 59//47
+f 59//44 61//44 63//44
+f 63//48 3//48 7//48
+f 7//34 11//34 63//34
+f 15//34 19//34 23//34
+f 23//34 27//34 31//34
+f 31//48 35//48 39//48
+f 39//34 43//34 31//34
+f 47//34 51//34 63//34
+f 55//49 59//49 63//49
+f 63//48 11//48 15//48
+f 15//34 23//34 63//34
+f 31//34 43//34 47//34
+f 51//48 55//48 63//48
+f 63//34 23//34 31//34
+o Cylinder.006_Cylinder.008
+v -0.307782 0.002140 0.038087
+v 0.306165 0.002140 0.038088
+v -0.307782 0.002100 0.037681
+v 0.306165 0.002100 0.037681
+v -0.307782 0.001981 0.037289
+v 0.306165 0.001981 0.037290
+v -0.307782 0.001789 0.036929
+v 0.306165 0.001789 0.036929
+v -0.307782 0.001529 0.036613
+v 0.306165 0.001530 0.036613
+v -0.307782 0.001213 0.036354
+v 0.306165 0.001214 0.036354
+v -0.307782 0.000853 0.036161
+v 0.306165 0.000853 0.036161
+v -0.307782 0.000462 0.036042
+v 0.306165 0.000462 0.036042
+v -0.307782 0.000055 0.036002
+v 0.306165 0.000055 0.036002
+v -0.307782 -0.000352 0.036042
+v 0.306165 -0.000352 0.036042
+v -0.307782 -0.000743 0.036161
+v 0.306165 -0.000743 0.036161
+v -0.307782 -0.001103 0.036354
+v 0.306165 -0.001103 0.036354
+v -0.307782 -0.001419 0.036613
+v 0.306165 -0.001419 0.036613
+v -0.307782 -0.001679 0.036929
+v 0.306165 -0.001679 0.036929
+v -0.307782 -0.001871 0.037289
+v 0.306165 -0.001871 0.037290
+v -0.307782 -0.001990 0.037681
+v 0.306165 -0.001990 0.037681
+v -0.307782 -0.002030 0.038087
+v 0.306165 -0.002030 0.038088
+v -0.307782 -0.001990 0.038494
+v 0.306165 -0.001990 0.038494
+v -0.307782 -0.001871 0.038885
+v 0.306165 -0.001871 0.038885
+v -0.307782 -0.001679 0.039246
+v 0.306165 -0.001679 0.039246
+v -0.307782 -0.001419 0.039562
+v 0.306165 -0.001419 0.039562
+v -0.307782 -0.001103 0.039821
+v 0.306165 -0.001103 0.039821
+v -0.307782 -0.000743 0.040014
+v 0.306165 -0.000743 0.040014
+v -0.307782 -0.000352 0.040132
+v 0.306165 -0.000352 0.040133
+v -0.307782 0.000055 0.040172
+v 0.306165 0.000055 0.040173
+v -0.307782 0.000462 0.040132
+v 0.306165 0.000462 0.040133
+v -0.307782 0.000853 0.040014
+v 0.306165 0.000853 0.040014
+v -0.307782 0.001213 0.039821
+v 0.306165 0.001214 0.039821
+v -0.307782 0.001529 0.039562
+v 0.306165 0.001530 0.039562
+v -0.307782 0.001789 0.039246
+v 0.306165 0.001789 0.039246
+v -0.307782 0.001981 0.038885
+v 0.306165 0.001981 0.038885
+v -0.307782 0.002100 0.038494
+v 0.306165 0.002100 0.038494
+vn -0.0000 0.9952 -0.0980
+vn -0.0000 0.9569 -0.2903
+vn -0.0000 0.8819 -0.4714
+vn 0.0000 0.7730 -0.6344
+vn 0.0000 0.6344 -0.7730
+vn 0.0000 0.4714 -0.8819
+vn 0.0000 0.2903 -0.9569
+vn 0.0000 0.0980 -0.9952
+vn 0.0000 -0.0980 -0.9952
+vn 0.0000 -0.2903 -0.9569
+vn 0.0000 -0.4714 -0.8819
+vn 0.0000 -0.6344 -0.7730
+vn 0.0000 -0.7730 -0.6344
+vn 0.0000 -0.8819 -0.4714
+vn 0.0000 -0.9569 -0.2903
+vn 0.0000 -0.9952 -0.0980
+vn 0.0000 -0.9952 0.0980
+vn 0.0000 -0.9569 0.2903
+vn 0.0000 -0.8819 0.4714
+vn -0.0000 -0.7730 0.6344
+vn -0.0000 -0.6344 0.7730
+vn -0.0000 -0.4714 0.8819
+vn -0.0000 -0.2903 0.9569
+vn -0.0000 -0.0980 0.9952
+vn -0.0000 0.0980 0.9952
+vn -0.0000 0.2903 0.9569
+vn -0.0000 0.4714 0.8819
+vn -0.0000 0.6344 0.7730
+vn -0.0000 0.7730 0.6344
+vn -0.0000 0.8819 0.4714
+vn 1.0000 0.0000 0.0000
+vn -0.0000 0.9569 0.2903
+vn -0.0000 0.9952 0.0980
+vn -1.0000 -0.0000 0.0000
+vn 1.0000 -0.0009 0.0000
+vn 1.0000 -0.0002 0.0000
+vn 1.0000 0.0002 0.0000
+vn 1.0000 -0.0018 0.0000
+vn 1.0000 0.0004 0.0000
+vn 1.0000 -0.0004 0.0000
+vn 1.0000 0.0001 0.0000
+vn 1.0000 -0.0001 0.0000
+vn -1.0000 -0.0009 0.0000
+vn -1.0000 -0.0004 0.0000
+vn -1.0000 0.0002 0.0000
+vn -1.0000 -0.0002 0.0000
+vn -1.0000 0.0004 0.0000
+vn -1.0000 0.0001 0.0000
+vn -1.0000 -0.0001 0.0000
+usemtl None
+s off
+f 66//50 67//50 65//50
+f 68//51 69//51 67//51
+f 70//52 71//52 69//52
+f 72//53 73//53 71//53
+f 74//54 75//54 73//54
+f 76//55 77//55 75//55
+f 78//56 79//56 77//56
+f 80//57 81//57 79//57
+f 82//58 83//58 81//58
+f 84//59 85//59 83//59
+f 86//60 87//60 85//60
+f 88//61 89//61 87//61
+f 90//62 91//62 89//62
+f 92//63 93//63 91//63
+f 94//64 95//64 93//64
+f 96//65 97//65 95//65
+f 98//66 99//66 97//66
+f 100//67 101//67 99//67
+f 102//68 103//68 101//68
+f 104//69 105//69 103//69
+f 106//70 107//70 105//70
+f 108//71 109//71 107//71
+f 110//72 111//72 109//72
+f 112//73 113//73 111//73
+f 114//74 115//74 113//74
+f 116//75 117//75 115//75
+f 118//76 119//76 117//76
+f 120//77 121//77 119//77
+f 122//78 123//78 121//78
+f 124//79 125//79 123//79
+f 94//80 86//80 70//80
+f 126//81 127//81 125//81
+f 128//82 65//82 127//82
+f 95//83 111//83 127//83
+f 66//50 68//50 67//50
+f 68//51 70//51 69//51
+f 70//52 72//52 71//52
+f 72//53 74//53 73//53
+f 74//54 76//54 75//54
+f 76//55 78//55 77//55
+f 78//56 80//56 79//56
+f 80//57 82//57 81//57
+f 82//58 84//58 83//58
+f 84//59 86//59 85//59
+f 86//60 88//60 87//60
+f 88//61 90//61 89//61
+f 90//62 92//62 91//62
+f 92//63 94//63 93//63
+f 94//64 96//64 95//64
+f 96//65 98//65 97//65
+f 98//66 100//66 99//66
+f 100//67 102//67 101//67
+f 102//68 104//68 103//68
+f 104//69 106//69 105//69
+f 106//70 108//70 107//70
+f 108//71 110//71 109//71
+f 110//72 112//72 111//72
+f 112//73 114//73 113//73
+f 114//74 116//74 115//74
+f 116//75 118//75 117//75
+f 118//76 120//76 119//76
+f 120//77 122//77 121//77
+f 122//78 124//78 123//78
+f 124//79 126//79 125//79
+f 70//80 68//80 66//80
+f 66//84 128//84 126//84
+f 126//80 124//80 122//80
+f 122//85 120//85 118//85
+f 118//86 116//86 114//86
+f 114//85 112//85 110//85
+f 110//80 108//80 106//80
+f 106//80 104//80 102//80
+f 102//87 100//87 98//87
+f 98//88 96//88 94//88
+f 94//89 92//89 90//89
+f 90//85 88//85 86//85
+f 86//85 84//85 82//85
+f 82//86 80//86 78//86
+f 78//80 76//80 74//80
+f 74//88 72//88 70//88
+f 70//80 66//80 126//80
+f 126//80 122//80 70//80
+f 118//80 114//80 102//80
+f 110//80 106//80 102//80
+f 102//80 98//80 94//80
+f 94//90 90//90 86//90
+f 86//80 82//80 70//80
+f 78//91 74//91 70//91
+f 70//80 122//80 118//80
+f 114//80 110//80 102//80
+f 102//80 94//80 70//80
+f 82//90 78//90 70//90
+f 70//80 118//80 102//80
+f 126//81 128//81 127//81
+f 128//82 66//82 65//82
+f 127//92 65//92 67//92
+f 67//93 69//93 71//93
+f 71//83 73//83 75//83
+f 75//94 77//94 79//94
+f 79//83 81//83 83//83
+f 83//95 85//95 87//95
+f 87//83 89//83 91//83
+f 91//96 93//96 95//96
+f 95//83 97//83 99//83
+f 99//96 101//96 103//96
+f 103//83 105//83 107//83
+f 107//95 109//95 111//95
+f 111//83 113//83 115//83
+f 115//83 117//83 119//83
+f 119//96 121//96 123//96
+f 123//93 125//93 127//93
+f 127//97 67//97 71//97
+f 71//83 75//83 127//83
+f 79//83 83//83 87//83
+f 87//83 91//83 95//83
+f 95//97 99//97 103//97
+f 103//83 107//83 95//83
+f 111//83 115//83 127//83
+f 119//98 123//98 127//98
+f 127//97 75//97 79//97
+f 79//83 87//83 127//83
+f 95//83 107//83 111//83
+f 115//97 119//97 127//97
+f 127//83 87//83 95//83
+o Cylinder.005_Cylinder.007
+v 0.171182 0.002140 -0.036552
+v 0.171182 0.002140 0.036552
+v 0.171589 0.002100 -0.036552
+v 0.171589 0.002100 0.036552
+v 0.171980 0.001981 -0.036552
+v 0.171980 0.001981 0.036552
+v 0.172341 0.001789 -0.036552
+v 0.172341 0.001789 0.036552
+v 0.172657 0.001529 -0.036552
+v 0.172657 0.001529 0.036552
+v 0.172916 0.001213 -0.036552
+v 0.172916 0.001213 0.036552
+v 0.173109 0.000853 -0.036552
+v 0.173109 0.000853 0.036552
+v 0.173227 0.000462 -0.036552
+v 0.173227 0.000462 0.036552
+v 0.173267 0.000055 -0.036552
+v 0.173267 0.000055 0.036552
+v 0.173227 -0.000352 -0.036552
+v 0.173227 -0.000352 0.036552
+v 0.173109 -0.000743 -0.036552
+v 0.173109 -0.000743 0.036552
+v 0.172916 -0.001103 -0.036552
+v 0.172916 -0.001103 0.036552
+v 0.172657 -0.001419 -0.036552
+v 0.172657 -0.001419 0.036552
+v 0.172341 -0.001679 -0.036552
+v 0.172341 -0.001679 0.036552
+v 0.171980 -0.001871 -0.036552
+v 0.171980 -0.001871 0.036552
+v 0.171589 -0.001990 -0.036552
+v 0.171589 -0.001990 0.036552
+v 0.171182 -0.002030 -0.036552
+v 0.171182 -0.002030 0.036552
+v 0.170776 -0.001990 -0.036552
+v 0.170776 -0.001990 0.036552
+v 0.170384 -0.001871 -0.036552
+v 0.170384 -0.001871 0.036552
+v 0.170024 -0.001679 -0.036552
+v 0.170024 -0.001679 0.036552
+v 0.169708 -0.001419 -0.036552
+v 0.169708 -0.001419 0.036552
+v 0.169449 -0.001103 -0.036552
+v 0.169449 -0.001103 0.036552
+v 0.169256 -0.000743 -0.036552
+v 0.169256 -0.000743 0.036552
+v 0.169137 -0.000352 -0.036552
+v 0.169137 -0.000352 0.036552
+v 0.169097 0.000055 -0.036552
+v 0.169097 0.000055 0.036552
+v 0.169137 0.000462 -0.036552
+v 0.169137 0.000462 0.036552
+v 0.169256 0.000853 -0.036552
+v 0.169256 0.000853 0.036552
+v 0.169449 0.001213 -0.036552
+v 0.169449 0.001213 0.036552
+v 0.169708 0.001529 -0.036552
+v 0.169708 0.001529 0.036552
+v 0.170024 0.001789 -0.036552
+v 0.170024 0.001789 0.036552
+v 0.170384 0.001981 -0.036552
+v 0.170384 0.001981 0.036552
+v 0.170776 0.002100 -0.036552
+v 0.170776 0.002100 0.036552
+vn 0.0980 0.9952 0.0000
+vn 0.2903 0.9569 0.0000
+vn 0.4714 0.8819 0.0000
+vn 0.6344 0.7730 0.0000
+vn 0.7730 0.6344 0.0000
+vn 0.8819 0.4714 0.0000
+vn 0.9570 0.2902 0.0000
+vn 0.9952 0.0980 0.0000
+vn 0.9952 -0.0981 0.0000
+vn 0.9569 -0.2903 0.0000
+vn 0.8819 -0.4714 0.0000
+vn 0.7730 -0.6344 0.0000
+vn 0.6344 -0.7730 0.0000
+vn 0.4714 -0.8819 0.0000
+vn 0.2903 -0.9569 0.0000
+vn 0.0980 -0.9952 0.0000
+vn -0.0980 -0.9952 0.0000
+vn -0.2903 -0.9569 0.0000
+vn -0.4714 -0.8819 0.0000
+vn -0.6344 -0.7730 0.0000
+vn -0.7730 -0.6344 0.0000
+vn -0.8819 -0.4714 0.0000
+vn -0.9570 -0.2902 0.0000
+vn -0.9952 -0.0980 0.0000
+vn -0.9952 0.0981 0.0000
+vn -0.9569 0.2903 0.0000
+vn -0.8819 0.4714 0.0000
+vn -0.7730 0.6344 0.0000
+vn -0.6344 0.7730 0.0000
+vn -0.4714 0.8819 0.0000
+vn -0.0000 0.0000 1.0000
+vn -0.2903 0.9569 0.0000
+vn -0.0980 0.9952 0.0000
+vn -0.0000 0.0000 -1.0000
+vn 0.9569 0.2903 0.0000
+vn 0.9952 0.0981 0.0000
+vn 0.9952 -0.0980 0.0000
+vn 0.9570 -0.2902 0.0000
+vn -0.9569 -0.2903 0.0000
+vn -0.9952 -0.0981 0.0000
+vn -0.9952 0.0980 0.0000
+vn -0.9570 0.2902 0.0000
+vn 0.0001 0.0000 1.0000
+vn -0.0001 0.0000 1.0000
+vn 0.0001 0.0000 -1.0000
+vn -0.0001 0.0000 -1.0000
+usemtl None
+s off
+f 130//99 131//99 129//99
+f 132//100 133//100 131//100
+f 134//101 135//101 133//101
+f 136//102 137//102 135//102
+f 138//103 139//103 137//103
+f 140//104 141//104 139//104
+f 142//105 143//105 141//105
+f 144//106 145//106 143//106
+f 146//107 147//107 145//107
+f 148//108 149//108 147//108
+f 150//109 151//109 149//109
+f 152//110 153//110 151//110
+f 154//111 155//111 153//111
+f 156//112 157//112 155//112
+f 158//113 159//113 157//113
+f 160//114 161//114 159//114
+f 162//115 163//115 161//115
+f 164//116 165//116 163//116
+f 166//117 167//117 165//117
+f 168//118 169//118 167//118
+f 170//119 171//119 169//119
+f 172//120 173//120 171//120
+f 174//121 175//121 173//121
+f 176//122 177//122 175//122
+f 178//123 179//123 177//123
+f 180//124 181//124 179//124
+f 182//125 183//125 181//125
+f 184//126 185//126 183//126
+f 186//127 187//127 185//127
+f 188//128 189//128 187//128
+f 166//129 150//129 182//129
+f 190//130 191//130 189//130
+f 192//131 129//131 191//131
+f 159//132 175//132 143//132
+f 130//99 132//99 131//99
+f 132//100 134//100 133//100
+f 134//101 136//101 135//101
+f 136//102 138//102 137//102
+f 138//103 140//103 139//103
+f 140//104 142//104 141//104
+f 142//133 144//133 143//133
+f 144//134 146//134 145//134
+f 146//135 148//135 147//135
+f 148//136 150//136 149//136
+f 150//109 152//109 151//109
+f 152//110 154//110 153//110
+f 154//111 156//111 155//111
+f 156//112 158//112 157//112
+f 158//113 160//113 159//113
+f 160//114 162//114 161//114
+f 162//115 164//115 163//115
+f 164//116 166//116 165//116
+f 166//117 168//117 167//117
+f 168//118 170//118 169//118
+f 170//119 172//119 171//119
+f 172//120 174//120 173//120
+f 174//137 176//137 175//137
+f 176//138 178//138 177//138
+f 178//139 180//139 179//139
+f 180//140 182//140 181//140
+f 182//125 184//125 183//125
+f 184//126 186//126 185//126
+f 186//127 188//127 187//127
+f 188//128 190//128 189//128
+f 134//129 132//129 130//129
+f 130//129 192//129 190//129
+f 190//129 188//129 186//129
+f 186//141 184//141 182//141
+f 182//129 180//129 178//129
+f 178//142 176//142 174//142
+f 174//141 172//141 170//141
+f 170//129 168//129 166//129
+f 166//129 164//129 162//129
+f 162//129 160//129 158//129
+f 158//141 156//141 154//141
+f 154//141 152//141 150//141
+f 150//141 148//141 146//141
+f 146//142 144//142 142//142
+f 142//129 140//129 138//129
+f 138//129 136//129 134//129
+f 134//129 130//129 182//129
+f 190//129 186//129 182//129
+f 182//129 178//129 174//129
+f 174//129 170//129 182//129
+f 166//129 162//129 150//129
+f 158//129 154//129 150//129
+f 150//129 146//129 142//129
+f 142//129 138//129 134//129
+f 130//129 190//129 182//129
+f 182//129 170//129 166//129
+f 162//129 158//129 150//129
+f 150//129 142//129 134//129
+f 134//129 182//129 150//129
+f 190//130 192//130 191//130
+f 192//131 130//131 129//131
+f 191//132 129//132 131//132
+f 131//132 133//132 135//132
+f 135//132 137//132 139//132
+f 139//132 141//132 143//132
+f 143//143 145//143 147//143
+f 147//132 149//132 151//132
+f 151//132 153//132 155//132
+f 155//132 157//132 159//132
+f 159//132 161//132 163//132
+f 163//132 165//132 167//132
+f 167//132 169//132 171//132
+f 171//144 173//144 175//144
+f 175//132 177//132 179//132
+f 179//144 181//144 183//144
+f 183//132 185//132 187//132
+f 187//132 189//132 191//132
+f 191//132 131//132 143//132
+f 135//132 139//132 143//132
+f 143//132 147//132 159//132
+f 151//132 155//132 159//132
+f 159//132 163//132 175//132
+f 167//132 171//132 175//132
+f 175//132 179//132 191//132
+f 183//132 187//132 191//132
+f 131//132 135//132 143//132
+f 147//132 151//132 159//132
+f 163//132 167//132 175//132
+f 179//132 183//132 191//132
+f 191//132 143//132 175//132
+o Cylinder.004_Cylinder.006
+v 0.111182 0.002140 -0.036552
+v 0.111182 0.002140 0.036552
+v 0.111589 0.002100 -0.036552
+v 0.111589 0.002100 0.036552
+v 0.111980 0.001981 -0.036552
+v 0.111980 0.001981 0.036552
+v 0.112341 0.001789 -0.036552
+v 0.112341 0.001789 0.036552
+v 0.112657 0.001529 -0.036552
+v 0.112657 0.001529 0.036552
+v 0.112916 0.001213 -0.036552
+v 0.112916 0.001213 0.036552
+v 0.113109 0.000853 -0.036552
+v 0.113109 0.000853 0.036552
+v 0.113227 0.000462 -0.036552
+v 0.113227 0.000462 0.036552
+v 0.113267 0.000055 -0.036552
+v 0.113267 0.000055 0.036552
+v 0.113227 -0.000352 -0.036552
+v 0.113227 -0.000352 0.036552
+v 0.113109 -0.000743 -0.036552
+v 0.113109 -0.000743 0.036552
+v 0.112916 -0.001103 -0.036552
+v 0.112916 -0.001103 0.036552
+v 0.112657 -0.001419 -0.036552
+v 0.112657 -0.001419 0.036552
+v 0.112341 -0.001679 -0.036552
+v 0.112341 -0.001679 0.036552
+v 0.111980 -0.001871 -0.036552
+v 0.111980 -0.001871 0.036552
+v 0.111589 -0.001990 -0.036552
+v 0.111589 -0.001990 0.036552
+v 0.111182 -0.002030 -0.036552
+v 0.111182 -0.002030 0.036552
+v 0.110776 -0.001990 -0.036552
+v 0.110776 -0.001990 0.036552
+v 0.110384 -0.001871 -0.036552
+v 0.110384 -0.001871 0.036552
+v 0.110024 -0.001679 -0.036552
+v 0.110024 -0.001679 0.036552
+v 0.109708 -0.001419 -0.036552
+v 0.109708 -0.001419 0.036552
+v 0.109449 -0.001103 -0.036552
+v 0.109449 -0.001103 0.036552
+v 0.109256 -0.000743 -0.036552
+v 0.109256 -0.000743 0.036552
+v 0.109137 -0.000352 -0.036552
+v 0.109137 -0.000352 0.036552
+v 0.109097 0.000055 -0.036552
+v 0.109097 0.000055 0.036552
+v 0.109137 0.000462 -0.036552
+v 0.109137 0.000462 0.036552
+v 0.109256 0.000853 -0.036552
+v 0.109256 0.000853 0.036552
+v 0.109449 0.001213 -0.036552
+v 0.109449 0.001213 0.036552
+v 0.109708 0.001529 -0.036552
+v 0.109708 0.001529 0.036552
+v 0.110024 0.001789 -0.036552
+v 0.110024 0.001789 0.036552
+v 0.110384 0.001981 -0.036552
+v 0.110384 0.001981 0.036552
+v 0.110776 0.002100 -0.036552
+v 0.110776 0.002100 0.036552
+vn 0.0980 0.9952 0.0000
+vn 0.2903 0.9569 0.0000
+vn 0.4714 0.8819 0.0000
+vn 0.6344 0.7730 0.0000
+vn 0.7730 0.6344 0.0000
+vn 0.8819 0.4714 0.0000
+vn 0.9569 0.2903 0.0000
+vn 0.9952 0.0980 0.0000
+vn 0.9952 -0.0981 0.0000
+vn 0.9569 -0.2903 0.0000
+vn 0.8819 -0.4714 0.0000
+vn 0.7730 -0.6344 0.0000
+vn 0.6344 -0.7730 0.0000
+vn 0.4714 -0.8819 0.0000
+vn 0.2903 -0.9569 0.0000
+vn 0.0980 -0.9952 0.0000
+vn -0.0980 -0.9952 0.0000
+vn -0.2903 -0.9569 0.0000
+vn -0.4714 -0.8819 0.0000
+vn -0.6344 -0.7730 0.0000
+vn -0.7730 -0.6344 0.0000
+vn -0.8819 -0.4714 0.0000
+vn -0.9569 -0.2903 0.0000
+vn -0.9952 -0.0981 0.0000
+vn -0.9952 0.0980 0.0000
+vn -0.9570 0.2902 0.0000
+vn -0.8819 0.4714 0.0000
+vn -0.7730 0.6343 0.0000
+vn -0.6344 0.7730 0.0000
+vn -0.4714 0.8819 0.0000
+vn -0.0000 0.0000 1.0000
+vn -0.2903 0.9569 0.0000
+vn -0.0980 0.9952 0.0000
+vn -0.0000 0.0000 -1.0000
+vn 0.9952 0.0981 0.0000
+vn 0.9952 -0.0980 0.0000
+vn -0.9570 -0.2902 0.0000
+vn -0.9952 -0.0980 0.0000
+vn -0.9952 0.0981 0.0000
+vn -0.9569 0.2903 0.0000
+vn -0.7730 0.6344 0.0000
+vn 0.0001 0.0000 1.0000
+vn -0.0001 0.0000 1.0000
+vn 0.0001 0.0000 -1.0000
+vn -0.0001 0.0000 -1.0000
+usemtl None
+s off
+f 194//145 195//145 193//145
+f 196//146 197//146 195//146
+f 198//147 199//147 197//147
+f 200//148 201//148 199//148
+f 202//149 203//149 201//149
+f 204//150 205//150 203//150
+f 206//151 207//151 205//151
+f 208//152 209//152 207//152
+f 210//153 211//153 209//153
+f 212//154 213//154 211//154
+f 214//155 215//155 213//155
+f 216//156 217//156 215//156
+f 218//157 219//157 217//157
+f 220//158 221//158 219//158
+f 222//159 223//159 221//159
+f 224//160 225//160 223//160
+f 226//161 227//161 225//161
+f 228//162 229//162 227//162
+f 230//163 231//163 229//163
+f 232//164 233//164 231//164
+f 234//165 235//165 233//165
+f 236//166 237//166 235//166
+f 238//167 239//167 237//167
+f 240//168 241//168 239//168
+f 242//169 243//169 241//169
+f 244//170 245//170 243//170
+f 246//171 247//171 245//171
+f 248//172 249//172 247//172
+f 250//173 251//173 249//173
+f 252//174 253//174 251//174
+f 230//175 214//175 198//175
+f 254//176 255//176 253//176
+f 256//177 193//177 255//177
+f 223//178 239//178 207//178
+f 194//145 196//145 195//145
+f 196//146 198//146 197//146
+f 198//147 200//147 199//147
+f 200//148 202//148 201//148
+f 202//149 204//149 203//149
+f 204//150 206//150 205//150
+f 206//151 208//151 207//151
+f 208//179 210//179 209//179
+f 210//180 212//180 211//180
+f 212//154 214//154 213//154
+f 214//155 216//155 215//155
+f 216//156 218//156 217//156
+f 218//157 220//157 219//157
+f 220//158 222//158 221//158
+f 222//159 224//159 223//159
+f 224//160 226//160 225//160
+f 226//161 228//161 227//161
+f 228//162 230//162 229//162
+f 230//163 232//163 231//163
+f 232//164 234//164 233//164
+f 234//165 236//165 235//165
+f 236//166 238//166 237//166
+f 238//181 240//181 239//181
+f 240//182 242//182 241//182
+f 242//183 244//183 243//183
+f 244//184 246//184 245//184
+f 246//171 248//171 247//171
+f 248//185 250//185 249//185
+f 250//173 252//173 251//173
+f 252//174 254//174 253//174
+f 198//175 196//175 194//175
+f 194//175 256//175 254//175
+f 254//175 252//175 250//175
+f 250//186 248//186 246//186
+f 246//175 244//175 242//175
+f 242//187 240//187 238//187
+f 238//186 236//186 234//186
+f 234//175 232//175 230//175
+f 230//175 228//175 226//175
+f 226//175 224//175 222//175
+f 222//186 220//186 218//186
+f 218//186 216//186 214//186
+f 214//186 212//186 210//186
+f 210//187 208//187 206//187
+f 206//175 204//175 202//175
+f 202//175 200//175 198//175
+f 198//175 194//175 246//175
+f 254//175 250//175 246//175
+f 246//175 242//175 238//175
+f 238//175 234//175 230//175
+f 230//175 226//175 222//175
+f 222//175 218//175 214//175
+f 214//175 210//175 206//175
+f 206//175 202//175 198//175
+f 194//175 254//175 246//175
+f 246//175 238//175 198//175
+f 230//175 222//175 214//175
+f 214//175 206//175 198//175
+f 198//175 238//175 230//175
+f 254//176 256//176 255//176
+f 256//177 194//177 193//177
+f 255//178 193//178 195//178
+f 195//178 197//178 199//178
+f 199//178 201//178 203//178
+f 203//178 205//178 207//178
+f 207//188 209//188 211//188
+f 211//178 213//178 215//178
+f 215//178 217//178 219//178
+f 219//178 221//178 223//178
+f 223//178 225//178 227//178
+f 227//178 229//178 231//178
+f 231//178 233//178 235//178
+f 235//189 237//189 239//189
+f 239//178 241//178 243//178
+f 243//189 245//189 247//189
+f 247//178 249//178 251//178
+f 251//178 253//178 255//178
+f 255//178 195//178 207//178
+f 199//178 203//178 207//178
+f 207//178 211//178 215//178
+f 215//178 219//178 207//178
+f 223//178 227//178 239//178
+f 231//178 235//178 239//178
+f 239//178 243//178 247//178
+f 247//178 251//178 255//178
+f 195//178 199//178 207//178
+f 207//178 219//178 223//178
+f 227//178 231//178 239//178
+f 239//178 247//178 255//178
+f 255//178 207//178 239//178
+o Cylinder.002_Cylinder.005
+v -0.090808 0.002140 -0.036552
+v -0.090808 0.002140 0.036552
+v -0.090402 0.002100 -0.036552
+v -0.090402 0.002100 0.036552
+v -0.090010 0.001981 -0.036552
+v -0.090010 0.001981 0.036552
+v -0.089650 0.001789 -0.036552
+v -0.089650 0.001789 0.036552
+v -0.089334 0.001529 -0.036552
+v -0.089334 0.001529 0.036552
+v -0.089075 0.001213 -0.036552
+v -0.089075 0.001213 0.036552
+v -0.088882 0.000853 -0.036552
+v -0.088882 0.000853 0.036552
+v -0.088763 0.000462 -0.036552
+v -0.088763 0.000462 0.036552
+v -0.088723 0.000055 -0.036552
+v -0.088723 0.000055 0.036552
+v -0.088763 -0.000352 -0.036552
+v -0.088763 -0.000352 0.036552
+v -0.088882 -0.000743 -0.036552
+v -0.088882 -0.000743 0.036552
+v -0.089075 -0.001103 -0.036552
+v -0.089075 -0.001103 0.036552
+v -0.089334 -0.001419 -0.036552
+v -0.089334 -0.001419 0.036552
+v -0.089650 -0.001679 -0.036552
+v -0.089650 -0.001679 0.036552
+v -0.090010 -0.001871 -0.036552
+v -0.090010 -0.001871 0.036552
+v -0.090402 -0.001990 -0.036552
+v -0.090402 -0.001990 0.036552
+v -0.090808 -0.002030 -0.036552
+v -0.090808 -0.002030 0.036552
+v -0.091215 -0.001990 -0.036552
+v -0.091215 -0.001990 0.036552
+v -0.091606 -0.001871 -0.036552
+v -0.091606 -0.001871 0.036552
+v -0.091967 -0.001679 -0.036552
+v -0.091967 -0.001679 0.036552
+v -0.092283 -0.001419 -0.036552
+v -0.092283 -0.001419 0.036552
+v -0.092542 -0.001103 -0.036552
+v -0.092542 -0.001103 0.036552
+v -0.092735 -0.000743 -0.036552
+v -0.092735 -0.000743 0.036552
+v -0.092853 -0.000352 -0.036552
+v -0.092853 -0.000352 0.036552
+v -0.092893 0.000055 -0.036552
+v -0.092893 0.000055 0.036552
+v -0.092853 0.000462 -0.036552
+v -0.092853 0.000462 0.036552
+v -0.092735 0.000853 -0.036552
+v -0.092735 0.000853 0.036552
+v -0.092542 0.001213 -0.036552
+v -0.092542 0.001213 0.036552
+v -0.092283 0.001529 -0.036552
+v -0.092283 0.001529 0.036552
+v -0.091967 0.001789 -0.036552
+v -0.091967 0.001789 0.036552
+v -0.091606 0.001981 -0.036552
+v -0.091606 0.001981 0.036552
+v -0.091215 0.002100 -0.036552
+v -0.091215 0.002100 0.036552
+vn 0.0980 0.9952 0.0000
+vn 0.2903 0.9569 0.0000
+vn 0.4714 0.8819 0.0000
+vn 0.6344 0.7730 0.0000
+vn 0.7730 0.6344 0.0000
+vn 0.8819 0.4714 0.0000
+vn 0.9570 0.2902 0.0000
+vn 0.9952 0.0980 0.0000
+vn 0.9952 -0.0980 0.0000
+vn 0.9569 -0.2903 0.0000
+vn 0.8819 -0.4714 0.0000
+vn 0.7730 -0.6344 0.0000
+vn 0.6344 -0.7730 0.0000
+vn 0.4714 -0.8819 0.0000
+vn 0.2903 -0.9569 0.0000
+vn 0.0980 -0.9952 0.0000
+vn -0.0980 -0.9952 0.0000
+vn -0.2903 -0.9569 0.0000
+vn -0.4714 -0.8819 0.0000
+vn -0.6344 -0.7730 0.0000
+vn -0.7730 -0.6344 0.0000
+vn -0.8819 -0.4714 0.0000
+vn -0.9569 -0.2903 0.0000
+vn -0.9952 -0.0980 0.0000
+vn -0.9952 0.0980 0.0000
+vn -0.9569 0.2903 0.0000
+vn -0.8819 0.4714 0.0000
+vn -0.7730 0.6344 0.0000
+vn -0.6344 0.7730 0.0000
+vn -0.4714 0.8819 0.0000
+vn -0.0000 0.0000 1.0000
+vn -0.2903 0.9569 0.0000
+vn -0.0980 0.9952 0.0000
+vn -0.0000 0.0000 -1.0000
+vn 0.9569 0.2903 0.0000
+vn 0.9570 -0.2902 0.0000
+vn 0.0001 0.0000 1.0000
+vn -0.0001 0.0000 1.0000
+vn 0.0001 0.0000 -1.0000
+vn -0.0001 0.0000 -1.0000
+usemtl None
+s off
+f 258//190 259//190 257//190
+f 260//191 261//191 259//191
+f 262//192 263//192 261//192
+f 264//193 265//193 263//193
+f 266//194 267//194 265//194
+f 268//195 269//195 267//195
+f 270//196 271//196 269//196
+f 272//197 273//197 271//197
+f 274//198 275//198 273//198
+f 276//199 277//199 275//199
+f 278//200 279//200 277//200
+f 280//201 281//201 279//201
+f 282//202 283//202 281//202
+f 284//203 285//203 283//203
+f 286//204 287//204 285//204
+f 288//205 289//205 287//205
+f 290//206 291//206 289//206
+f 292//207 293//207 291//207
+f 294//208 295//208 293//208
+f 296//209 297//209 295//209
+f 298//210 299//210 297//210
+f 300//211 301//211 299//211
+f 302//212 303//212 301//212
+f 304//213 305//213 303//213
+f 306//214 307//214 305//214
+f 308//215 309//215 307//215
+f 310//216 311//216 309//216
+f 312//217 313//217 311//217
+f 314//218 315//218 313//218
+f 316//219 317//219 315//219
+f 294//220 278//220 262//220
+f 318//221 319//221 317//221
+f 320//222 257//222 319//222
+f 287//223 303//223 271//223
+f 258//190 260//190 259//190
+f 260//191 262//191 261//191
+f 262//192 264//192 263//192
+f 264//193 266//193 265//193
+f 266//194 268//194 267//194
+f 268//195 270//195 269//195
+f 270//224 272//224 271//224
+f 272//197 274//197 273//197
+f 274//198 276//198 275//198
+f 276//225 278//225 277//225
+f 278//200 280//200 279//200
+f 280//201 282//201 281//201
+f 282//202 284//202 283//202
+f 284//203 286//203 285//203
+f 286//204 288//204 287//204
+f 288//205 290//205 289//205
+f 290//206 292//206 291//206
+f 292//207 294//207 293//207
+f 294//208 296//208 295//208
+f 296//209 298//209 297//209
+f 298//210 300//210 299//210
+f 300//211 302//211 301//211
+f 302//212 304//212 303//212
+f 304//213 306//213 305//213
+f 306//214 308//214 307//214
+f 308//215 310//215 309//215
+f 310//216 312//216 311//216
+f 312//217 314//217 313//217
+f 314//218 316//218 315//218
+f 316//219 318//219 317//219
+f 262//220 260//220 258//220
+f 258//220 320//220 318//220
+f 318//220 316//220 314//220
+f 314//226 312//226 310//226
+f 310//220 308//220 306//220
+f 306//227 304//227 302//227
+f 302//226 300//226 298//226
+f 298//220 296//220 294//220
+f 294//220 292//220 290//220
+f 290//220 288//220 286//220
+f 286//226 284//226 282//226
+f 282//226 280//226 278//226
+f 278//226 276//226 274//226
+f 274//227 272//227 270//227
+f 270//220 268//220 266//220
+f 266//220 264//220 262//220
+f 262//220 258//220 310//220
+f 318//220 314//220 310//220
+f 310//220 306//220 302//220
+f 302//220 298//220 294//220
+f 294//220 290//220 286//220
+f 286//220 282//220 278//220
+f 278//220 274//220 270//220
+f 270//220 266//220 262//220
+f 258//220 318//220 310//220
+f 310//220 302//220 262//220
+f 294//220 286//220 278//220
+f 278//220 270//220 262//220
+f 262//220 302//220 294//220
+f 318//221 320//221 319//221
+f 320//222 258//222 257//222
+f 319//223 257//223 259//223
+f 259//223 261//223 263//223
+f 263//223 265//223 267//223
+f 267//223 269//223 271//223
+f 271//228 273//228 275//228
+f 275//223 277//223 279//223
+f 279//223 281//223 283//223
+f 283//223 285//223 287//223
+f 287//223 289//223 291//223
+f 291//223 293//223 295//223
+f 295//223 297//223 299//223
+f 299//229 301//229 303//229
+f 303//223 305//223 307//223
+f 307//229 309//229 311//229
+f 311//223 313//223 315//223
+f 315//223 317//223 319//223
+f 319//223 259//223 263//223
+f 263//223 267//223 271//223
+f 271//223 275//223 279//223
+f 279//223 283//223 271//223
+f 287//223 291//223 303//223
+f 295//223 299//223 303//223
+f 303//223 307//223 311//223
+f 311//223 315//223 319//223
+f 319//223 263//223 271//223
+f 271//223 283//223 287//223
+f 291//223 295//223 303//223
+f 303//223 311//223 319//223
+f 319//223 271//223 303//223
+o Cylinder.001_Cylinder.004
+v -0.160808 0.002140 -0.036552
+v -0.160808 0.002140 0.036552
+v -0.160402 0.002100 -0.036552
+v -0.160402 0.002100 0.036552
+v -0.160010 0.001981 -0.036552
+v -0.160010 0.001981 0.036552
+v -0.159650 0.001789 -0.036552
+v -0.159650 0.001789 0.036552
+v -0.159334 0.001529 -0.036552
+v -0.159334 0.001529 0.036552
+v -0.159075 0.001213 -0.036552
+v -0.159075 0.001213 0.036552
+v -0.158882 0.000853 -0.036552
+v -0.158882 0.000853 0.036552
+v -0.158763 0.000462 -0.036552
+v -0.158763 0.000462 0.036552
+v -0.158723 0.000055 -0.036552
+v -0.158723 0.000055 0.036552
+v -0.158763 -0.000352 -0.036552
+v -0.158763 -0.000352 0.036552
+v -0.158882 -0.000743 -0.036552
+v -0.158882 -0.000743 0.036552
+v -0.159075 -0.001103 -0.036552
+v -0.159075 -0.001103 0.036552
+v -0.159334 -0.001419 -0.036552
+v -0.159334 -0.001419 0.036552
+v -0.159650 -0.001679 -0.036552
+v -0.159650 -0.001679 0.036552
+v -0.160010 -0.001871 -0.036552
+v -0.160010 -0.001871 0.036552
+v -0.160402 -0.001990 -0.036552
+v -0.160402 -0.001990 0.036552
+v -0.160808 -0.002030 -0.036552
+v -0.160808 -0.002030 0.036552
+v -0.161215 -0.001990 -0.036552
+v -0.161215 -0.001990 0.036552
+v -0.161606 -0.001871 -0.036552
+v -0.161606 -0.001871 0.036552
+v -0.161967 -0.001679 -0.036552
+v -0.161967 -0.001679 0.036552
+v -0.162283 -0.001419 -0.036552
+v -0.162283 -0.001419 0.036552
+v -0.162542 -0.001103 -0.036552
+v -0.162542 -0.001103 0.036552
+v -0.162735 -0.000743 -0.036552
+v -0.162735 -0.000743 0.036552
+v -0.162853 -0.000352 -0.036552
+v -0.162853 -0.000352 0.036552
+v -0.162893 0.000055 -0.036552
+v -0.162893 0.000055 0.036552
+v -0.162853 0.000462 -0.036552
+v -0.162853 0.000462 0.036552
+v -0.162735 0.000853 -0.036552
+v -0.162735 0.000853 0.036552
+v -0.162542 0.001213 -0.036552
+v -0.162542 0.001213 0.036552
+v -0.162283 0.001529 -0.036552
+v -0.162283 0.001529 0.036552
+v -0.161967 0.001789 -0.036552
+v -0.161967 0.001789 0.036552
+v -0.161606 0.001981 -0.036552
+v -0.161606 0.001981 0.036552
+v -0.161215 0.002100 -0.036552
+v -0.161215 0.002100 0.036552
+vn 0.0980 0.9952 0.0000
+vn 0.2903 0.9569 0.0000
+vn 0.4714 0.8819 0.0000
+vn 0.6344 0.7730 0.0000
+vn 0.7730 0.6344 0.0000
+vn 0.8819 0.4714 0.0000
+vn 0.9570 0.2902 0.0000
+vn 0.9952 0.0980 0.0000
+vn 0.9952 -0.0981 0.0000
+vn 0.9569 -0.2903 0.0000
+vn 0.8819 -0.4714 0.0000
+vn 0.7730 -0.6344 0.0000
+vn 0.6344 -0.7730 0.0000
+vn 0.4714 -0.8819 0.0000
+vn 0.2903 -0.9569 0.0000
+vn 0.0980 -0.9952 0.0000
+vn -0.0980 -0.9952 0.0000
+vn -0.2903 -0.9569 0.0000
+vn -0.4714 -0.8819 0.0000
+vn -0.6344 -0.7730 0.0000
+vn -0.7730 -0.6344 0.0000
+vn -0.8819 -0.4714 0.0000
+vn -0.9569 -0.2903 0.0000
+vn -0.9952 -0.0980 0.0000
+vn -0.9952 0.0981 0.0000
+vn -0.9569 0.2903 0.0000
+vn -0.8819 0.4714 0.0000
+vn -0.7730 0.6344 0.0000
+vn -0.6344 0.7730 0.0000
+vn -0.4714 0.8819 0.0000
+vn -0.0000 0.0000 1.0000
+vn -0.2903 0.9569 0.0000
+vn -0.0980 0.9952 0.0000
+vn -0.0000 0.0000 -1.0000
+vn 0.9569 0.2903 0.0000
+vn 0.9952 0.0981 0.0000
+vn 0.9952 -0.0980 0.0000
+vn 0.9570 -0.2902 0.0000
+vn -0.9570 -0.2902 0.0000
+vn -0.9952 -0.0981 0.0000
+vn -0.9952 0.0980 0.0000
+vn -0.9570 0.2902 0.0000
+vn 0.0001 0.0000 1.0000
+vn -0.0001 0.0000 1.0000
+vn 0.0001 0.0000 -1.0000
+vn -0.0001 0.0000 -1.0000
+usemtl None
+s off
+f 322//230 323//230 321//230
+f 324//231 325//231 323//231
+f 326//232 327//232 325//232
+f 328//233 329//233 327//233
+f 330//234 331//234 329//234
+f 332//235 333//235 331//235
+f 334//236 335//236 333//236
+f 336//237 337//237 335//237
+f 338//238 339//238 337//238
+f 340//239 341//239 339//239
+f 342//240 343//240 341//240
+f 344//241 345//241 343//241
+f 346//242 347//242 345//242
+f 348//243 349//243 347//243
+f 350//244 351//244 349//244
+f 352//245 353//245 351//245
+f 354//246 355//246 353//246
+f 356//247 357//247 355//247
+f 358//248 359//248 357//248
+f 360//249 361//249 359//249
+f 362//250 363//250 361//250
+f 364//251 365//251 363//251
+f 366//252 367//252 365//252
+f 368//253 369//253 367//253
+f 370//254 371//254 369//254
+f 372//255 373//255 371//255
+f 374//256 375//256 373//256
+f 376//257 377//257 375//257
+f 378//258 379//258 377//258
+f 380//259 381//259 379//259
+f 358//260 342//260 374//260
+f 382//261 383//261 381//261
+f 384//262 321//262 383//262
+f 351//263 367//263 335//263
+f 322//230 324//230 323//230
+f 324//231 326//231 325//231
+f 326//232 328//232 327//232
+f 328//233 330//233 329//233
+f 330//234 332//234 331//234
+f 332//235 334//235 333//235
+f 334//264 336//264 335//264
+f 336//265 338//265 337//265
+f 338//266 340//266 339//266
+f 340//267 342//267 341//267
+f 342//240 344//240 343//240
+f 344//241 346//241 345//241
+f 346//242 348//242 347//242
+f 348//243 350//243 349//243
+f 350//244 352//244 351//244
+f 352//245 354//245 353//245
+f 354//246 356//246 355//246
+f 356//247 358//247 357//247
+f 358//248 360//248 359//248
+f 360//249 362//249 361//249
+f 362//250 364//250 363//250
+f 364//251 366//251 365//251
+f 366//268 368//268 367//268
+f 368//269 370//269 369//269
+f 370//270 372//270 371//270
+f 372//271 374//271 373//271
+f 374//256 376//256 375//256
+f 376//257 378//257 377//257
+f 378//258 380//258 379//258
+f 380//259 382//259 381//259
+f 326//260 324//260 322//260
+f 322//260 384//260 382//260
+f 382//260 380//260 378//260
+f 378//272 376//272 374//272
+f 374//260 372//260 370//260
+f 370//273 368//273 366//273
+f 366//272 364//272 362//272
+f 362//260 360//260 358//260
+f 358//260 356//260 354//260
+f 354//260 352//260 350//260
+f 350//272 348//272 346//272
+f 346//272 344//272 342//272
+f 342//272 340//272 338//272
+f 338//273 336//273 334//273
+f 334//260 332//260 330//260
+f 330//260 328//260 326//260
+f 326//260 322//260 374//260
+f 382//260 378//260 374//260
+f 374//260 370//260 366//260
+f 366//260 362//260 374//260
+f 358//260 354//260 342//260
+f 350//260 346//260 342//260
+f 342//260 338//260 334//260
+f 334//260 330//260 326//260
+f 322//260 382//260 374//260
+f 374//260 362//260 358//260
+f 354//260 350//260 342//260
+f 342//260 334//260 326//260
+f 326//260 374//260 342//260
+f 382//261 384//261 383//261
+f 384//262 322//262 321//262
+f 383//263 321//263 323//263
+f 323//263 325//263 327//263
+f 327//263 329//263 331//263
+f 331//263 333//263 335//263
+f 335//274 337//274 339//274
+f 339//263 341//263 343//263
+f 343//263 345//263 347//263
+f 347//263 349//263 351//263
+f 351//263 353//263 355//263
+f 355//263 357//263 359//263
+f 359//263 361//263 363//263
+f 363//275 365//275 367//275
+f 367//263 369//263 371//263
+f 371//275 373//275 375//275
+f 375//263 377//263 379//263
+f 379//263 381//263 383//263
+f 383//263 323//263 335//263
+f 327//263 331//263 335//263
+f 335//263 339//263 351//263
+f 343//263 347//263 351//263
+f 351//263 355//263 367//263
+f 359//263 363//263 367//263
+f 367//263 371//263 383//263
+f 375//263 379//263 383//263
+f 323//263 327//263 335//263
+f 339//263 343//263 351//263
+f 355//263 359//263 367//263
+f 371//263 375//263 383//263
+f 383//263 335//263 367//263
+o Cylinder.003
+v 0.294942 0.003272 -0.036552
+v 0.294942 0.003272 0.036552
+v 0.295349 0.003232 -0.036552
+v 0.295349 0.003232 0.036552
+v 0.295740 0.003113 -0.036552
+v 0.295740 0.003113 0.036552
+v 0.296100 0.002920 -0.036552
+v 0.296100 0.002920 0.036552
+v 0.296416 0.002661 -0.036552
+v 0.296416 0.002661 0.036552
+v 0.296676 0.002345 -0.036552
+v 0.296676 0.002345 0.036552
+v 0.296868 0.001985 -0.036552
+v 0.296868 0.001985 0.036552
+v 0.296987 0.001594 -0.036552
+v 0.296987 0.001594 0.036552
+v 0.297027 0.001187 -0.036552
+v 0.297027 0.001187 0.036552
+v 0.296987 0.000780 -0.036552
+v 0.296987 0.000780 0.036552
+v 0.296868 0.000389 -0.036552
+v 0.296868 0.000389 0.036552
+v 0.296676 0.000028 -0.036552
+v 0.296676 0.000028 0.036552
+v 0.296416 -0.000288 -0.036552
+v 0.296416 -0.000288 0.036552
+v 0.296100 -0.000547 -0.036552
+v 0.296100 -0.000547 0.036552
+v 0.295740 -0.000740 -0.036552
+v 0.295740 -0.000740 0.036552
+v 0.295349 -0.000858 -0.036552
+v 0.295349 -0.000858 0.036552
+v 0.294942 -0.000898 -0.036552
+v 0.294942 -0.000898 0.036552
+v 0.294535 -0.000858 -0.036552
+v 0.294535 -0.000858 0.036552
+v 0.294144 -0.000740 -0.036552
+v 0.294144 -0.000740 0.036552
+v 0.293784 -0.000547 -0.036552
+v 0.293784 -0.000547 0.036552
+v 0.293468 -0.000288 -0.036552
+v 0.293468 -0.000288 0.036552
+v 0.293208 0.000028 -0.036552
+v 0.293208 0.000028 0.036552
+v 0.293016 0.000389 -0.036552
+v 0.293016 0.000389 0.036552
+v 0.292897 0.000780 -0.036552
+v 0.292897 0.000780 0.036552
+v 0.292857 0.001187 -0.036552
+v 0.292857 0.001187 0.036552
+v 0.292897 0.001594 -0.036552
+v 0.292897 0.001594 0.036552
+v 0.293016 0.001985 -0.036552
+v 0.293016 0.001985 0.036552
+v 0.293208 0.002345 -0.036552
+v 0.293208 0.002345 0.036552
+v 0.293468 0.002661 -0.036552
+v 0.293468 0.002661 0.036552
+v 0.293784 0.002920 -0.036552
+v 0.293784 0.002920 0.036552
+v 0.294144 0.003113 -0.036552
+v 0.294144 0.003113 0.036552
+v 0.294535 0.003232 -0.036552
+v 0.294535 0.003232 0.036552
+vn 0.0980 0.9952 0.0000
+vn 0.2902 0.9570 0.0000
+vn 0.4714 0.8819 0.0000
+vn 0.6344 0.7730 0.0000
+vn 0.7730 0.6343 0.0000
+vn 0.8819 0.4714 0.0000
+vn 0.9570 0.2902 0.0000
+vn 0.9952 0.0980 0.0000
+vn 0.9952 -0.0980 0.0000
+vn 0.9569 -0.2903 0.0000
+vn 0.8819 -0.4714 0.0000
+vn 0.7729 -0.6345 0.0000
+vn 0.6344 -0.7730 0.0000
+vn 0.4713 -0.8819 0.0000
+vn 0.2903 -0.9569 0.0000
+vn 0.0980 -0.9952 0.0000
+vn -0.0980 -0.9952 0.0000
+vn -0.2902 -0.9570 0.0000
+vn -0.4714 -0.8819 0.0000
+vn -0.6344 -0.7730 0.0000
+vn -0.7730 -0.6343 0.0000
+vn -0.8819 -0.4714 0.0000
+vn -0.9570 -0.2902 0.0000
+vn -0.9952 -0.0980 0.0000
+vn -0.9952 0.0980 0.0000
+vn -0.9569 0.2903 0.0000
+vn -0.8819 0.4714 0.0000
+vn -0.7729 0.6345 0.0000
+vn -0.6344 0.7730 0.0000
+vn -0.4713 0.8819 0.0000
+vn -0.0000 0.0000 1.0000
+vn -0.2903 0.9569 0.0000
+vn -0.0980 0.9952 0.0000
+vn 0.0000 0.0000 -1.0000
+vn 0.2903 0.9569 0.0000
+vn 0.4713 0.8819 0.0000
+vn 0.7729 0.6345 0.0000
+vn 0.9569 0.2903 0.0000
+vn 0.9570 -0.2902 0.0000
+vn 0.7730 -0.6343 0.0000
+vn 0.4714 -0.8819 0.0000
+vn 0.2902 -0.9570 0.0000
+vn -0.2903 -0.9569 0.0000
+vn -0.4713 -0.8819 0.0000
+vn -0.7729 -0.6345 0.0000
+vn -0.9569 -0.2903 0.0000
+vn -0.9570 0.2902 0.0000
+vn -0.7730 0.6343 0.0000
+vn -0.4714 0.8819 0.0000
+vn -0.0001 0.0000 1.0000
+vn 0.0001 0.0000 1.0000
+vn -0.2902 0.9570 0.0000
+vn -0.0001 0.0000 -1.0000
+vn 0.0001 0.0000 -1.0000
+usemtl None
+s off
+f 386//276 387//276 385//276
+f 388//277 389//277 387//277
+f 390//278 391//278 389//278
+f 392//279 393//279 391//279
+f 394//280 395//280 393//280
+f 396//281 397//281 395//281
+f 398//282 399//282 397//282
+f 400//283 401//283 399//283
+f 402//284 403//284 401//284
+f 404//285 405//285 403//285
+f 406//286 407//286 405//286
+f 408//287 409//287 407//287
+f 410//288 411//288 409//288
+f 412//289 413//289 411//289
+f 414//290 415//290 413//290
+f 416//291 417//291 415//291
+f 418//292 419//292 417//292
+f 420//293 421//293 419//293
+f 422//294 423//294 421//294
+f 424//295 425//295 423//295
+f 426//296 427//296 425//296
+f 428//297 429//297 427//297
+f 430//298 431//298 429//298
+f 432//299 433//299 431//299
+f 434//300 435//300 433//300
+f 436//301 437//301 435//301
+f 438//302 439//302 437//302
+f 440//303 441//303 439//303
+f 442//304 443//304 441//304
+f 444//305 445//305 443//305
+f 422//306 406//306 438//306
+f 446//307 447//307 445//307
+f 448//308 385//308 447//308
+f 423//309 431//309 447//309
+f 386//276 388//276 387//276
+f 388//310 390//310 389//310
+f 390//311 392//311 391//311
+f 392//279 394//279 393//279
+f 394//312 396//312 395//312
+f 396//281 398//281 397//281
+f 398//313 400//313 399//313
+f 400//283 402//283 401//283
+f 402//284 404//284 403//284
+f 404//314 406//314 405//314
+f 406//286 408//286 407//286
+f 408//315 410//315 409//315
+f 410//288 412//288 411//288
+f 412//316 414//316 413//316
+f 414//317 416//317 415//317
+f 416//291 418//291 417//291
+f 418//292 420//292 419//292
+f 420//318 422//318 421//318
+f 422//319 424//319 423//319
+f 424//295 426//295 425//295
+f 426//320 428//320 427//320
+f 428//297 430//297 429//297
+f 430//321 432//321 431//321
+f 432//299 434//299 433//299
+f 434//300 436//300 435//300
+f 436//322 438//322 437//322
+f 438//302 440//302 439//302
+f 440//323 442//323 441//323
+f 442//304 444//304 443//304
+f 444//324 446//324 445//324
+f 390//306 388//306 386//306
+f 386//306 448//306 446//306
+f 446//306 444//306 442//306
+f 442//325 440//325 438//325
+f 438//306 436//306 434//306
+f 434//326 432//326 430//326
+f 430//326 428//326 426//326
+f 426//306 424//306 422//306
+f 422//306 420//306 418//306
+f 418//306 416//306 414//306
+f 414//326 412//326 410//326
+f 410//326 408//326 406//326
+f 406//326 404//326 402//326
+f 402//325 400//325 398//325
+f 398//306 396//306 394//306
+f 394//306 392//306 390//306
+f 390//306 386//306 438//306
+f 446//306 442//306 438//306
+f 438//306 434//306 430//306
+f 430//306 426//306 422//306
+f 422//306 418//306 406//306
+f 414//306 410//306 406//306
+f 406//306 402//306 398//306
+f 398//306 394//306 390//306
+f 386//306 446//306 438//306
+f 438//306 430//306 422//306
+f 418//306 414//306 406//306
+f 406//306 398//306 390//306
+f 390//306 438//306 406//306
+f 446//327 448//327 447//327
+f 448//308 386//308 385//308
+f 447//309 385//309 387//309
+f 387//309 389//309 391//309
+f 391//309 393//309 395//309
+f 395//309 397//309 399//309
+f 399//328 401//328 403//328
+f 403//309 405//309 407//309
+f 407//309 409//309 411//309
+f 411//309 413//309 415//309
+f 415//309 417//309 419//309
+f 419//309 421//309 423//309
+f 423//309 425//309 427//309
+f 427//309 429//309 431//309
+f 431//309 433//309 435//309
+f 435//329 437//329 439//329
+f 439//309 441//309 443//309
+f 443//309 445//309 447//309
+f 447//309 387//309 391//309
+f 391//309 395//309 399//309
+f 399//309 403//309 407//309
+f 407//309 411//309 415//309
+f 415//309 419//309 423//309
+f 423//309 427//309 431//309
+f 431//309 435//309 439//309
+f 439//309 443//309 447//309
+f 447//309 391//309 415//309
+f 399//309 407//309 415//309
+f 415//309 423//309 447//309
+f 431//309 439//309 447//309
+f 391//309 399//309 415//309
+o Cylinder
+v -0.300808 0.002140 -0.036552
+v -0.300808 0.002140 0.036552
+v -0.300402 0.002100 -0.036552
+v -0.300402 0.002100 0.036552
+v -0.300010 0.001981 -0.036552
+v -0.300010 0.001981 0.036552
+v -0.299650 0.001789 -0.036552
+v -0.299650 0.001789 0.036552
+v -0.299334 0.001529 -0.036552
+v -0.299334 0.001529 0.036552
+v -0.299075 0.001213 -0.036552
+v -0.299075 0.001213 0.036552
+v -0.298882 0.000853 -0.036552
+v -0.298882 0.000853 0.036552
+v -0.298763 0.000462 -0.036552
+v -0.298763 0.000462 0.036552
+v -0.298723 0.000055 -0.036552
+v -0.298723 0.000055 0.036552
+v -0.298763 -0.000352 -0.036552
+v -0.298763 -0.000352 0.036552
+v -0.298882 -0.000743 -0.036552
+v -0.298882 -0.000743 0.036552
+v -0.299075 -0.001103 -0.036552
+v -0.299075 -0.001103 0.036552
+v -0.299334 -0.001419 -0.036552
+v -0.299334 -0.001419 0.036552
+v -0.299650 -0.001679 -0.036552
+v -0.299650 -0.001679 0.036552
+v -0.300010 -0.001871 -0.036552
+v -0.300010 -0.001871 0.036552
+v -0.300402 -0.001990 -0.036552
+v -0.300402 -0.001990 0.036552
+v -0.300808 -0.002030 -0.036552
+v -0.300808 -0.002030 0.036552
+v -0.301215 -0.001990 -0.036552
+v -0.301215 -0.001990 0.036552
+v -0.301606 -0.001871 -0.036552
+v -0.301606 -0.001871 0.036552
+v -0.301967 -0.001679 -0.036552
+v -0.301967 -0.001679 0.036552
+v -0.302283 -0.001419 -0.036552
+v -0.302283 -0.001419 0.036552
+v -0.302542 -0.001103 -0.036552
+v -0.302542 -0.001103 0.036552
+v -0.302735 -0.000743 -0.036552
+v -0.302735 -0.000743 0.036552
+v -0.302853 -0.000352 -0.036552
+v -0.302853 -0.000352 0.036552
+v -0.302893 0.000055 -0.036552
+v -0.302893 0.000055 0.036552
+v -0.302853 0.000462 -0.036552
+v -0.302853 0.000462 0.036552
+v -0.302735 0.000853 -0.036552
+v -0.302735 0.000853 0.036552
+v -0.302542 0.001213 -0.036552
+v -0.302542 0.001213 0.036552
+v -0.302283 0.001529 -0.036552
+v -0.302283 0.001529 0.036552
+v -0.301967 0.001789 -0.036552
+v -0.301967 0.001789 0.036552
+v -0.301606 0.001981 -0.036552
+v -0.301606 0.001981 0.036552
+v -0.301215 0.002100 -0.036552
+v -0.301215 0.002100 0.036552
+vn 0.0980 0.9952 0.0000
+vn 0.2903 0.9569 0.0000
+vn 0.4714 0.8819 0.0000
+vn 0.6344 0.7730 0.0000
+vn 0.7730 0.6343 0.0000
+vn 0.8819 0.4715 0.0000
+vn 0.9569 0.2903 0.0000
+vn 0.9952 0.0980 0.0000
+vn 0.9952 -0.0980 0.0000
+vn 0.9569 -0.2903 0.0000
+vn 0.8820 -0.4713 0.0000
+vn 0.7730 -0.6344 0.0000
+vn 0.6344 -0.7730 0.0000
+vn 0.4714 -0.8819 0.0000
+vn 0.2903 -0.9569 0.0000
+vn 0.0980 -0.9952 0.0000
+vn -0.0980 -0.9952 0.0000
+vn -0.2903 -0.9569 0.0000
+vn -0.4714 -0.8819 0.0000
+vn -0.6344 -0.7730 0.0000
+vn -0.7730 -0.6343 0.0000
+vn -0.8819 -0.4715 0.0000
+vn -0.9569 -0.2903 0.0000
+vn -0.9952 -0.0980 0.0000
+vn -0.9952 0.0980 0.0000
+vn -0.9569 0.2903 0.0000
+vn -0.8820 0.4713 0.0000
+vn -0.7730 0.6344 0.0000
+vn -0.6344 0.7730 0.0000
+vn -0.4714 0.8819 0.0000
+vn -0.0000 0.0000 1.0000
+vn -0.2903 0.9569 0.0000
+vn -0.0980 0.9952 0.0000
+vn 0.0000 0.0000 -1.0000
+vn 0.7730 0.6344 0.0000
+vn 0.8820 0.4713 0.0000
+vn 0.8819 -0.4715 0.0000
+vn 0.7730 -0.6343 0.0000
+vn -0.7730 -0.6344 0.0000
+vn -0.8820 -0.4713 0.0000
+vn -0.8819 0.4715 0.0000
+vn -0.7730 0.6343 0.0000
+vn 0.0001 0.0000 1.0000
+vn -0.0001 0.0000 1.0000
+vn 0.0001 0.0000 -1.0000
+vn -0.0001 0.0000 -1.0000
+usemtl None
+s off
+f 450//330 451//330 449//330
+f 452//331 453//331 451//331
+f 454//332 455//332 453//332
+f 456//333 457//333 455//333
+f 458//334 459//334 457//334
+f 460//335 461//335 459//335
+f 462//336 463//336 461//336
+f 464//337 465//337 463//337
+f 466//338 467//338 465//338
+f 468//339 469//339 467//339
+f 470//340 471//340 469//340
+f 472//341 473//341 471//341
+f 474//342 475//342 473//342
+f 476//343 477//343 475//343
+f 478//344 479//344 477//344
+f 480//345 481//345 479//345
+f 482//346 483//346 481//346
+f 484//347 485//347 483//347
+f 486//348 487//348 485//348
+f 488//349 489//349 487//349
+f 490//350 491//350 489//350
+f 492//351 493//351 491//351
+f 494//352 495//352 493//352
+f 496//353 497//353 495//353
+f 498//354 499//354 497//354
+f 500//355 501//355 499//355
+f 502//356 503//356 501//356
+f 504//357 505//357 503//357
+f 506//358 507//358 505//358
+f 508//359 509//359 507//359
+f 486//360 470//360 502//360
+f 510//361 511//361 509//361
+f 512//362 449//362 511//362
+f 487//363 495//363 511//363
+f 450//330 452//330 451//330
+f 452//331 454//331 453//331
+f 454//332 456//332 455//332
+f 456//333 458//333 457//333
+f 458//364 460//364 459//364
+f 460//365 462//365 461//365
+f 462//336 464//336 463//336
+f 464//337 466//337 465//337
+f 466//338 468//338 467//338
+f 468//339 470//339 469//339
+f 470//366 472//366 471//366
+f 472//367 474//367 473//367
+f 474//342 476//342 475//342
+f 476//343 478//343 477//343
+f 478//344 480//344 479//344
+f 480//345 482//345 481//345
+f 482//346 484//346 483//346
+f 484//347 486//347 485//347
+f 486//348 488//348 487//348
+f 488//349 490//349 489//349
+f 490//368 492//368 491//368
+f 492//369 494//369 493//369
+f 494//352 496//352 495//352
+f 496//353 498//353 497//353
+f 498//354 500//354 499//354
+f 500//355 502//355 501//355
+f 502//370 504//370 503//370
+f 504//371 506//371 505//371
+f 506//358 508//358 507//358
+f 508//359 510//359 509//359
+f 454//360 452//360 450//360
+f 450//360 512//360 510//360
+f 510//360 508//360 506//360
+f 506//372 504//372 502//372
+f 502//360 500//360 498//360
+f 498//373 496//373 494//373
+f 494//372 492//372 490//372
+f 490//360 488//360 486//360
+f 486//360 484//360 482//360
+f 482//360 480//360 478//360
+f 478//372 476//372 474//372
+f 474//372 472//372 470//372
+f 470//372 468//372 466//372
+f 466//373 464//373 462//373
+f 462//360 460//360 458//360
+f 458//360 456//360 454//360
+f 454//360 450//360 502//360
+f 510//360 506//360 502//360
+f 502//360 498//360 494//360
+f 494//360 490//360 486//360
+f 486//360 482//360 470//360
+f 478//360 474//360 470//360
+f 470//360 466//360 462//360
+f 462//360 458//360 454//360
+f 450//360 510//360 502//360
+f 502//360 494//360 486//360
+f 482//360 478//360 470//360
+f 470//360 462//360 454//360
+f 454//360 502//360 470//360
+f 510//361 512//361 511//361
+f 512//362 450//362 449//362
+f 511//363 449//363 451//363
+f 451//363 453//363 455//363
+f 455//363 457//363 459//363
+f 459//363 461//363 463//363
+f 463//374 465//374 467//374
+f 467//363 469//363 471//363
+f 471//363 473//363 475//363
+f 475//363 477//363 479//363
+f 479//363 481//363 483//363
+f 483//363 485//363 487//363
+f 487//363 489//363 491//363
+f 491//375 493//375 495//375
+f 495//363 497//363 499//363
+f 499//375 501//375 503//375
+f 503//363 505//363 507//363
+f 507//363 509//363 511//363
+f 511//363 451//363 455//363
+f 455//363 459//363 463//363
+f 463//363 467//363 471//363
+f 471//363 475//363 479//363
+f 479//363 483//363 487//363
+f 487//363 491//363 495//363
+f 495//363 499//363 503//363
+f 503//363 507//363 511//363
+f 511//363 455//363 479//363
+f 463//363 471//363 479//363
+f 479//363 487//363 511//363
+f 495//363 503//363 511//363
+f 455//363 463//363 479//363
diff --git a/data/quadruped/vision/checker_blue.png b/data/quadruped/vision/checker_blue.png
new file mode 100644
index 000000000..0894b91f1
Binary files /dev/null and b/data/quadruped/vision/checker_blue.png differ
diff --git a/data/quadruped/vision/t-motor.jpg b/data/quadruped/vision/t-motor.jpg
new file mode 100644
index 000000000..dbd5d1a6e
Binary files /dev/null and b/data/quadruped/vision/t-motor.jpg differ
diff --git a/data/quadruped/vision/tmotor.blend b/data/quadruped/vision/tmotor.blend
new file mode 100644
index 000000000..ba06c0075
Binary files /dev/null and b/data/quadruped/vision/tmotor.blend differ
diff --git a/data/quadruped/vision/tmotor3.mtl b/data/quadruped/vision/tmotor3.mtl
new file mode 100644
index 000000000..6df3f0d52
--- /dev/null
+++ b/data/quadruped/vision/tmotor3.mtl
@@ -0,0 +1,19 @@
+# Blender MTL File: 'tmotor.blend'
+# Material Count: 2
+
+newmtl None
+Ns 0
+Ka 0.000000 0.000000 0.000000
+Kd 0.8 0.8 0.8
+Ks 0.8 0.8 0.8
+d 1
+illum 2
+map_Kd t-motor.jpg
+
+newmtl None_NONE
+Ns 0
+Ka 0.000000 0.000000 0.000000
+Kd 0.8 0.8 0.8
+Ks 0.8 0.8 0.8
+d 1
+illum 2
diff --git a/data/quadruped/vision/tmotor3.obj b/data/quadruped/vision/tmotor3.obj
new file mode 100644
index 000000000..a34cb685f
--- /dev/null
+++ b/data/quadruped/vision/tmotor3.obj
@@ -0,0 +1,325 @@
+# Blender v2.78 (sub 0) OBJ File: 'tmotor.blend'
+# www.blender.org
+mtllib tmotor3.mtl
+o Cylinder
+v 0.000000 0.043000 -0.006500
+v 0.000000 0.043000 0.006500
+v 0.008389 0.042174 -0.006500
+v 0.008389 0.042174 0.006500
+v 0.016455 0.039727 -0.006500
+v 0.016455 0.039727 0.006500
+v 0.023890 0.035753 -0.006500
+v 0.023890 0.035753 0.006500
+v 0.030406 0.030406 -0.006500
+v 0.030406 0.030406 0.006500
+v 0.035753 0.023890 -0.006500
+v 0.035753 0.023890 0.006500
+v 0.039727 0.016455 -0.006500
+v 0.039727 0.016455 0.006500
+v 0.042174 0.008389 -0.006500
+v 0.042174 0.008389 0.006500
+v 0.043000 0.000000 -0.006500
+v 0.043000 0.000000 0.006500
+v 0.042174 -0.008389 -0.006500
+v 0.042174 -0.008389 0.006500
+v 0.039727 -0.016455 -0.006500
+v 0.039727 -0.016455 0.006500
+v 0.035753 -0.023890 -0.006500
+v 0.035753 -0.023890 0.006500
+v 0.030406 -0.030406 -0.006500
+v 0.030406 -0.030406 0.006500
+v 0.023890 -0.035753 -0.006500
+v 0.023890 -0.035753 0.006500
+v 0.016455 -0.039727 -0.006500
+v 0.016455 -0.039727 0.006500
+v 0.008389 -0.042174 -0.006500
+v 0.008389 -0.042174 0.006500
+v -0.000000 -0.043000 -0.006500
+v -0.000000 -0.043000 0.006500
+v -0.008389 -0.042174 -0.006500
+v -0.008389 -0.042174 0.006500
+v -0.016455 -0.039727 -0.006500
+v -0.016455 -0.039727 0.006500
+v -0.023890 -0.035753 -0.006500
+v -0.023890 -0.035753 0.006500
+v -0.030406 -0.030406 -0.006500
+v -0.030406 -0.030406 0.006500
+v -0.035753 -0.023889 -0.006500
+v -0.035753 -0.023889 0.006500
+v -0.039727 -0.016455 -0.006500
+v -0.039727 -0.016455 0.006500
+v -0.042174 -0.008389 -0.006500
+v -0.042174 -0.008389 0.006500
+v -0.043000 0.000000 -0.006500
+v -0.043000 0.000000 0.006500
+v -0.042174 0.008389 -0.006500
+v -0.042174 0.008389 0.006500
+v -0.039727 0.016455 -0.006500
+v -0.039727 0.016455 0.006500
+v -0.035753 0.023890 -0.006500
+v -0.035753 0.023890 0.006500
+v -0.030406 0.030406 -0.006500
+v -0.030406 0.030406 0.006500
+v -0.023889 0.035753 -0.006500
+v -0.023889 0.035753 0.006500
+v -0.016455 0.039727 -0.006500
+v -0.016455 0.039727 0.006500
+v -0.008389 0.042174 -0.006500
+v -0.008389 0.042174 0.006500
+vt 0.6520 0.1657
+vt 0.8624 0.3762
+vt 0.6520 0.8843
+vt 0.5790 0.9064
+vt 0.3543 0.8843
+vt 0.5031 0.9139
+vt 0.4273 0.9064
+vt 0.2871 0.8484
+vt 0.2281 0.8000
+vt 0.1798 0.7411
+vt 0.1438 0.6738
+vt 0.1217 0.6009
+vt 0.1142 0.5250
+vt 0.1217 0.4491
+vt 0.1438 0.3762
+vt 0.1798 0.3089
+vt 0.2281 0.2500
+vt 0.2871 0.2016
+vt 0.3543 0.1657
+vt 0.4273 0.1436
+vt 0.5031 0.1361
+vt 0.5790 0.1436
+vt 0.7192 0.2016
+vt 0.7781 0.2500
+vt 0.8265 0.3089
+vt 0.8846 0.4491
+vt 0.8920 0.5250
+vt 0.8846 0.6009
+vt 0.8624 0.6738
+vt 0.8265 0.7411
+vt 0.7781 0.8000
+vt 0.7192 0.8484
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vt 0.0000 0.0000
+vn 0.0000 0.0000 1.0000
+vn 0.0980 0.9952 0.0000
+vn 0.2903 0.9569 0.0000
+vn 0.4714 0.8819 0.0000
+vn 0.6344 0.7730 0.0000
+vn 0.7730 0.6344 0.0000
+vn 0.8819 0.4714 0.0000
+vn 0.9569 0.2903 0.0000
+vn 0.9952 0.0980 0.0000
+vn 0.9952 -0.0980 0.0000
+vn 0.9569 -0.2903 0.0000
+vn 0.8819 -0.4714 0.0000
+vn 0.7730 -0.6344 0.0000
+vn 0.6344 -0.7730 0.0000
+vn 0.4714 -0.8819 0.0000
+vn 0.2903 -0.9569 0.0000
+vn 0.0980 -0.9952 0.0000
+vn -0.0980 -0.9952 0.0000
+vn -0.2903 -0.9569 0.0000
+vn -0.4714 -0.8819 0.0000
+vn -0.6344 -0.7730 0.0000
+vn -0.7730 -0.6344 0.0000
+vn -0.8819 -0.4714 0.0000
+vn -0.9569 -0.2903 0.0000
+vn -0.9952 -0.0980 0.0000
+vn -0.9952 0.0980 0.0000
+vn -0.9569 0.2903 0.0000
+vn -0.8819 0.4714 0.0000
+vn -0.7730 0.6344 0.0000
+vn -0.6344 0.7730 0.0000
+vn -0.4714 0.8819 0.0000
+vn -0.2903 0.9569 0.0000
+vn -0.0980 0.9952 0.0000
+vn 0.0000 0.0000 -1.0000
+usemtl None
+s off
+f 30/1/1 22/2/1 6/3/1
+f 6/3/1 4/4/1 62/5/1
+f 2/6/1 64/7/1 62/5/1
+f 62/5/1 60/8/1 58/9/1
+f 58/9/1 56/10/1 54/11/1
+f 54/11/1 52/12/1 50/13/1
+f 50/13/1 48/14/1 54/11/1
+f 46/15/1 44/16/1 42/17/1
+f 42/17/1 40/18/1 38/19/1
+f 38/19/1 36/20/1 34/21/1
+f 34/21/1 32/22/1 38/19/1
+f 30/1/1 28/23/1 26/24/1
+f 26/24/1 24/25/1 22/2/1
+f 22/2/1 20/26/1 18/27/1
+f 18/27/1 16/28/1 22/2/1
+f 14/29/1 12/30/1 10/31/1
+f 10/31/1 8/32/1 6/3/1
+f 4/4/1 2/6/1 62/5/1
+f 62/5/1 58/9/1 6/3/1
+f 54/11/1 48/14/1 46/15/1
+f 46/15/1 42/17/1 54/11/1
+f 38/19/1 32/22/1 30/1/1
+f 30/1/1 26/24/1 22/2/1
+f 22/2/1 16/28/1 14/29/1
+f 14/29/1 10/31/1 22/2/1
+f 6/3/1 58/9/1 54/11/1
+f 54/11/1 42/17/1 38/19/1
+f 38/19/1 30/1/1 6/3/1
+f 22/2/1 10/31/1 6/3/1
+f 6/3/1 54/11/1 38/19/1
+usemtl None
+f 2/33/2 3/34/2 1/35/2
+f 4/36/3 5/37/3 3/34/3
+f 6/38/4 7/39/4 5/37/4
+f 8/40/5 9/41/5 7/39/5
+f 10/42/6 11/43/6 9/41/6
+f 12/44/7 13/45/7 11/43/7
+f 14/46/8 15/47/8 13/45/8
+f 16/48/9 17/49/9 15/47/9
+f 18/50/10 19/51/10 17/49/10
+f 20/52/11 21/53/11 19/51/11
+f 22/54/12 23/55/12 21/53/12
+f 24/56/13 25/57/13 23/55/13
+f 26/58/14 27/59/14 25/57/14
+f 28/60/15 29/61/15 27/59/15
+f 30/62/16 31/63/16 29/61/16
+f 32/64/17 33/65/17 31/63/17
+f 34/66/18 35/67/18 33/65/18
+f 36/68/19 37/69/19 35/67/19
+f 38/70/20 39/71/20 37/69/20
+f 40/72/21 41/73/21 39/71/21
+f 42/74/22 43/75/22 41/73/22
+f 44/76/23 45/77/23 43/75/23
+f 46/78/24 47/79/24 45/77/24
+f 48/80/25 49/81/25 47/79/25
+f 50/82/26 51/83/26 49/81/26
+f 52/84/27 53/85/27 51/83/27
+f 54/86/28 55/87/28 53/85/28
+f 56/88/29 57/89/29 55/87/29
+f 58/90/30 59/91/30 57/89/30
+f 60/92/31 61/93/31 59/91/31
+f 62/94/32 63/95/32 61/93/32
+f 64/96/33 1/35/33 63/95/33
+f 31/63/34 55/87/34 63/95/34
+f 2/33/2 4/36/2 3/34/2
+f 4/36/3 6/38/3 5/37/3
+f 6/38/4 8/40/4 7/39/4
+f 8/40/5 10/42/5 9/41/5
+f 10/42/6 12/44/6 11/43/6
+f 12/44/7 14/46/7 13/45/7
+f 14/46/8 16/48/8 15/47/8
+f 16/48/9 18/50/9 17/49/9
+f 18/50/10 20/52/10 19/51/10
+f 20/52/11 22/54/11 21/53/11
+f 22/54/12 24/56/12 23/55/12
+f 24/56/13 26/58/13 25/57/13
+f 26/58/14 28/60/14 27/59/14
+f 28/60/15 30/62/15 29/61/15
+f 30/62/16 32/64/16 31/63/16
+f 32/64/17 34/66/17 33/65/17
+f 34/66/18 36/68/18 35/67/18
+f 36/68/19 38/70/19 37/69/19
+f 38/70/20 40/72/20 39/71/20
+f 40/72/21 42/74/21 41/73/21
+f 42/74/22 44/76/22 43/75/22
+f 44/76/23 46/78/23 45/77/23
+f 46/78/24 48/80/24 47/79/24
+f 48/80/25 50/82/25 49/81/25
+f 50/82/26 52/84/26 51/83/26
+f 52/84/27 54/86/27 53/85/27
+f 54/86/28 56/88/28 55/87/28
+f 56/88/29 58/90/29 57/89/29
+f 58/90/30 60/92/30 59/91/30
+f 60/92/31 62/94/31 61/93/31
+f 62/94/32 64/96/32 63/95/32
+f 64/96/33 2/33/33 1/35/33
+f 63/95/34 1/35/34 3/34/34
+f 3/34/34 5/37/34 7/39/34
+f 7/39/34 9/41/34 15/47/34
+f 11/43/34 13/45/34 15/47/34
+f 15/47/34 17/49/34 19/51/34
+f 19/51/34 21/53/34 23/55/34
+f 23/55/34 25/57/34 31/63/34
+f 27/59/34 29/61/34 31/63/34
+f 31/63/34 33/65/34 35/67/34
+f 35/67/34 37/69/34 31/63/34
+f 39/71/34 41/73/34 47/79/34
+f 43/75/34 45/77/34 47/79/34
+f 47/79/34 49/81/34 51/83/34
+f 51/83/34 53/85/34 55/87/34
+f 55/87/34 57/89/34 63/95/34
+f 59/91/34 61/93/34 63/95/34
+f 63/95/34 3/34/34 15/47/34
+f 9/41/34 11/43/34 15/47/34
+f 15/47/34 19/51/34 31/63/34
+f 25/57/34 27/59/34 31/63/34
+f 31/63/34 37/69/34 39/71/34
+f 41/73/34 43/75/34 47/79/34
+f 47/79/34 51/83/34 55/87/34
+f 57/89/34 59/91/34 63/95/34
+f 3/34/34 7/39/34 15/47/34
+f 19/51/34 23/55/34 31/63/34
+f 31/63/34 39/71/34 47/79/34
+f 47/79/34 55/87/34 31/63/34
+f 63/95/34 15/47/34 31/63/34
diff --git a/data/quadruped/vision/vision.py b/data/quadruped/vision/vision.py
new file mode 100644
index 000000000..0901d7dfc
--- /dev/null
+++ b/data/quadruped/vision/vision.py
@@ -0,0 +1,220 @@
+import pybullet as p
+import time
+import math
+
+pi = 3.14159264
+limitVal = 2*pi
+legpos = 3./4.*pi
+legposS = 0
+legposSright = 0#-0.3
+legposSleft = 0#0.3
+
+defaultERP=0.4
+maxMotorForce = 5000
+maxGearForce = 10000
+jointFriction = 0.1
+
+
+p.connect(p.GUI)
+
+
+amplitudeId= p.addUserDebugParameter("amplitude",0,3.14,0.5)
+timeScaleId = p.addUserDebugParameter("timeScale",0,10,1)
+
+
+jointTypeNames={}
+jointTypeNames[p.JOINT_REVOLUTE]="JOINT_REVOLUTE"
+jointTypeNames[p.JOINT_FIXED]="JOINT_FIXED"
+p.setPhysicsEngineParameter(numSolverIterations=100)
+p.loadURDF("plane_transparent.urdf", useMaximalCoordinates=True)
+#disable rendering during creation.
+#p.configureDebugVisualizer(p.COV_ENABLE_RENDERING,1)
+p.configureDebugVisualizer(p.COV_ENABLE_PLANAR_REFLECTION,1)
+
+
+jointNamesToIndex={}
+
+
+p.configureDebugVisualizer(p.COV_ENABLE_RENDERING,0)
+vision = p.loadURDF("vision60.urdf",[0,0,0.4],useFixedBase=False)
+p.configureDebugVisualizer(p.COV_ENABLE_RENDERING,1)
+
+
+for j in range(p.getNumJoints(vision)):
+ jointInfo = p.getJointInfo(vision,j)
+ jointInfoName = jointInfo[1].decode("utf-8")
+ print("joint ",j," = ",jointInfoName, "type=",jointTypeNames[jointInfo[2]])
+ jointNamesToIndex[jointInfoName ]=j
+ #print("jointNamesToIndex[..]=",jointNamesToIndex[jointInfoName])
+ p.setJointMotorControl2(vision,j,p.VELOCITY_CONTROL,targetVelocity=0, force=jointFriction)
+
+
+chassis_right_center = jointNamesToIndex['chassis_right_center']
+motor_front_rightR_joint = jointNamesToIndex['motor_front_rightR_joint']
+motor_front_rightS_joint = jointNamesToIndex['motor_front_rightS_joint']
+hip_front_rightR_joint = jointNamesToIndex['hip_front_rightR_joint']
+knee_front_rightR_joint = jointNamesToIndex['knee_front_rightR_joint']
+motor_front_rightL_joint = jointNamesToIndex['motor_front_rightL_joint']
+motor_back_rightR_joint = jointNamesToIndex['motor_back_rightR_joint']
+motor_back_rightS_joint = jointNamesToIndex['motor_back_rightS_joint']
+hip_back_rightR_joint = jointNamesToIndex['hip_back_rightR_joint']
+knee_back_rightR_joint = jointNamesToIndex['knee_back_rightR_joint']
+motor_back_rightL_joint = jointNamesToIndex['motor_back_rightL_joint']
+chassis_left_center = jointNamesToIndex['chassis_left_center']
+motor_front_leftL_joint = jointNamesToIndex['motor_front_leftL_joint']
+motor_front_leftS_joint = jointNamesToIndex['motor_front_leftS_joint']
+hip_front_leftL_joint = jointNamesToIndex['hip_front_leftL_joint']
+knee_front_leftL_joint = jointNamesToIndex['knee_front_leftL_joint']
+motor_front_leftR_joint = jointNamesToIndex['motor_front_leftR_joint']
+motor_back_leftL_joint = jointNamesToIndex['motor_back_leftL_joint']
+hip_back_leftL_joint = jointNamesToIndex['hip_back_leftL_joint']
+knee_back_leftL_joint = jointNamesToIndex['knee_back_leftL_joint']
+motor_back_leftR_joint = jointNamesToIndex['motor_back_leftR_joint']
+motor_back_leftS_joint = jointNamesToIndex['motor_back_leftS_joint']
+
+motA_rf_Id= p.addUserDebugParameter("motA_rf",-limitVal,limitVal,legpos)
+motB_rf_Id= p.addUserDebugParameter("motB_rf",-limitVal,limitVal,legpos)
+motC_rf_Id= p.addUserDebugParameter("motC_rf",-limitVal,limitVal,legposSright)
+erp_rf_Id= p.addUserDebugParameter("erp_rf",0,1,defaultERP)
+relPosTarget_rf_Id= p.addUserDebugParameter("relPosTarget_rf",-limitVal,limitVal,0)
+
+
+motA_lf_Id= p.addUserDebugParameter("motA_lf",-limitVal,limitVal,-legpos)
+motB_lf_Id= p.addUserDebugParameter("motB_lf",-limitVal,limitVal,-legpos)
+motC_lf_Id= p.addUserDebugParameter("motC_lf",-limitVal,limitVal,legposSleft)
+
+erp_lf_Id= p.addUserDebugParameter("erp_lf",0,1,defaultERP)
+relPosTarget_lf_Id= p.addUserDebugParameter("relPosTarget_lf",-limitVal,limitVal,0)
+
+motA_rb_Id= p.addUserDebugParameter("motA_rb",-limitVal,limitVal,legpos)
+motB_rb_Id= p.addUserDebugParameter("motB_rb",-limitVal,limitVal,legpos)
+motC_rb_Id= p.addUserDebugParameter("motC_rb",-limitVal,limitVal,legposSright)
+
+erp_rb_Id= p.addUserDebugParameter("erp_rb",0,1,defaultERP)
+relPosTarget_rb_Id= p.addUserDebugParameter("relPosTarget_rb",-limitVal,limitVal,0)
+
+
+motA_lb_Id= p.addUserDebugParameter("motA_lb",-limitVal,limitVal,-legpos)
+motB_lb_Id= p.addUserDebugParameter("motB_lb",-limitVal,limitVal,-legpos)
+motC_lb_Id= p.addUserDebugParameter("motC_lb",-limitVal,limitVal,legposSleft)
+
+erp_lb_Id= p.addUserDebugParameter("erp_lb",0,1,defaultERP)
+relPosTarget_lb_Id= p.addUserDebugParameter("relPosTarget_lb",-limitVal,limitVal,0)
+
+camTargetPos=[0.25,0.62,-0.15]
+camDist = 2
+camYaw = -2
+camPitch=-16
+p.resetDebugVisualizerCamera(camDist, camYaw, camPitch, camTargetPos)
+
+
+
+
+
+c_rf = p.createConstraint(vision,knee_front_rightR_joint,vision,motor_front_rightL_joint,jointType=p.JOINT_GEAR,jointAxis =[0,1,0],parentFramePosition=[0,0,0],childFramePosition=[0,0,0])
+p.changeConstraint(c_rf,gearRatio=-1, gearAuxLink = motor_front_rightR_joint,maxForce=maxGearForce)
+
+c_lf = p.createConstraint(vision,knee_front_leftL_joint,vision,motor_front_leftR_joint,jointType=p.JOINT_GEAR,jointAxis =[0,1,0],parentFramePosition=[0,0,0],childFramePosition=[0,0,0])
+p.changeConstraint(c_lf,gearRatio=-1, gearAuxLink = motor_front_leftL_joint,maxForce=maxGearForce)
+
+c_rb = p.createConstraint(vision,knee_back_rightR_joint,vision,motor_back_rightL_joint,jointType=p.JOINT_GEAR,jointAxis =[0,1,0],parentFramePosition=[0,0,0],childFramePosition=[0,0,0])
+p.changeConstraint(c_rb,gearRatio=-1, gearAuxLink = motor_back_rightR_joint,maxForce=maxGearForce)
+
+c_lb = p.createConstraint(vision,knee_back_leftL_joint,vision,motor_back_leftR_joint,jointType=p.JOINT_GEAR,jointAxis =[0,1,0],parentFramePosition=[0,0,0],childFramePosition=[0,0,0])
+p.changeConstraint(c_lb,gearRatio=-1, gearAuxLink = motor_back_leftL_joint,maxForce=maxGearForce)
+
+
+
+
+p.setRealTimeSimulation(1)
+for i in range (1):
+#while (1):
+ motA_rf = p.readUserDebugParameter(motA_rf_Id)
+ motB_rf = p.readUserDebugParameter(motB_rf_Id)
+ motC_rf = p.readUserDebugParameter(motC_rf_Id)
+ erp_rf = p.readUserDebugParameter(erp_rf_Id)
+ relPosTarget_rf = p.readUserDebugParameter(relPosTarget_rf_Id)
+ #motC_rf
+ p.setJointMotorControl2(vision,motor_front_rightR_joint,p.POSITION_CONTROL,targetPosition=motA_rf,force=maxMotorForce)
+ p.setJointMotorControl2(vision,motor_front_rightL_joint,p.POSITION_CONTROL,targetPosition=motB_rf,force=maxMotorForce)
+ p.setJointMotorControl2(vision,motor_front_rightS_joint,p.POSITION_CONTROL,targetPosition=motC_rf,force=maxMotorForce)
+ p.changeConstraint(c_rf,gearRatio=-1, gearAuxLink = motor_front_rightR_joint,erp=erp_rf, relativePositionTarget=relPosTarget_rf,maxForce=maxGearForce)
+
+ motA_lf = p.readUserDebugParameter(motA_lf_Id)
+ motB_lf = p.readUserDebugParameter(motB_lf_Id)
+ motC_lf = p.readUserDebugParameter(motC_lf_Id)
+ erp_lf = p.readUserDebugParameter(erp_lf_Id)
+ relPosTarget_lf = p.readUserDebugParameter(relPosTarget_lf_Id)
+ p.setJointMotorControl2(vision,motor_front_leftL_joint,p.POSITION_CONTROL,targetPosition=motA_lf,force=maxMotorForce)
+ p.setJointMotorControl2(vision,motor_front_leftR_joint,p.POSITION_CONTROL,targetPosition=motB_lf,force=maxMotorForce)
+ p.setJointMotorControl2(vision,motor_front_leftS_joint,p.POSITION_CONTROL,targetPosition=motC_lf,force=maxMotorForce)
+ p.changeConstraint(c_lf,gearRatio=-1, gearAuxLink = motor_front_leftL_joint,erp=erp_lf, relativePositionTarget=relPosTarget_lf,maxForce=maxGearForce)
+
+
+ motA_rb = p.readUserDebugParameter(motA_rb_Id)
+ motB_rb = p.readUserDebugParameter(motB_rb_Id)
+ motC_rb = p.readUserDebugParameter(motC_rb_Id)
+ erp_rb = p.readUserDebugParameter(erp_rb_Id)
+ relPosTarget_rb = p.readUserDebugParameter(relPosTarget_rb_Id)
+ p.setJointMotorControl2(vision,motor_back_rightR_joint,p.POSITION_CONTROL,targetPosition=motA_rb,force=maxMotorForce)
+ p.setJointMotorControl2(vision,motor_back_rightL_joint,p.POSITION_CONTROL,targetPosition=motB_rb,force=maxMotorForce)
+ p.setJointMotorControl2(vision,motor_back_rightS_joint,p.POSITION_CONTROL,targetPosition=motC_rb,force=maxMotorForce)
+ p.changeConstraint(c_rb,gearRatio=-1, gearAuxLink = motor_back_rightR_joint,erp=erp_rb, relativePositionTarget=relPosTarget_rb,maxForce=maxGearForce)
+
+ motA_lb = p.readUserDebugParameter(motA_lb_Id)
+ motB_lb = p.readUserDebugParameter(motB_lb_Id)
+ motC_lb = p.readUserDebugParameter(motC_lb_Id)
+ erp_lb = p.readUserDebugParameter(erp_lb_Id)
+ relPosTarget_lb = p.readUserDebugParameter(relPosTarget_lb_Id)
+ p.setJointMotorControl2(vision,motor_back_leftL_joint,p.POSITION_CONTROL,targetPosition=motA_lb,force=maxMotorForce)
+ p.setJointMotorControl2(vision,motor_back_leftR_joint,p.POSITION_CONTROL,targetPosition=motB_lb,force=maxMotorForce)
+ p.setJointMotorControl2(vision,motor_back_leftS_joint,p.POSITION_CONTROL,targetPosition=motC_lb,force=maxMotorForce)
+ p.changeConstraint(c_lb,gearRatio=-1, gearAuxLink = motor_back_leftL_joint,erp=erp_lb, relativePositionTarget=relPosTarget_lb,maxForce=maxGearForce)
+
+
+
+ p.setGravity(0,0,-10)
+ time.sleep(1./240.)
+t = 0
+prevTime = time.time()
+while (1):
+ timeScale = p.readUserDebugParameter(timeScaleId)
+ amplitude = p.readUserDebugParameter(amplitudeId)
+ newTime = time.time()
+ dt = (newTime-prevTime)*timeScale
+ t = t+dt
+ prevTime = newTime
+
+ amp=amplitude
+ motA_rf = math.sin(t)*amp+legpos
+ motA_rb = math.sin(t)*amp+legpos
+ motA_lf = -(math.sin(t)*amp+legpos)
+ motA_lb = -(math.sin(t)*amp+legpos)
+
+ motB_rf = math.sin(t)*amp+legpos
+ motB_rb = math.sin(t)*amp+legpos
+ motB_lf = -(math.sin(t)*amp+legpos)
+ motB_lb = -(math.sin(t)*amp+legpos)
+
+ p.setJointMotorControl2(vision,motor_front_rightR_joint,p.POSITION_CONTROL,targetPosition=motA_rf,force=maxMotorForce)
+ p.setJointMotorControl2(vision,motor_front_rightL_joint,p.POSITION_CONTROL,targetPosition=motB_rf,force=maxMotorForce)
+ p.setJointMotorControl2(vision,motor_front_rightS_joint,p.POSITION_CONTROL,targetPosition=motC_rf,force=maxMotorForce)
+
+
+ p.setJointMotorControl2(vision,motor_front_leftL_joint,p.POSITION_CONTROL,targetPosition=motA_lf,force=maxMotorForce)
+ p.setJointMotorControl2(vision,motor_front_leftR_joint,p.POSITION_CONTROL,targetPosition=motB_lf,force=maxMotorForce)
+ p.setJointMotorControl2(vision,motor_front_leftS_joint,p.POSITION_CONTROL,targetPosition=motC_lf,force=maxMotorForce)
+
+
+ p.setJointMotorControl2(vision,motor_back_rightR_joint,p.POSITION_CONTROL,targetPosition=motA_rb,force=maxMotorForce)
+ p.setJointMotorControl2(vision,motor_back_rightL_joint,p.POSITION_CONTROL,targetPosition=motB_rb,force=maxMotorForce)
+ p.setJointMotorControl2(vision,motor_back_rightS_joint,p.POSITION_CONTROL,targetPosition=motC_rb,force=maxMotorForce)
+
+
+ p.setJointMotorControl2(vision,motor_back_leftL_joint,p.POSITION_CONTROL,targetPosition=motA_lb,force=maxMotorForce)
+ p.setJointMotorControl2(vision,motor_back_leftR_joint,p.POSITION_CONTROL,targetPosition=motB_lb,force=maxMotorForce)
+ p.setJointMotorControl2(vision,motor_back_leftS_joint,p.POSITION_CONTROL,targetPosition=motC_lb,force=maxMotorForce)
+
+ p.setGravity(0,0,-10)
+ time.sleep(1./240.)
+
diff --git a/data/quadruped/vision/vision60.urdf b/data/quadruped/vision/vision60.urdf
new file mode 100644
index 000000000..cc66a5960
--- /dev/null
+++ b/data/quadruped/vision/vision60.urdf
@@ -0,0 +1,696 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/RobotSimulator/premake4.lua b/examples/RobotSimulator/premake4.lua
index da007c232..37eb9197f 100644
--- a/examples/RobotSimulator/premake4.lua
+++ b/examples/RobotSimulator/premake4.lua
@@ -275,8 +275,13 @@ if not _OPTIONS["no-enet"] then
if os.is("MacOSX") then
links{"Cocoa.framework"}
end
+
+
+ if os.is("Linux") then initX11()
+ links {"pthread"}
+ end
+
-
files {
"HelloBulletRobotics.cpp"
}
diff --git a/examples/SharedMemory/PhysicsClient.h b/examples/SharedMemory/PhysicsClient.h
index f73715f6d..6dd537fd6 100644
--- a/examples/SharedMemory/PhysicsClient.h
+++ b/examples/SharedMemory/PhysicsClient.h
@@ -43,8 +43,9 @@ public:
virtual void setSharedMemoryKey(int key) = 0;
virtual void uploadBulletFileToSharedMemory(const char* data, int len) = 0;
- virtual char* getSharedMemoryStreamBuffer() = 0;
-
+
+ virtual void uploadRaysToSharedMemory(struct SharedMemoryCommand& command, const double* rayFromWorldArray, const double* rayToWorldArray, int numRays) = 0;
+
virtual int getNumDebugLines() const = 0;
virtual const float* getDebugLinesFrom() const = 0;
@@ -78,6 +79,10 @@ public:
virtual int getCachedUserDataId(int bodyUniqueId, int linkIndex, const char *key) const = 0;
virtual int getNumUserData(int bodyUniqueId, int linkIndex) const = 0;
virtual void getUserDataInfo(int bodyUniqueId, int linkIndex, int userDataIndex, const char **keyOut, int *userDataIdOut) const = 0;
+
+ virtual void pushProfileTiming(const char* timingName)=0;
+ virtual void popProfileTiming()=0;
+
};
diff --git a/examples/SharedMemory/PhysicsClientC_API.cpp b/examples/SharedMemory/PhysicsClientC_API.cpp
index f92817396..ab28ab411 100644
--- a/examples/SharedMemory/PhysicsClientC_API.cpp
+++ b/examples/SharedMemory/PhysicsClientC_API.cpp
@@ -2443,8 +2443,16 @@ B3_SHARED_API int b3ChangeDynamicsInfoSetContactProcessingThreshold(b3SharedMemo
return 0;
}
-
-
+B3_SHARED_API int b3ChangeDynamicsInfoSetActivationState(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int activationState)
+{
+ struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle;
+ b3Assert(command->m_type == CMD_CHANGE_DYNAMICS_INFO);
+ command->m_changeDynamicsInfoArgs.m_bodyUniqueId = bodyUniqueId;
+ command->m_changeDynamicsInfoArgs.m_linkIndex = -1;
+ command->m_changeDynamicsInfoArgs.m_activationState = activationState;
+ command->m_updateFlags |= CHANGE_DYNAMICS_INFO_SET_ACTIVATION_STATE;
+ return 0;
+}
B3_SHARED_API b3SharedMemoryCommandHandle b3InitCreateUserConstraintCommand(b3PhysicsClientHandle physClient, int parentBodyUniqueId, int parentJointIndex, int childBodyUniqueId, int childJointIndex, struct b3JointInfo* info)
@@ -2728,16 +2736,13 @@ B3_SHARED_API b3SharedMemoryCommandHandle b3CreateRaycastCommandInit(b3PhysicsCl
struct SharedMemoryCommand *command = cl->getAvailableSharedMemoryCommand();
b3Assert(command);
command->m_type = CMD_REQUEST_RAY_CAST_INTERSECTIONS;
- command->m_requestRaycastIntersections.m_numRays = 1;
+ command->m_requestRaycastIntersections.m_numRays = 0;
command->m_requestRaycastIntersections.m_numThreads = 1;
- b3RayData* rayDataStream = (b3RayData *)cl->getSharedMemoryStreamBuffer();
- rayDataStream[0].m_rayFromPosition[0] = rayFromWorldX;
- rayDataStream[0].m_rayFromPosition[1] = rayFromWorldY;
- rayDataStream[0].m_rayFromPosition[2] = rayFromWorldZ;
- rayDataStream[0].m_rayToPosition[0] = rayToWorldX;
- rayDataStream[0].m_rayToPosition[1] = rayToWorldY;
- rayDataStream[0].m_rayToPosition[2] = rayToWorldZ;
-
+
+ double rayFrom[3] = {rayFromWorldX,rayFromWorldY,rayFromWorldZ};
+ double rayTo[3] = {rayToWorldX,rayToWorldY,rayToWorldZ};
+ cl->uploadRaysToSharedMemory(*command, rayFrom, rayTo, 1);
+
return (b3SharedMemoryCommandHandle)command;
}
@@ -2762,31 +2767,37 @@ B3_SHARED_API void b3RaycastBatchSetNumThreads(b3SharedMemoryCommandHandle comm
command->m_requestRaycastIntersections.m_numThreads = numThreads;
}
-B3_SHARED_API void b3RaycastBatchAddRay(b3SharedMemoryCommandHandle commandHandle, const double rayFromWorld[3], const double rayToWorld[3])
+B3_SHARED_API void b3RaycastBatchAddRay(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, const double rayFromWorld[3], const double rayToWorld[3])
{
+ PhysicsClient* cl = (PhysicsClient* ) physClient;
+ b3Assert(cl);
+
struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle;
b3Assert(command);
b3Assert(command->m_type == CMD_REQUEST_RAY_CAST_INTERSECTIONS);
- b3Assert(command->m_client)
- PhysicsClient *cl = command->m_client;
- b3Assert(cl);
+
if (command->m_type == CMD_REQUEST_RAY_CAST_INTERSECTIONS)
{
- int numRays = command->m_requestRaycastIntersections.m_numRays;
- if (numRaysgetSharedMemoryStreamBuffer();
- rayDataStream[numRays].m_rayFromPosition[0] = rayFromWorld[0];
- rayDataStream[numRays].m_rayFromPosition[1] = rayFromWorld[1];
- rayDataStream[numRays].m_rayFromPosition[2] = rayFromWorld[2];
- rayDataStream[numRays].m_rayToPosition[0] = rayToWorld[0];
- rayDataStream[numRays].m_rayToPosition[1] = rayToWorld[1];
- rayDataStream[numRays].m_rayToPosition[2] = rayToWorld[2];
- command->m_requestRaycastIntersections.m_numRays++;
- }
+ cl->uploadRaysToSharedMemory(*command, rayFromWorld, rayToWorld, 1);
}
}
+B3_SHARED_API void b3RaycastBatchAddRays(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, const double* rayFromWorldArray, const double* rayToWorldArray, int numRays)
+{
+ PhysicsClient* cl = (PhysicsClient* ) physClient;
+ b3Assert(cl);
+
+ struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle;
+ b3Assert(command);
+ b3Assert(command->m_type == CMD_REQUEST_RAY_CAST_INTERSECTIONS);
+ b3Assert(numRaysm_type == CMD_REQUEST_RAY_CAST_INTERSECTIONS)
+ {
+ cl->uploadRaysToSharedMemory(*command, rayFromWorldArray, rayToWorldArray, numRays);
+ }
+}
+
+
B3_SHARED_API void b3GetRaycastInformation(b3PhysicsClientHandle physClient, struct b3RaycastInformation* raycastInfo)
{
@@ -4430,6 +4441,21 @@ B3_SHARED_API b3SharedMemoryCommandHandle b3ProfileTimingCommandInit(b3PhysicsCl
return (b3SharedMemoryCommandHandle)command;
}
+B3_SHARED_API void b3PushProfileTiming(b3PhysicsClientHandle physClient, const char* timingName)
+{
+ PhysicsClient* cl = (PhysicsClient*)physClient;
+ b3Assert(cl);
+ cl->pushProfileTiming(timingName);
+}
+
+B3_SHARED_API void b3PopProfileTiming(b3PhysicsClientHandle physClient)
+{
+ PhysicsClient* cl = (PhysicsClient*)physClient;
+ b3Assert(cl);
+ cl->popProfileTiming();
+}
+
+
B3_SHARED_API void b3SetProfileTimingDuractionInMicroSeconds(b3SharedMemoryCommandHandle commandHandle, int duration)
{
struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle;
diff --git a/examples/SharedMemory/PhysicsClientC_API.h b/examples/SharedMemory/PhysicsClientC_API.h
index 380269833..6146a452e 100644
--- a/examples/SharedMemory/PhysicsClientC_API.h
+++ b/examples/SharedMemory/PhysicsClientC_API.h
@@ -142,6 +142,7 @@ B3_SHARED_API int b3ChangeDynamicsInfoSetContactStiffnessAndDamping(b3SharedMemo
B3_SHARED_API int b3ChangeDynamicsInfoSetFrictionAnchor(b3SharedMemoryCommandHandle commandHandle,int bodyUniqueId,int linkIndex, int frictionAnchor);
B3_SHARED_API int b3ChangeDynamicsInfoSetCcdSweptSphereRadius(b3SharedMemoryCommandHandle commandHandle,int bodyUniqueId,int linkIndex, double ccdSweptSphereRadius);
B3_SHARED_API int b3ChangeDynamicsInfoSetContactProcessingThreshold(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double contactProcessingThreshold);
+B3_SHARED_API int b3ChangeDynamicsInfoSetActivationState(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int activationState);
B3_SHARED_API b3SharedMemoryCommandHandle b3InitCreateUserConstraintCommand(b3PhysicsClientHandle physClient, int parentBodyUniqueId, int parentJointIndex, int childBodyUniqueId, int childJointIndex, struct b3JointInfo* info);
@@ -543,7 +544,8 @@ B3_SHARED_API b3SharedMemoryCommandHandle b3CreateRaycastCommandInit(b3PhysicsCl
B3_SHARED_API b3SharedMemoryCommandHandle b3CreateRaycastBatchCommandInit(b3PhysicsClientHandle physClient);
// Sets the number of threads to use to compute the ray intersections for the batch. Specify 0 to let Bullet decide, 1 (default) for single core execution, 2 or more to select the number of threads to use.
B3_SHARED_API void b3RaycastBatchSetNumThreads(b3SharedMemoryCommandHandle commandHandle, int numThreads);
-B3_SHARED_API void b3RaycastBatchAddRay(b3SharedMemoryCommandHandle commandHandle, const double rayFromWorld[/*3*/], const double rayToWorld[/*3*/]);
+B3_SHARED_API void b3RaycastBatchAddRay(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, const double rayFromWorld[3], const double rayToWorld[3]);
+B3_SHARED_API void b3RaycastBatchAddRays(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, const double* rayFromWorld, const double* rayToWorld, int numRays);
B3_SHARED_API void b3GetRaycastInformation(b3PhysicsClientHandle physClient, struct b3RaycastInformation* raycastInfo);
@@ -597,6 +599,9 @@ B3_SHARED_API int b3StateLoggingStop(b3SharedMemoryCommandHandle commandHandle,
B3_SHARED_API b3SharedMemoryCommandHandle b3ProfileTimingCommandInit(b3PhysicsClientHandle physClient, const char* name);
B3_SHARED_API void b3SetProfileTimingDuractionInMicroSeconds(b3SharedMemoryCommandHandle commandHandle, int duration);
+B3_SHARED_API void b3PushProfileTiming(b3PhysicsClientHandle physClient, const char* timingName);
+B3_SHARED_API void b3PopProfileTiming(b3PhysicsClientHandle physClient);
+
B3_SHARED_API void b3SetTimeOut(b3PhysicsClientHandle physClient, double timeOutInSeconds);
B3_SHARED_API double b3GetTimeOut(b3PhysicsClientHandle physClient);
diff --git a/examples/SharedMemory/PhysicsClientSharedMemory.cpp b/examples/SharedMemory/PhysicsClientSharedMemory.cpp
index 6913d1b15..131cc5d5f 100644
--- a/examples/SharedMemory/PhysicsClientSharedMemory.cpp
+++ b/examples/SharedMemory/PhysicsClientSharedMemory.cpp
@@ -12,7 +12,7 @@
#include "SharedMemoryBlock.h"
#include "BodyJointInfoUtility.h"
#include "SharedMemoryUserData.h"
-
+#include "LinearMath/btQuickprof.h"
struct UserDataCache
@@ -41,11 +41,16 @@ struct BodyJointInfoCache
}
};
+
+
struct PhysicsClientSharedMemoryInternalData {
SharedMemoryInterface* m_sharedMemory;
bool m_ownsSharedMemory;
SharedMemoryBlock* m_testBlock1;
+ btAlignedObjectArray m_profileTimings;
+ btHashMap m_profileTimingStringArray;
+
btHashMap m_bodyJointMap;
btHashMap m_userConstraintInfoMap;
@@ -216,6 +221,16 @@ PhysicsClientSharedMemory::~PhysicsClientSharedMemory() {
}
resetData();
+ for (int i=0;im_profileTimingStringArray.size();i++)
+ {
+ std::string** str = m_data->m_profileTimingStringArray.getAtIndex(i);
+ if (str)
+ {
+ delete *str;
+ }
+ }
+ m_data->m_profileTimingStringArray.clear();
+
if (m_data->m_ownsSharedMemory)
{
delete m_data->m_sharedMemory;
@@ -234,6 +249,8 @@ void PhysicsClientSharedMemory::removeCachedBody(int bodyUniqueId)
}
void PhysicsClientSharedMemory::resetData()
{
+
+
m_data->m_debugLinesFrom.clear();
m_data->m_debugLinesTo.clear();
m_data->m_debugLinesColor.clear();
@@ -950,6 +967,7 @@ const SharedMemoryStatus* PhysicsClientSharedMemory::processServerStatus() {
case CMD_REQUEST_RAY_CAST_INTERSECTIONS_COMPLETED:
{
+ B3_PROFILE("m_raycastHits");
if (m_data->m_verboseOutput)
{
b3Printf("Raycast completed");
@@ -1665,7 +1683,6 @@ bool PhysicsClientSharedMemory::canSubmitCommand() const {
struct SharedMemoryCommand* PhysicsClientSharedMemory::getAvailableSharedMemoryCommand() {
static int sequence = 0;
m_data->m_testBlock1->m_clientCommands[0].m_sequenceNumber = sequence++;
- m_data->m_testBlock1->m_clientCommands[0].m_client = this;
return &m_data->m_testBlock1->m_clientCommands[0];
}
@@ -1685,9 +1702,6 @@ bool PhysicsClientSharedMemory::submitClientCommand(const SharedMemoryCommand& c
return false;
}
-char* PhysicsClientSharedMemory::getSharedMemoryStreamBuffer() {
- return m_data->m_testBlock1->m_bulletStreamDataServerToClientRefactor;
-}
void PhysicsClientSharedMemory::uploadBulletFileToSharedMemory(const char* data, int len) {
btAssert(len < SHARED_MEMORY_MAX_STREAM_CHUNK_SIZE);
@@ -1703,6 +1717,31 @@ void PhysicsClientSharedMemory::uploadBulletFileToSharedMemory(const char* data,
}
}
+void PhysicsClientSharedMemory::uploadRaysToSharedMemory(struct SharedMemoryCommand& command, const double* rayFromWorldArray, const double* rayToWorldArray, int numRays)
+{
+ int curNumRays = command.m_requestRaycastIntersections.m_numRays;
+ int newNumRays = curNumRays + numRays;
+ btAssert(newNumRaysm_testBlock1->m_bulletStreamDataServerToClientRefactor;
+ rayDataStream[curNumRays+i].m_rayFromPosition[0] = rayFromWorldArray[i*3+0];
+ rayDataStream[curNumRays+i].m_rayFromPosition[1] = rayFromWorldArray[i*3+1];
+ rayDataStream[curNumRays+i].m_rayFromPosition[2] = rayFromWorldArray[i*3+2];
+ rayDataStream[curNumRays+i].m_rayToPosition[0] = rayToWorldArray[i*3+0];
+ rayDataStream[curNumRays+i].m_rayToPosition[1] = rayToWorldArray[i*3+1];
+ rayDataStream[curNumRays+i].m_rayToPosition[2] = rayToWorldArray[i*3+2];
+ command.m_requestRaycastIntersections.m_numRays++;
+ }
+
+ }
+}
+
+
+
void PhysicsClientSharedMemory::getCachedCameraImage(struct b3CameraImageData* cameraData)
{
cameraData->m_pixelWidth = m_data->m_cachedCameraPixelsWidth;
@@ -1882,3 +1921,34 @@ void PhysicsClientSharedMemory::getUserDataInfo(int bodyUniqueId, int linkIndex,
SharedMemoryUserData *userDataPtr = (userDataCachePtr)->m_userDataMap.getAtIndex(userDataIndex);
*keyOut = (userDataPtr)->m_key.c_str();
}
+
+
+
+
+
+void PhysicsClientSharedMemory::pushProfileTiming(const char* timingName)
+{
+ std::string** strPtr = m_data->m_profileTimingStringArray[timingName];
+ std::string* str = 0;
+ if (strPtr)
+ {
+ str = *strPtr;
+ } else
+ {
+ str = new std::string(timingName);
+ m_data->m_profileTimingStringArray.insert(timingName,str);
+ }
+ m_data->m_profileTimings.push_back(new CProfileSample(str->c_str()));
+}
+
+
+void PhysicsClientSharedMemory::popProfileTiming()
+{
+ if (m_data->m_profileTimings.size())
+ {
+ CProfileSample* sample = m_data->m_profileTimings[m_data->m_profileTimings.size()-1];
+ m_data->m_profileTimings.pop_back();
+ delete sample;
+ }
+}
+
diff --git a/examples/SharedMemory/PhysicsClientSharedMemory.h b/examples/SharedMemory/PhysicsClientSharedMemory.h
index dadb8acf6..10c1c63fb 100644
--- a/examples/SharedMemory/PhysicsClientSharedMemory.h
+++ b/examples/SharedMemory/PhysicsClientSharedMemory.h
@@ -54,7 +54,8 @@ public:
virtual void setSharedMemoryKey(int key);
virtual void uploadBulletFileToSharedMemory(const char* data, int len);
- virtual char* getSharedMemoryStreamBuffer();
+
+ virtual void uploadRaysToSharedMemory(struct SharedMemoryCommand& command, const double* rayFromWorldArray, const double* rayToWorldArray, int numRays);
virtual int getNumDebugLines() const;
@@ -89,6 +90,8 @@ public:
virtual int getNumUserData(int bodyUniqueId, int linkIndex) const;
virtual void getUserDataInfo(int bodyUniqueId, int linkIndex, int userDataIndex, const char **keyOut, int *userDataIdOut) const;
+ virtual void pushProfileTiming(const char* timingName);
+ virtual void popProfileTiming();
};
#endif // BT_PHYSICS_CLIENT_API_H
diff --git a/examples/SharedMemory/PhysicsDirect.cpp b/examples/SharedMemory/PhysicsDirect.cpp
index 5c8070687..24fb40a29 100644
--- a/examples/SharedMemory/PhysicsDirect.cpp
+++ b/examples/SharedMemory/PhysicsDirect.cpp
@@ -14,12 +14,15 @@
#include
#include "SharedMemoryUserData.h"
+#include "LinearMath/btQuickprof.h"
struct UserDataCache {
btHashMap m_userDataMap;
btHashMap m_keyToUserDataIdMap;
- ~UserDataCache() {
+ ~UserDataCache()
+ {
+
}
};
@@ -58,6 +61,9 @@ struct PhysicsDirectInternalData
btHashMap m_bodyJointMap;
btHashMap m_userConstraintInfoMap;
+ btAlignedObjectArray m_profileTimings;
+ btHashMap m_profileTimingStringArray;
+
char m_bulletStreamDataServerToClient[SHARED_MEMORY_MAX_STREAM_CHUNK_SIZE];
btAlignedObjectArray m_cachedMassMatrix;
int m_cachedCameraPixelsWidth;
@@ -106,11 +112,21 @@ PhysicsDirect::PhysicsDirect(PhysicsCommandProcessorInterface* physSdk, bool pas
m_data = new PhysicsDirectInternalData;
m_data->m_commandProcessor = physSdk;
m_data->m_ownsCommandProcessor = passSdkOwnership;
- m_data->m_command.m_client = this;
+
}
PhysicsDirect::~PhysicsDirect()
{
+ for (int i=0;im_profileTimingStringArray.size();i++)
+ {
+ std::string** str = m_data->m_profileTimingStringArray.getAtIndex(i);
+ if (str)
+ {
+ delete *str;
+ }
+ }
+ m_data->m_profileTimingStringArray.clear();
+
if (m_data->m_commandProcessor->isConnected())
{
m_data->m_commandProcessor->disconnect();
@@ -1318,16 +1334,11 @@ bool PhysicsDirect::getJointInfo(int bodyIndex, int jointIndex, struct b3JointIn
return false;
}
-///todo: move this out of the
+
void PhysicsDirect::setSharedMemoryKey(int key)
{
- //m_data->m_physicsServer->setSharedMemoryKey(key);
- //m_data->m_physicsClient->setSharedMemoryKey(key);
}
-char* PhysicsDirect::getSharedMemoryStreamBuffer() {
- return m_data->m_bulletStreamDataServerToClient;
-}
void PhysicsDirect::uploadBulletFileToSharedMemory(const char* data, int len)
{
@@ -1342,6 +1353,31 @@ void PhysicsDirect::uploadBulletFileToSharedMemory(const char* data, int len)
//m_data->m_physicsClient->uploadBulletFileToSharedMemory(data,len);
}
+void PhysicsDirect::uploadRaysToSharedMemory(struct SharedMemoryCommand& command, const double* rayFromWorldArray, const double* rayToWorldArray, int numRays)
+{
+ int curNumRays = command.m_requestRaycastIntersections.m_numRays;
+ int newNumRays = curNumRays + numRays;
+ btAssert(newNumRaysm_bulletStreamDataServerToClient;
+ rayDataStream[curNumRays+i].m_rayFromPosition[0] = rayFromWorldArray[i*3+0];
+ rayDataStream[curNumRays+i].m_rayFromPosition[1] = rayFromWorldArray[i*3+1];
+ rayDataStream[curNumRays+i].m_rayFromPosition[2] = rayFromWorldArray[i*3+2];
+ rayDataStream[curNumRays+i].m_rayToPosition[0] = rayToWorldArray[i*3+0];
+ rayDataStream[curNumRays+i].m_rayToPosition[1] = rayToWorldArray[i*3+1];
+ rayDataStream[curNumRays+i].m_rayToPosition[2] = rayToWorldArray[i*3+2];
+ command.m_requestRaycastIntersections.m_numRays++;
+ }
+
+ }
+
+}
+
+
int PhysicsDirect::getNumDebugLines() const
{
return m_data->m_debugLinesFrom.size();
@@ -1530,3 +1566,31 @@ void PhysicsDirect::getUserDataInfo(int bodyUniqueId, int linkIndex, int userDat
SharedMemoryUserData* userDataPtr = (userDataCachePtr)->m_userDataMap.getAtIndex(userDataIndex);
*keyOut = (userDataPtr)->m_key.c_str();
}
+
+
+
+void PhysicsDirect::pushProfileTiming(const char* timingName)
+{
+ std::string** strPtr = m_data->m_profileTimingStringArray[timingName];
+ std::string* str = 0;
+ if (strPtr)
+ {
+ str = *strPtr;
+ } else
+ {
+ str = new std::string(timingName);
+ m_data->m_profileTimingStringArray.insert(timingName,str);
+ }
+ m_data->m_profileTimings.push_back(new CProfileSample(str->c_str()));
+}
+
+
+void PhysicsDirect::popProfileTiming()
+{
+ if (m_data->m_profileTimings.size())
+ {
+ CProfileSample* sample = m_data->m_profileTimings[m_data->m_profileTimings.size()-1];
+ m_data->m_profileTimings.pop_back();
+ delete sample;
+ }
+}
diff --git a/examples/SharedMemory/PhysicsDirect.h b/examples/SharedMemory/PhysicsDirect.h
index 299312199..2b4a9d634 100644
--- a/examples/SharedMemory/PhysicsDirect.h
+++ b/examples/SharedMemory/PhysicsDirect.h
@@ -78,7 +78,8 @@ public:
virtual void setSharedMemoryKey(int key);
void uploadBulletFileToSharedMemory(const char* data, int len);
- virtual char* getSharedMemoryStreamBuffer();
+
+ virtual void uploadRaysToSharedMemory(struct SharedMemoryCommand& command, const double* rayFromWorldArray, const double* rayToWorldArray, int numRays);
virtual int getNumDebugLines() const;
@@ -118,6 +119,9 @@ public:
virtual int getCachedUserDataId(int bodyUniqueId, int linkIndex, const char *key) const;
virtual int getNumUserData(int bodyUniqueId, int linkIndex) const;
virtual void getUserDataInfo(int bodyUniqueId, int linkIndex, int userDataIndex, const char **keyOut, int *userDataIdOut) const;
+
+ virtual void pushProfileTiming(const char* timingName);
+ virtual void popProfileTiming();
};
#endif //PHYSICS_DIRECT_H
diff --git a/examples/SharedMemory/PhysicsLoopBack.cpp b/examples/SharedMemory/PhysicsLoopBack.cpp
index cff52a534..4a4b00d70 100644
--- a/examples/SharedMemory/PhysicsLoopBack.cpp
+++ b/examples/SharedMemory/PhysicsLoopBack.cpp
@@ -140,15 +140,17 @@ void PhysicsLoopBack::setSharedMemoryKey(int key)
m_data->m_physicsClient->setSharedMemoryKey(key);
}
-char* PhysicsLoopBack::getSharedMemoryStreamBuffer() {
- return m_data->m_physicsClient->getSharedMemoryStreamBuffer();
-}
void PhysicsLoopBack::uploadBulletFileToSharedMemory(const char* data, int len)
{
m_data->m_physicsClient->uploadBulletFileToSharedMemory(data,len);
}
+void PhysicsLoopBack::uploadRaysToSharedMemory(struct SharedMemoryCommand& command, const double* rayFromWorldArray, const double* rayToWorldArray, int numRays)
+{
+ m_data->m_physicsClient->uploadRaysToSharedMemory(command, rayFromWorldArray, rayToWorldArray, numRays);
+}
+
int PhysicsLoopBack::getNumDebugLines() const
{
return m_data->m_physicsClient->getNumDebugLines();
@@ -245,3 +247,11 @@ void PhysicsLoopBack::getUserDataInfo(int bodyUniqueId, int linkIndex, int userD
m_data->m_physicsClient->getUserDataInfo(bodyUniqueId, linkIndex, userDataIndex, keyOut, userDataIdOut);
}
+void PhysicsLoopBack::pushProfileTiming(const char* timingName)
+{
+ m_data->m_physicsClient->pushProfileTiming(timingName);
+}
+void PhysicsLoopBack::popProfileTiming()
+{
+ m_data->m_physicsClient->popProfileTiming();
+}
\ No newline at end of file
diff --git a/examples/SharedMemory/PhysicsLoopBack.h b/examples/SharedMemory/PhysicsLoopBack.h
index 512ddf7ba..e18fa22f8 100644
--- a/examples/SharedMemory/PhysicsLoopBack.h
+++ b/examples/SharedMemory/PhysicsLoopBack.h
@@ -58,7 +58,8 @@ public:
virtual void setSharedMemoryKey(int key);
void uploadBulletFileToSharedMemory(const char* data, int len);
- virtual char* getSharedMemoryStreamBuffer();
+
+ virtual void uploadRaysToSharedMemory(struct SharedMemoryCommand& command, const double* rayFromWorldArray, const double* rayToWorldArray, int numRays);
virtual int getNumDebugLines() const;
@@ -92,6 +93,9 @@ public:
virtual int getCachedUserDataId(int bodyUniqueId, int linkIndex, const char *key) const;
virtual int getNumUserData(int bodyUniqueId, int linkIndex) const;
virtual void getUserDataInfo(int bodyUniqueId, int linkIndex, int userDataIndex, const char **keyOut, int *userDataIdOut) const;
+
+ virtual void pushProfileTiming(const char* timingName);
+ virtual void popProfileTiming();
};
#endif //PHYSICS_LOOP_BACK_H
diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp
index 4afd8031b..0f27342b8 100644
--- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp
+++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp
@@ -1659,6 +1659,8 @@ struct PhysicsServerCommandProcessorInternalData
b3HashMap m_profileEvents;
b3HashMap m_cachedVUrdfisualShapes;
+ btITaskScheduler* m_scheduler;
+
PhysicsServerCommandProcessorInternalData(PhysicsCommandProcessorInterface* proc)
:m_pluginManager(proc),
m_useRealTimeSimulation(false),
@@ -1686,7 +1688,8 @@ struct PhysicsServerCommandProcessorInternalData
m_pickedBody(0),
m_pickedConstraint(0),
m_pickingMultiBodyPoint2Point(0),
- m_pdControlPlugin(-1)
+ m_pdControlPlugin(-1),
+ m_scheduler(0)
{
{
@@ -1780,13 +1783,15 @@ PhysicsServerCommandProcessor::PhysicsServerCommandProcessor()
createEmptyDynamicsWorld();
+#ifdef BT_THREADSAFE
if (btGetTaskScheduler() == 0) {
- btITaskScheduler *scheduler = btCreateDefaultTaskScheduler();
- if (scheduler == 0) {
- scheduler = btGetSequentialTaskScheduler();
+ m_data->m_scheduler = btCreateDefaultTaskScheduler();
+ if (m_data->m_scheduler == 0) {
+ m_data->m_scheduler = btGetSequentialTaskScheduler();
}
- btSetTaskScheduler(scheduler);
+ btSetTaskScheduler(m_data->m_scheduler);
}
+#endif //BT_THREADSAFE
}
PhysicsServerCommandProcessor::~PhysicsServerCommandProcessor()
@@ -1802,6 +1807,9 @@ PhysicsServerCommandProcessor::~PhysicsServerCommandProcessor()
char* event = *m_data->m_profileEvents.getAtIndex(i);
delete[] event;
}
+ if (m_data->m_scheduler)
+ delete m_data->m_scheduler;
+
delete m_data;
}
@@ -4821,10 +4829,11 @@ bool PhysicsServerCommandProcessor::processRequestRaycastIntersectionsCommand(co
const int numRays = clientCmd.m_requestRaycastIntersections.m_numRays;
const int numThreads = clientCmd.m_requestRaycastIntersections.m_numThreads;
- b3RayData *rayInputBuffer = (b3RayData *)malloc(sizeof(b3RayData) * numRays);
- memcpy(rayInputBuffer, bufferServerToClient, sizeof(b3RayData) * numRays);
-
- BatchRayCaster batchRayCaster(m_data->m_dynamicsWorld, rayInputBuffer, (b3RayHitInfo *)bufferServerToClient, numRays);
+ btAlignedObjectArray rays;
+ rays.resize(numRays);
+ memcpy(&rays[0],bufferServerToClient,numRays*sizeof(b3RayData));
+
+ BatchRayCaster batchRayCaster(m_data->m_dynamicsWorld, &rays[0], (b3RayHitInfo *)bufferServerToClient, numRays);
if (numThreads == 0) {
// When 0 is specified, Bullet can decide how many threads to use.
// About 16 rays per thread seems to work reasonably well.
@@ -4840,7 +4849,6 @@ bool PhysicsServerCommandProcessor::processRequestRaycastIntersectionsCommand(co
batchRayCaster.castRays(numThreads);
}
- free(rayInputBuffer);
serverStatusOut.m_raycastHits.m_numRaycastHits = numRays;
serverStatusOut.m_type = CMD_REQUEST_RAY_CAST_INTERSECTIONS_COMPLETED;
return hasStatus;
@@ -6747,6 +6755,26 @@ bool PhysicsServerCommandProcessor::processChangeDynamicsInfoCommand(const struc
{
btMultiBody* mb = body->m_multiBody;
+ if (clientCmd.m_updateFlags & CHANGE_DYNAMICS_INFO_SET_ACTIVATION_STATE)
+ {
+ if (clientCmd.m_changeDynamicsInfoArgs.m_activationState&eActivationStateWakeUp)
+ {
+ mb->wakeUp();
+ }
+ if (clientCmd.m_changeDynamicsInfoArgs.m_activationState&eActivationStateSleep)
+ {
+ mb->goToSleep();
+ }
+ if (clientCmd.m_changeDynamicsInfoArgs.m_activationState&eActivationStateEnableSleeping)
+ {
+ mb->setCanSleep(true);
+ }
+ if (clientCmd.m_changeDynamicsInfoArgs.m_activationState&eActivationStateDisableSleeping)
+ {
+ mb->setCanSleep(false);
+ }
+ }
+
if (clientCmd.m_updateFlags & CHANGE_DYNAMICS_INFO_SET_LINEAR_DAMPING)
{
mb->setLinearDamping(clientCmd.m_changeDynamicsInfoArgs.m_linearDamping);
@@ -6872,6 +6900,27 @@ bool PhysicsServerCommandProcessor::processChangeDynamicsInfoCommand(const struc
{
if (body && body->m_rigidBody)
{
+ if (clientCmd.m_updateFlags & CHANGE_DYNAMICS_INFO_SET_ACTIVATION_STATE)
+ {
+ if (clientCmd.m_changeDynamicsInfoArgs.m_activationState&eActivationStateEnableSleeping)
+ {
+ body->m_rigidBody->forceActivationState(ACTIVE_TAG);
+ }
+ if (clientCmd.m_changeDynamicsInfoArgs.m_activationState&eActivationStateDisableSleeping)
+ {
+ body->m_rigidBody->forceActivationState(DISABLE_DEACTIVATION);
+ }
+ if (clientCmd.m_changeDynamicsInfoArgs.m_activationState&eActivationStateWakeUp)
+ {
+ body->m_rigidBody->forceActivationState(ACTIVE_TAG);
+ }
+ if (clientCmd.m_changeDynamicsInfoArgs.m_activationState&eActivationStateSleep)
+ {
+ body->m_rigidBody->forceActivationState(ISLAND_SLEEPING);
+ }
+ }
+
+
if (clientCmd.m_updateFlags & CHANGE_DYNAMICS_INFO_SET_LINEAR_DAMPING)
{
btScalar angDamping = body->m_rigidBody->getAngularDamping();
diff --git a/examples/SharedMemory/SharedMemoryCommands.h b/examples/SharedMemory/SharedMemoryCommands.h
index 56d79a396..6df03e6f4 100644
--- a/examples/SharedMemory/SharedMemoryCommands.h
+++ b/examples/SharedMemory/SharedMemoryCommands.h
@@ -23,6 +23,12 @@
typedef unsigned long long int smUint64_t;
#endif
+#ifdef __APPLE__
+ #define SHARED_MEMORY_MAX_STREAM_CHUNK_SIZE (512*1024)
+#else
+ #define SHARED_MEMORY_MAX_STREAM_CHUNK_SIZE (8*1024*1024)
+#endif
+
#define SHARED_MEMORY_SERVER_TEST_C
#define MAX_DEGREE_OF_FREEDOM 128
#define MAX_NUM_SENSORS 256
@@ -161,6 +167,7 @@ enum EnumChangeDynamicsInfoFlags
CHANGE_DYNAMICS_INFO_SET_LOCAL_INERTIA_DIAGONAL = 1024,
CHANGE_DYNAMICS_INFO_SET_CCD_SWEPT_SPHERE_RADIUS = 2048,
CHANGE_DYNAMICS_INFO_SET_CONTACT_PROCESSING_THRESHOLD = 4096,
+ CHANGE_DYNAMICS_INFO_SET_ACTIVATION_STATE = 8192,
};
struct ChangeDynamicsInfoArgs
@@ -181,6 +188,7 @@ struct ChangeDynamicsInfoArgs
int m_frictionAnchor;
double m_ccdSweptSphereRadius;
double m_contactProcessingThreshold;
+ int m_activationState;
};
struct GetDynamicsInfoArgs
@@ -1009,7 +1017,7 @@ struct SharedMemoryCommand
int m_type;
smUint64_t m_timeStamp;
int m_sequenceNumber;
- struct PhysicsClient *m_client;
+
//m_updateFlags is a bit fields to tell which parameters need updating
//for example m_updateFlags = SIM_PARAM_UPDATE_DELTA_TIME | SIM_PARAM_UPDATE_NUM_SOLVER_ITERATIONS;
diff --git a/examples/SharedMemory/SharedMemoryPublic.h b/examples/SharedMemory/SharedMemoryPublic.h
index a6f60ab41..f6467fb38 100644
--- a/examples/SharedMemory/SharedMemoryPublic.h
+++ b/examples/SharedMemory/SharedMemoryPublic.h
@@ -4,8 +4,11 @@
#define SHARED_MEMORY_KEY 12347
///increase the SHARED_MEMORY_MAGIC_NUMBER whenever incompatible changes are made in the structures
///my convention is year/month/day/rev
+//Please don't replace an existing magic number:
+//instead, only ADD a new one at the top, comment-out previous one
#define SHARED_MEMORY_MAGIC_NUMBER 201806150
+//#define SHARED_MEMORY_MAGIC_NUMBER 201806020
//#define SHARED_MEMORY_MAGIC_NUMBER 201801170
//#define SHARED_MEMORY_MAGIC_NUMBER 201801080
//#define SHARED_MEMORY_MAGIC_NUMBER 201801010
@@ -17,11 +20,7 @@
//#define SHARED_MEMORY_MAGIC_NUMBER 201706001
//#define SHARED_MEMORY_MAGIC_NUMBER 201703024
-#ifdef __APPLE__
- #define SHARED_MEMORY_MAX_STREAM_CHUNK_SIZE (512*1024)
-#else
- #define SHARED_MEMORY_MAX_STREAM_CHUNK_SIZE (8*1024*1024)
-#endif
+
enum EnumSharedMemoryClientCommand
{
@@ -319,6 +318,15 @@ struct b3BodyInfo
char m_bodyName[1024]; // for btRigidBody, it does not have a base, but can still have a body name from urdf
};
+
+enum DynamicsActivationState
+{
+ eActivationStateEnableSleeping = 1,
+ eActivationStateDisableSleeping = 2,
+ eActivationStateWakeUp = 4,
+ eActivationStateSleep = 8,
+};
+
struct b3DynamicsInfo
{
double m_mass;
@@ -539,6 +547,7 @@ enum b3StateLoggingType
STATE_LOGGING_PROFILE_TIMINGS = 6,
STATE_LOGGING_ALL_COMMANDS=7,
STATE_REPLAY_ALL_COMMANDS=8,
+ STATE_LOGGING_CUSTOM_TIMER=9,
};
@@ -573,7 +582,7 @@ typedef union {
struct b3RayData a;
struct b3RayHitInfo b;
} RAY_DATA_UNION;
-#define MAX_RAY_INTERSECTION_BATCH_SIZE SHARED_MEMORY_MAX_STREAM_CHUNK_SIZE / sizeof( RAY_DATA_UNION )
+#define MAX_RAY_INTERSECTION_BATCH_SIZE 16*1024
#define MAX_RAY_HITS MAX_RAY_INTERSECTION_BATCH_SIZE
#define VISUAL_SHAPE_MAX_PATH_LEN 1024
diff --git a/examples/pybullet/examples/batchRayCast.py b/examples/pybullet/examples/batchRayCast.py
new file mode 100644
index 000000000..f25cf4cff
--- /dev/null
+++ b/examples/pybullet/examples/batchRayCast.py
@@ -0,0 +1,63 @@
+import pybullet as p
+import time
+import math
+
+useGui = True
+
+if (useGui):
+ p.connect(p.GUI)
+else:
+ p.connect(p.DIRECT)
+
+#p.configureDebugVisualizer(p.COV_ENABLE_RENDERING,0)
+
+p.loadURDF("samurai.urdf")
+p.loadURDF("r2d2.urdf",[3,3,1])
+
+
+rayFrom=[]
+rayTo=[]
+
+numRays = 1024
+rayLen = 13
+
+
+for i in range (numRays):
+ rayFrom.append([0,0,1])
+ rayTo.append([rayLen*math.sin(2.*math.pi*float(i)/numRays), rayLen*math.cos(2.*math.pi*float(i)/numRays),1])
+
+if (not useGui):
+ timingLog = p.startStateLogging(p.STATE_LOGGING_PROFILE_TIMINGS,"rayCastBench.json")
+
+numSteps = 10
+if (useGui):
+ numSteps = 327680
+
+for i in range (numSteps):
+ p.stepSimulation()
+ for j in range (8):
+ results = p.rayTestBatch(rayFrom,rayTo,j+1)
+
+ for i in range (10):
+ p.removeAllUserDebugItems()
+
+
+
+ rayHitColor = [1,0,0]
+ rayMissColor = [0,1,0]
+ if (useGui):
+ p.removeAllUserDebugItems()
+ for i in range (numRays):
+ hitObjectUid=results[i][0]
+
+
+ if (hitObjectUid<0):
+ p.addUserDebugLine(rayFrom[i],rayTo[i], rayMissColor)
+ else:
+ hitPosition = results[i][3]
+ p.addUserDebugLine(rayFrom[i],hitPosition, rayHitColor)
+
+ #time.sleep(1./240.)
+
+if (not useGui):
+ p.stopStateLogging(timingLog)
\ No newline at end of file
diff --git a/examples/pybullet/examples/manyspheres.py b/examples/pybullet/examples/manyspheres.py
index 942bd02a7..f6f435f9a 100644
--- a/examples/pybullet/examples/manyspheres.py
+++ b/examples/pybullet/examples/manyspheres.py
@@ -16,11 +16,15 @@ gravYid = p.addUserDebugParameter("gravityY",-10,10,0)
gravZid = p.addUserDebugParameter("gravityZ",-10,10,-10)
p.setPhysicsEngineParameter(numSolverIterations=10)
p.setPhysicsEngineParameter(contactBreakingThreshold=0.001)
+p.configureDebugVisualizer(p.COV_ENABLE_RENDERING,0)
for i in range (10):
for j in range (10):
for k in range (10):
ob = p.loadURDF("sphere_1cm.urdf",[0.02*i,0.02*j,0.2+0.02*k],useMaximalCoordinates=True)
+
+p.configureDebugVisualizer(p.COV_ENABLE_RENDERING,1)
p.setGravity(0,0,-10)
+
p.setRealTimeSimulation(1)
while True:
gravX = p.readUserDebugParameter(gravXid)
diff --git a/examples/pybullet/examples/saveRestoreState.py b/examples/pybullet/examples/saveRestoreState.py
index b0f53ac28..3f8736c04 100644
--- a/examples/pybullet/examples/saveRestoreState.py
+++ b/examples/pybullet/examples/saveRestoreState.py
@@ -12,6 +12,7 @@ logId = p.startStateLogging(p.STATE_LOGGING_PROFILE_TIMINGS, "saveRestoreTimings
def setupWorld():
p.resetSimulation()
+ p.setPhysicsEngineParameter(deterministicOverlappingPairs=1)
p.loadURDF("planeMesh.urdf")
kukaId = p.loadURDF("kuka_iiwa/model_free_base.urdf",[0,0,10])
for i in range (p.getNumJoints(kukaId)):
diff --git a/examples/pybullet/examples/sleeping.py b/examples/pybullet/examples/sleeping.py
index dbd0d0ec3..ab5c2ba57 100644
--- a/examples/pybullet/examples/sleeping.py
+++ b/examples/pybullet/examples/sleeping.py
@@ -9,12 +9,18 @@ p.configureDebugVisualizer(p.COV_ENABLE_RENDERING,0)
p.loadURDF("plane100.urdf",flags=flags, useMaximalCoordinates=useMaximalCoordinates)
#p.loadURDF("cube_small.urdf", [0,0,0.5], flags=flags)
+r2d2 = -1
for k in range (5):
for i in range (5):
r2d2=p.loadURDF("r2d2.urdf",[k*2,i*2,1], useMaximalCoordinates=useMaximalCoordinates, flags=p.URDF_ENABLE_CACHED_GRAPHICS_SHAPES+flags)
+
+ #enable sleeping: you can pass the flag during URDF loading, or do it afterwards
+ #p.changeDynamics(r2d2,-1,activationState=p.ACTIVATION_STATE_ENABLE_SLEEPING)
+
+
for j in range (p.getNumJoints(r2d2)):
p.setJointMotorControl2(r2d2,j,p.VELOCITY_CONTROL,targetVelocity=0)
-
+print("r2d2=",r2d2)
p.configureDebugVisualizer(p.COV_ENABLE_RENDERING,1)
timestep = 1./240.
p.setTimeStep(timestep)
@@ -23,3 +29,6 @@ p.setGravity(0,0,-10)
while p.isConnected():
p.stepSimulation()
time.sleep(timestep)
+ #force the object to wake up
+ p.changeDynamics(r2d2,-1,activationState=p.ACTIVATION_STATE_WAKE_UP)
+
\ No newline at end of file
diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c
index cd3ef640e..72a730982 100644
--- a/examples/pybullet/pybullet.c
+++ b/examples/pybullet/pybullet.c
@@ -1183,14 +1183,15 @@ static PyObject* pybullet_changeDynamicsInfo(PyObject* self, PyObject* args, PyO
double ccdSweptSphereRadius=-1;
int frictionAnchor = -1;
double contactProcessingThreshold = -1;
+ int activationState = -1;
PyObject* localInertiaDiagonalObj=0;
b3PhysicsClientHandle sm = 0;
int physicsClientId = 0;
- static char* kwlist[] = {"bodyUniqueId", "linkIndex", "mass", "lateralFriction", "spinningFriction", "rollingFriction","restitution", "linearDamping", "angularDamping", "contactStiffness", "contactDamping", "frictionAnchor", "localInertiaDiagonal", "ccdSweptSphereRadius", "contactProcessingThreshold", "physicsClientId", NULL};
- if (!PyArg_ParseTupleAndKeywords(args, keywds, "ii|dddddddddiOddi", kwlist, &bodyUniqueId, &linkIndex,&mass, &lateralFriction, &spinningFriction, &rollingFriction, &restitution,&linearDamping, &angularDamping, &contactStiffness, &contactDamping, &frictionAnchor, &localInertiaDiagonalObj, &ccdSweptSphereRadius, &contactProcessingThreshold, &physicsClientId))
+ static char* kwlist[] = {"bodyUniqueId", "linkIndex", "mass", "lateralFriction", "spinningFriction", "rollingFriction","restitution", "linearDamping", "angularDamping", "contactStiffness", "contactDamping", "frictionAnchor", "localInertiaDiagonal", "ccdSweptSphereRadius", "contactProcessingThreshold", "activationState", "physicsClientId", NULL};
+ if (!PyArg_ParseTupleAndKeywords(args, keywds, "ii|dddddddddiOddii", kwlist, &bodyUniqueId, &linkIndex,&mass, &lateralFriction, &spinningFriction, &rollingFriction, &restitution,&linearDamping, &angularDamping, &contactStiffness, &contactDamping, &frictionAnchor, &localInertiaDiagonalObj, &ccdSweptSphereRadius, &contactProcessingThreshold,&activationState, &physicsClientId))
{
return NULL;
}
@@ -1260,6 +1261,10 @@ static PyObject* pybullet_changeDynamicsInfo(PyObject* self, PyObject* args, PyO
{
b3ChangeDynamicsInfoSetCcdSweptSphereRadius(command,bodyUniqueId,linkIndex, ccdSweptSphereRadius);
}
+ if (activationState >= 0)
+ {
+ b3ChangeDynamicsInfoSetActivationState(command, bodyUniqueId, activationState);
+ }
if (contactProcessingThreshold >= 0)
{
b3ChangeDynamicsInfoSetContactProcessingThreshold(command, bodyUniqueId, linkIndex, contactProcessingThreshold);
@@ -4701,6 +4706,7 @@ static PyObject* pybullet_rayTestBatch(PyObject* self, PyObject* args, PyObject*
}
+
commandHandle = b3CreateRaycastBatchCommandInit(sm);
b3RaycastBatchSetNumThreads(commandHandle, numThreads);
@@ -4723,7 +4729,7 @@ static PyObject* pybullet_rayTestBatch(PyObject* self, PyObject* args, PyObject*
} else
{
int i;
-
+
if (lenFrom > MAX_RAY_INTERSECTION_BATCH_SIZE)
{
PyErr_SetString(SpamError, "Number of rays exceed the maximum batch size.");
@@ -4731,6 +4737,7 @@ static PyObject* pybullet_rayTestBatch(PyObject* self, PyObject* args, PyObject*
Py_DECREF(seqRayToObj);
return NULL;
}
+ b3PushProfileTiming(sm, "extractPythonFromToSequenceToC");
for (i = 0; i < lenFrom; i++)
{
PyObject* rayFromObj = PySequence_GetItem(rayFromObjList,i);
@@ -4741,7 +4748,7 @@ static PyObject* pybullet_rayTestBatch(PyObject* self, PyObject* args, PyObject*
if ((pybullet_internalSetVectord(rayFromObj, rayFromWorld)) &&
(pybullet_internalSetVectord(rayToObj, rayToWorld)))
{
- b3RaycastBatchAddRay(commandHandle, rayFromWorld, rayToWorld);
+ b3RaycastBatchAddRay(sm, commandHandle, rayFromWorld, rayToWorld);
} else
{
PyErr_SetString(SpamError, "Items in the from/to positions need to be an [x,y,z] list of 3 floats/doubles");
@@ -4749,11 +4756,13 @@ static PyObject* pybullet_rayTestBatch(PyObject* self, PyObject* args, PyObject*
Py_DECREF(seqRayToObj);
Py_DECREF(rayFromObj);
Py_DECREF(rayToObj);
+ b3PopProfileTiming(sm);
return NULL;
}
Py_DECREF(rayFromObj);
Py_DECREF(rayToObj);
}
+ b3PopProfileTiming(sm);
}
} else
{
@@ -4776,8 +4785,9 @@ static PyObject* pybullet_rayTestBatch(PyObject* self, PyObject* args, PyObject*
struct b3RaycastInformation raycastInfo;
PyObject* rayHitsObj = 0;
int i;
+ b3PushProfileTiming(sm, "convertRaycastInformationToPython");
b3GetRaycastInformation(sm, &raycastInfo);
-
+
rayHitsObj = PyTuple_New(raycastInfo.m_numRayHits);
for (i = 0; i < raycastInfo.m_numRayHits; i++)
{
@@ -4816,6 +4826,7 @@ static PyObject* pybullet_rayTestBatch(PyObject* self, PyObject* args, PyObject*
}
PyTuple_SetItem(rayHitsObj, i, singleHitObj);
}
+ b3PopProfileTiming(sm);
return rayHitsObj;
}
@@ -9586,6 +9597,7 @@ initpybullet(void)
PyModule_AddIntConstant(m, "STATE_LOGGING_PROFILE_TIMINGS", STATE_LOGGING_PROFILE_TIMINGS);
PyModule_AddIntConstant(m, "STATE_LOGGING_ALL_COMMANDS", STATE_LOGGING_ALL_COMMANDS);
PyModule_AddIntConstant(m, "STATE_REPLAY_ALL_COMMANDS", STATE_REPLAY_ALL_COMMANDS);
+ PyModule_AddIntConstant(m, "STATE_LOGGING_CUSTOM_TIMER", STATE_LOGGING_CUSTOM_TIMER);
PyModule_AddIntConstant(m, "COV_ENABLE_GUI", COV_ENABLE_GUI);
PyModule_AddIntConstant(m, "COV_ENABLE_SHADOWS", COV_ENABLE_SHADOWS);
@@ -9625,7 +9637,11 @@ initpybullet(void)
PyModule_AddIntConstant(m, "URDF_ENABLE_CACHED_GRAPHICS_SHAPES", URDF_ENABLE_CACHED_GRAPHICS_SHAPES);
PyModule_AddIntConstant(m, "URDF_ENABLE_SLEEPING", URDF_ENABLE_SLEEPING);
PyModule_AddIntConstant(m, "URDF_INITIALIZE_SAT_FEATURES", URDF_INITIALIZE_SAT_FEATURES);
-
+
+ PyModule_AddIntConstant(m, "ACTIVATION_STATE_ENABLE_SLEEPING", eActivationStateEnableSleeping);
+ PyModule_AddIntConstant(m, "ACTIVATION_STATE_DISABLE_SLEEPING", eActivationStateDisableSleeping);
+ PyModule_AddIntConstant(m, "ACTIVATION_STATE_WAKE_UP", eActivationStateWakeUp);
+ PyModule_AddIntConstant(m, "ACTIVATION_STATE_SLEEP", eActivationStateSleep);
PyModule_AddIntConstant(m, "URDF_USE_SELF_COLLISION", URDF_USE_SELF_COLLISION);
PyModule_AddIntConstant(m, "URDF_USE_SELF_COLLISION_EXCLUDE_PARENT", URDF_USE_SELF_COLLISION_EXCLUDE_PARENT);
diff --git a/setup.py b/setup.py
index 5aa4b009c..e54f0e9f0 100644
--- a/setup.py
+++ b/setup.py
@@ -452,7 +452,7 @@ print("-----")
setup(
name = 'pybullet',
- version='2.0.5',
+ version='2.0.7',
description='Official Python Interface for the Bullet Physics SDK specialized for Robotics Simulation and Reinforcement Learning',
long_description='pybullet is an easy to use Python module for physics simulation, robotics and deep reinforcement learning based on the Bullet Physics SDK. With pybullet you can load articulated bodies from URDF, SDF and other file formats. pybullet provides forward dynamics simulation, inverse dynamics computation, forward and inverse kinematics and collision detection and ray intersection queries. Aside from physics simulation, pybullet supports to rendering, with a CPU renderer and OpenGL visualization and support for virtual reality headsets.',
url='https://github.com/bulletphysics/bullet3',
diff --git a/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp b/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp
index 9ef7e89d8..1282ea96a 100644
--- a/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp
+++ b/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp
@@ -21,6 +21,7 @@ subject to the following restrictions:
#include "btSequentialImpulseConstraintSolver.h"
#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
+
#include "LinearMath/btIDebugDraw.h"
#include "LinearMath/btCpuFeatureUtility.h"
@@ -780,8 +781,13 @@ int btSequentialImpulseConstraintSolver::getOrInitSolverBody(btCollisionObject&
}
else
{
+ bool isMultiBodyType = (body.getInternalType()&btCollisionObject::CO_FEATHERSTONE_LINK);
// Incorrectly set collision object flags can degrade performance in various ways.
- btAssert( body.isStaticOrKinematicObject() );
+ if (!isMultiBodyType)
+ {
+ btAssert( body.isStaticOrKinematicObject() );
+ }
+ //it could be a multibody link collider
// all fixed bodies (inf mass) get mapped to a single solver id
if ( m_fixedBodyId < 0 )
{
diff --git a/src/BulletDynamics/Featherstone/btMultiBody.cpp b/src/BulletDynamics/Featherstone/btMultiBody.cpp
index 7b30dd12a..0493cdb02 100644
--- a/src/BulletDynamics/Featherstone/btMultiBody.cpp
+++ b/src/BulletDynamics/Featherstone/btMultiBody.cpp
@@ -1847,6 +1847,7 @@ void btMultiBody::fillConstraintJacobianMultiDof(int link,
void btMultiBody::wakeUp()
{
+ m_sleepTimer = 0;
m_awake = true;
}
diff --git a/src/LinearMath/TaskScheduler/btTaskScheduler.cpp b/src/LinearMath/TaskScheduler/btTaskScheduler.cpp
index 02fe07ab1..49510d166 100644
--- a/src/LinearMath/TaskScheduler/btTaskScheduler.cpp
+++ b/src/LinearMath/TaskScheduler/btTaskScheduler.cpp
@@ -209,13 +209,19 @@ public:
}
~JobQueue()
{
- freeJobMem();
+ exit();
+ }
+ void exit()
+ {
+ freeJobMem();
if (m_queueLock && m_threadSupport)
{
m_threadSupport->deleteCriticalSection(m_queueLock);
m_queueLock = NULL;
+ m_threadSupport = 0;
}
- }
+ }
+
void init(btThreadSupportInterface* threadSup, btAlignedObjectArray* contextArray)
{
m_threadSupport = threadSup;
@@ -412,11 +418,13 @@ static void WorkerThreadFunc( void* userPtr )
}
}
}
-
- // go sleep
- localStorage->m_mutex.lock();
- localStorage->m_status = WorkerThreadStatus::kSleeping;
- localStorage->m_mutex.unlock();
+ {
+ BT_PROFILE("sleep");
+ // go sleep
+ localStorage->m_mutex.lock();
+ localStorage->m_status = WorkerThreadStatus::kSleeping;
+ localStorage->m_mutex.unlock();
+ }
}
@@ -446,6 +454,12 @@ public:
virtual ~btTaskSchedulerDefault()
{
waitForWorkersToSleep();
+
+ for ( int i = 0; i < m_jobQueues.size(); ++i )
+ {
+ m_jobQueues[i].exit();
+ }
+
if (m_threadSupport)
{
delete m_threadSupport;
@@ -503,7 +517,7 @@ public:
storage.m_threadId = i;
storage.m_directive = m_workerDirective;
storage.m_status = WorkerThreadStatus::kSleeping;
- storage.m_cooldownTime = 1000; // 1000 microseconds, threads go to sleep after this long if they have nothing to do
+ storage.m_cooldownTime = 100; // 100 microseconds, threads go to sleep after this long if they have nothing to do
storage.m_clock = &m_clock;
storage.m_queue = m_perThreadJobQueues[i];
}