Skip to content

Instantly share code, notes, and snippets.

@tatsuyasusukida
Last active December 23, 2022 02:07
Show Gist options
  • Select an option

  • Save tatsuyasusukida/9fc8a8a775f876589ba95542e86b2630 to your computer and use it in GitHub Desktop.

Select an option

Save tatsuyasusukida/9fc8a8a775f876589ba95542e86b2630 to your computer and use it in GitHub Desktop.
Robot arm VR content mockup
<html>
<head>
<meta charset="utf-8">
<title>Display a robot arm in VR using A-Frame</title>
<script src="https://aframe.io/releases/1.3.0/aframe.min.js"></script>
</head>
<body>
<a-scene>
<a-assets>
<a-asset-item id="robot-arm" src="robot-arm.gltf"></a-asset-item>
</a-assets>
<a-sky color="#ECECEC"></a-sky>
<a-gltf-model src="#robot-arm" position="-100 -100 -200" scale="0.3 0.3 0.3"></a-gltf-model>
</a-scene>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>Robot arm VR content mockup</title>
<script src="https://aframe.io/releases/1.3.0/aframe.min.js"></script>
<style>
a-scene {
width: 50%;
height: 50%;
}
label {
display: block;
margin-top: 1rem;
}
textarea {
width: 50%;
display: block;
}
button[type=submit] {
width: 50%;
margin-top: 1rem;
}
</style>
</head>
<body>
<main>
<h1>Robot arm VR content mockup</h1>
<a-scene embedded>
<a-assets>
<a-asset-item id="robot-arm" src="robot-arm.gltf"></a-asset-item>
</a-assets>
<a-sky color="#ECECEC"></a-sky>
<a-gltf-model src="#robot-arm" position="-100 -100 -200" scale="0.3 0.3 0.3"></a-gltf-model>
</a-scene>
<label for="code">Code</label>
<textarea name="code" id="code" rows="10">
from geometry_msgs.msg import Twist
import rospy
class Rotator():
def __init__(self):
self._cmd_pub = rospy.Publisher('/cmd_vel', Twist, queue_size=1)
def rotate_forever(self):
self.twist = Twist()
r = rospy.Rate(10)
while not rospy.is_shutdown():
self.twist.angular.z = 0.1
self._cmd_pub.publish(self.twist)
rospy.loginfo('Rotating robot: %s', self.twist)
r.sleep()
def main():
rospy.init_node('rotate')
try:
rotator = Rotator()
rotator.rotate_forever()
except rospy.ROSInterruptException:
pass
if __name__ == '__main__':
main()
</textarea>
<button type="submit">Run</button>
</main>
</body>
</html>
This file has been truncated, but you can view the full file.
{
"accessors": [
{
"name": "ARM __-_BASE__not_moving__1_0_positions",
"componentType": 5126,
"count": 49187,
"min": [
126.26150512695312,
-1.3840349912643433,
-132.1099090576172
],
"max": [
408.3246765136719,
98.615966796875,
159.60487365722656
],
"type": "VEC3",
"bufferView": 0,
"byteOffset": 0
},
{
"name": "ARM __-_BASE__not_moving__1_0_indices",
"componentType": 5125,
"count": 295158,
"min": [
0
],
"max": [
49186
],
"type": "SCALAR",
"bufferView": 1,
"byteOffset": 0
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ null BASE__rotating_A-axis__1_0_positions",
"componentType": 5126,
"count": 88081,
"min": [
169.39869689941406,
80.615966796875,
-63.7514762878418
],
"max": [
390.837890625,
266.9191589355469,
176.8229522705078
],
"type": "VEC3",
"bufferView": 0,
"byteOffset": 590244
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ null BASE__rotating_A-axis__1_0_indices",
"componentType": 5125,
"count": 528498,
"min": [
0
],
"max": [
88080
],
"type": "SCALAR",
"bufferView": 1,
"byteOffset": 1180632
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ null Z_o_enie1_-_Dodatek_-_Silnik_baza-1_1_0_positions",
"componentType": 5126,
"count": 62601,
"min": [
228.59332275390625,
167.615966796875,
-24.953107833862305
],
"max": [
305.99285888671875,
194.615966796875,
52.4465446472168
],
"type": "VEC3",
"bufferView": 0,
"byteOffset": 1647216
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ null Z_o_enie1_-_Dodatek_-_Silnik_baza-1_1_0_indices",
"componentType": 5125,
"count": 375594,
"min": [
0
],
"max": [
62600
],
"type": "SCALAR",
"bufferView": 1,
"byteOffset": 3294624
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ null Z_o_enie1_-_Dodatek_-_Silnik_obud_g-1_1_0_positions",
"componentType": 5126,
"count": 1392,
"min": [
238.93678283691406,
194.615966796875,
-14.609586715698242
],
"max": [
295.6493225097656,
234.615966796875,
42.102996826171875
],
"type": "VEC3",
"bufferView": 0,
"byteOffset": 2398428
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ null Z_o_enie1_-_Dodatek_-_Silnik_obud_g-1_1_0_indices",
"componentType": 5125,
"count": 8304,
"min": [
0
],
"max": [
1391
],
"type": "SCALAR",
"bufferView": 1,
"byteOffset": 4797000
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ null Z_o_enie1_-_Dodatek_-_Silnik_obud-1_1_0_positions",
"componentType": 5126,
"count": 1656,
"min": [
242.293701171875,
184.615966796875,
-11.252638816833496
],
"max": [
292.29248046875,
214.615966796875,
38.74604797363281
],
"type": "VEC3",
"bufferView": 0,
"byteOffset": 2415132
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ null Z_o_enie1_-_Dodatek_-_Silnik_obud-1_1_0_indices",
"componentType": 5125,
"count": 10152,
"min": [
0
],
"max": [
1655
],
"type": "SCALAR",
"bufferView": 1,
"byteOffset": 4830216
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ null Z_o_enie1_-_Dodatek_-_Silnik_redze_-1_1_0_positions",
"componentType": 5126,
"count": 722,
"min": [
247.2935791015625,
183.615966796875,
-6.25276517868042
],
"max": [
287.2926330566406,
208.615966796875,
33.74620056152344
],
"type": "VEC3",
"bufferView": 0,
"byteOffset": 2435004
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ null Z_o_enie1_-_Dodatek_-_Silnik_redze_-1_1_0_indices",
"componentType": 5125,
"count": 4320,
"min": [
0
],
"max": [
721
],
"type": "SCALAR",
"bufferView": 1,
"byteOffset": 4870824
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ __-_ARM__prime__1_0_positions",
"componentType": 5126,
"count": 34390,
"min": [
1.42507803440094,
180.5990447998047,
-249.42176818847656
],
"max": [
435.62982177734375,
453.25018310546875,
107.93546295166016
],
"type": "VEC3",
"bufferView": 0,
"byteOffset": 2443668
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ __-_ARM__prime__1_0_indices",
"componentType": 5125,
"count": 206364,
"min": [
0
],
"max": [
34389
],
"type": "SCALAR",
"bufferView": 1,
"byteOffset": 4888104
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ __-_ARM__prime_ __-_ARM__second_ null1 ARM__second__1_0_positions",
"componentType": 5126,
"count": 68668,
"min": [
-51.364402770996094,
373.23565673828125,
-205.97384643554688
],
"max": [
297.5615539550781,
544.3386840820312,
97.42516326904297
],
"type": "VEC3",
"bufferView": 0,
"byteOffset": 2856348
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ __-_ARM__prime_ __-_ARM__second_ null1 ARM__second__1_0_indices",
"componentType": 5125,
"count": 411996,
"min": [
0
],
"max": [
68667
],
"type": "SCALAR",
"bufferView": 1,
"byteOffset": 5713560
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ __-_ARM__prime_ __-_ARM__second_ null1 Z_o_enie1_-_Rami__G1ring-1_1_0_positions",
"componentType": 5126,
"count": 1584,
"min": [
213.99282836914062,
465.66412353515625,
11.506301879882812
],
"max": [
288.9344177246094,
549.9647216796875,
92.7890853881836
],
"type": "VEC3",
"bufferView": 0,
"byteOffset": 3680364
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ __-_ARM__prime_ __-_ARM__second_ null1 Z_o_enie1_-_Rami__G1ring-1_1_0_indices",
"componentType": 5125,
"count": 9504,
"min": [
0
],
"max": [
1583
],
"type": "SCALAR",
"bufferView": 1,
"byteOffset": 7361544
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ __-_ARM__prime_ __-_ARM__second_ __-_ARM__rotating_ null2 __-_ARM__rotating_1_1_0_positions",
"componentType": 5126,
"count": 107781,
"min": [
238.21400451660156,
472.5579528808594,
31.247068405151367
],
"max": [
469.8838806152344,
592.5716552734375,
240.31784057617188
],
"type": "VEC3",
"bufferView": 0,
"byteOffset": 3699372
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ __-_ARM__prime_ __-_ARM__second_ __-_ARM__rotating_ null2 __-_ARM__rotating_1_1_0_indices",
"componentType": 5125,
"count": 646686,
"min": [
0
],
"max": [
107780
],
"type": "SCALAR",
"bufferView": 1,
"byteOffset": 7399560
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ __-_ARM__prime_ __-_ARM__second_ __-_ARM__rotating_ null2 Z_o_enie1_-_Dodatek_-_Rami__G2-1_1_0_positions",
"componentType": 5126,
"count": 2219,
"min": [
355.515625,
521.9246215820312,
194.02867126464844
],
"max": [
409.90716552734375,
578.23046875,
243.28500366210938
],
"type": "VEC3",
"bufferView": 0,
"byteOffset": 4992744
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ __-_ARM__prime_ __-_ARM__second_ __-_ARM__rotating_ null2 Z_o_enie1_-_Dodatek_-_Rami__G2-1_1_0_indices",
"componentType": 5125,
"count": 13302,
"min": [
0
],
"max": [
2218
],
"type": "SCALAR",
"bufferView": 1,
"byteOffset": 9986304
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ __-_ARM__prime_ __-_ARM__second_ __-_ARM__rotating_ __-_HEAD__pith_ null3 Z_o_enie1_-_G_owica_ruchoma-1_1_0_positions",
"componentType": 5126,
"count": 3769,
"min": [
374.801025390625,
461.78607177734375,
148.77755737304688
],
"max": [
466.9571838378906,
590.3649291992188,
235.46112060546875
],
"type": "VEC3",
"bufferView": 0,
"byteOffset": 5019372
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ __-_ARM__prime_ __-_ARM__second_ __-_ARM__rotating_ __-_HEAD__pith_ null3 Z_o_enie1_-_G_owica_ruchoma-1_1_0_indices",
"componentType": 5125,
"count": 22614,
"min": [
0
],
"max": [
3768
],
"type": "SCALAR",
"bufferView": 1,
"byteOffset": 10039512
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ __-_ARM__prime_ __-_ARM__second_ __-_ARM__rotating_ __-_HEAD__pith_ null3 Z_o_enie1_-_Rami__G2ring-1_1_0_positions",
"componentType": 5126,
"count": 1584,
"min": [
399.0078125,
458.65618896484375,
166.90823364257812
],
"max": [
470.47900390625,
494.8645324707031,
238.49307250976562
],
"type": "VEC3",
"bufferView": 0,
"byteOffset": 5064600
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ __-_ARM__prime_ __-_ARM__second_ __-_ARM__rotating_ __-_HEAD__pith_ null3 Z_o_enie1_-_Rami__G2ring-1_1_0_indices",
"componentType": 5125,
"count": 9504,
"min": [
0
],
"max": [
1583
],
"type": "SCALAR",
"bufferView": 1,
"byteOffset": 10129968
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ __-_ARM__prime_ __-_ARM__second_ __-_ARM__rotating_ __-_HEAD__pith_ __-_HEAD__rotating_ null4 Z_o_enie1_-_Chwytak_B-1_1_0_positions",
"componentType": 5126,
"count": 30423,
"min": [
402.3276062011719,
435.5834045410156,
169.65438842773438
],
"max": [
473.2815246582031,
480.8011169433594,
247.54295349121094
],
"type": "VEC3",
"bufferView": 0,
"byteOffset": 5083608
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ __-_ARM__prime_ __-_ARM__second_ __-_ARM__rotating_ __-_HEAD__pith_ __-_HEAD__rotating_ null4 Z_o_enie1_-_Chwytak_B-1_1_0_indices",
"componentType": 5125,
"count": 182526,
"min": [
0
],
"max": [
30422
],
"type": "SCALAR",
"bufferView": 1,
"byteOffset": 10167984
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ __-_ARM__prime_ __-_ARM__second_ __-_ARM__rotating_ __-_HEAD__pith_ __-_HEAD__rotating_ null4 Z_o_enie1_-_Chwytak_S-1_1_0_positions",
"componentType": 5126,
"count": 48,
"min": [
395.0365905761719,
445.6651611328125,
177.6593475341797
],
"max": [
481.2330017089844,
478.181396484375,
233.2796173095703
],
"type": "VEC3",
"bufferView": 0,
"byteOffset": 5448684
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ __-_ARM__prime_ __-_ARM__second_ __-_ARM__rotating_ __-_HEAD__pith_ __-_HEAD__rotating_ null4 Z_o_enie1_-_Chwytak_S-1_1_0_indices",
"componentType": 5125,
"count": 276,
"min": [
0
],
"max": [
47
],
"type": "SCALAR",
"bufferView": 1,
"byteOffset": 10898088
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ __-_ARM__prime_ __-_ARM__second_ __-_ARM__rotating_ __-_HEAD__pith_ __-_HEAD__rotating_ __-_GRIPS LEFT_GRIP Z_o_enie1_-_Chwytak_Pin-3_1_0_positions",
"componentType": 5126,
"count": 40,
"min": [
438.4317626953125,
437.07373046875,
198.6739501953125
],
"max": [
466.23345947265625,
468.2640075683594,
227.3475799560547
],
"type": "VEC3",
"bufferView": 0,
"byteOffset": 5449260
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ __-_ARM__prime_ __-_ARM__second_ __-_ARM__rotating_ __-_HEAD__pith_ __-_HEAD__rotating_ __-_GRIPS LEFT_GRIP Z_o_enie1_-_Chwytak_Pin-3_1_0_indices",
"componentType": 5125,
"count": 228,
"min": [
0
],
"max": [
39
],
"type": "SCALAR",
"bufferView": 1,
"byteOffset": 10899192
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ __-_ARM__prime_ __-_ARM__second_ __-_ARM__rotating_ __-_HEAD__pith_ __-_HEAD__rotating_ __-_GRIPS LEFT_GRIP Z_o_enie1_-_Chwytak_Grip-2_1_0_positions",
"componentType": 5126,
"count": 32,
"min": [
446.5542297363281,
402.0445251464844,
207.99342346191406
],
"max": [
463.7490234375,
442.6612548828125,
228.50376892089844
],
"type": "VEC3",
"bufferView": 0,
"byteOffset": 5449740
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ __-_ARM__prime_ __-_ARM__second_ __-_ARM__rotating_ __-_HEAD__pith_ __-_HEAD__rotating_ __-_GRIPS LEFT_GRIP Z_o_enie1_-_Chwytak_Grip-2_1_0_indices",
"componentType": 5125,
"count": 180,
"min": [
0
],
"max": [
31
],
"type": "SCALAR",
"bufferView": 1,
"byteOffset": 10900104
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ __-_ARM__prime_ __-_ARM__second_ __-_ARM__rotating_ __-_HEAD__pith_ __-_HEAD__rotating_ __-_GRIPS RIGHT_GRIP Z_o_enie1_-_Chwytak_Pin-2_1_0_positions",
"componentType": 5126,
"count": 40,
"min": [
410.7079772949219,
427.8546447753906,
186.46847534179688
],
"max": [
438.3757629394531,
459.1099853515625,
215.06893920898438
],
"type": "VEC3",
"bufferView": 0,
"byteOffset": 5450124
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ __-_ARM__prime_ __-_ARM__second_ __-_ARM__rotating_ __-_HEAD__pith_ __-_HEAD__rotating_ __-_GRIPS RIGHT_GRIP Z_o_enie1_-_Chwytak_Pin-2_1_0_indices",
"componentType": 5125,
"count": 228,
"min": [
0
],
"max": [
39
],
"type": "SCALAR",
"bufferView": 1,
"byteOffset": 10900824
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ __-_ARM__prime_ __-_ARM__second_ __-_ARM__rotating_ __-_HEAD__pith_ __-_HEAD__rotating_ __-_GRIPS RIGHT_GRIP Z_o_enie1_-_Chwytak_Grip-1_1_0_positions",
"componentType": 5126,
"count": 32,
"min": [
420.26708984375,
397.2214660644531,
195.73382568359375
],
"max": [
447.6689758300781,
433.15380859375,
221.89047241210938
],
"type": "VEC3",
"bufferView": 0,
"byteOffset": 5450604
},
{
"name": "ARM __-_BASE__not_moving_ __-_BASE__rotating_ __-_ARM__prime_ __-_ARM__second_ __-_ARM__rotating_ __-_HEAD__pith_ __-_HEAD__rotating_ __-_GRIPS RIGHT_GRIP Z_o_enie1_-_Chwytak_Grip-1_1_0_indices",
"componentType": 5125,
"count": 180,
"min": [
0
],
"max": [
31
],
"type": "SCALAR",
"bufferView": 1,
"byteOffset": 10901736
}
],
"asset": {
"generator": "obj2gltf",
"version": "2.0"
},
"buffers": [
{
"name": "robot-arm",
"byteLength": 16353444,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment