Skip to content

Commit 742df30

Browse files
author
Jesse Haviland
committed
added spot model
1 parent 687d345 commit 742df30

File tree

103 files changed

+144662
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+144662
-0
lines changed

roboticstoolbox/models/URDF/Spot.py

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#!/usr/bin/env python
2+
3+
import numpy as np
4+
from roboticstoolbox.robot.Robot import Robot
5+
from spatialmath import SE3
6+
7+
8+
class Spot(Robot):
9+
"""
10+
Class that imports a Spot URDF model
11+
12+
``Spot()`` is a class which imports a Spot robot definition
13+
from a URDF file. The model descroboticstoolbox/models/URDF/Spot.pyribes its kinematic and graphical
14+
characteristics.
15+
16+
.. runblock:: pycon
17+
18+
>>> import roboticstoolbox as rtb
19+
>>> robot = rtb.models.URDF.Spot()
20+
>>> print(robot)
21+
22+
Defined joint configurations are:
23+
24+
- qz, zero joint angle configuration, 'L' shaped configuration
25+
- qr, vertical 'READY' configuration
26+
- qs, arm is stretched out in the x-direction
27+
- qn, arm is at a nominal non-singular configuration
28+
29+
.. codeauthor:: Jesse Haviland
30+
.. sectionauthor:: Peter Corke
31+
"""
32+
33+
def __init__(self):
34+
35+
links, name, urdf_string, urdf_filepath = self.URDF_read(
36+
"spot_description/urdf/spot_with_arm.urdf.xacro"
37+
)
38+
39+
super().__init__(
40+
links,
41+
name=name,
42+
manufacturer="Boston Dynamics",
43+
# gripper_links=links[12],
44+
urdf_string=urdf_string,
45+
urdf_filepath=urdf_filepath,
46+
)
47+
48+
# self.grippers[0].tool = SE3(0, 0, 0.1034)
49+
50+
# self.qdlim = np.array(
51+
# [4.0, 4.0, 2.1750, 2.1750, 2.1750, 2.1750, 2.6100, 2.6100, 2.6100, 3.0, 3.0]
52+
# )
53+
54+
# self.qr = np.array([0, 0, 0, -0.3, 0, -2.2, 0, 2.0, np.pi / 4])
55+
self.qz = np.zeros(19)
56+
57+
# self.addconfiguration("qr", self.qr)
58+
self.addconfiguration("qz", self.qz)
59+
60+
61+
if __name__ == "__main__": # pragma nocover
62+
63+
from swift import Swift
64+
65+
env = Swift()
66+
env.launch()
67+
68+
robot = Spot()
69+
env.add(robot)
70+
71+
while True:
72+
print("Hello")
73+
break
74+
# print(robot)
75+
# q = robot.qz
76+
# q[12:18] = np.array([
77+
# 0.00043129920959472656,
78+
# -3.1129815578460693,
79+
# # 0.0,
80+
# 3.1337125301361084,
81+
# 1.5675101280212402,
82+
# -0.0025529861450195312,
83+
# -1.5732693672180176,
84+
# ])
85+
86+
# robot.plot(q)
87+
88+
# for link in robot.links:
89+
# print(link.name)
90+
# print(link.isjoint)
91+
# print(len(link.collision))
92+
93+
# print()
94+
95+
# for link in robot.grippers[0].links:
96+
# print(link.name)
97+
# print(link.isjoint)
98+
# print(len(link.collision))

roboticstoolbox/models/URDF/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from roboticstoolbox.models.URDF.FetchCamera import FetchCamera
2424
from roboticstoolbox.models.URDF.Valkyrie import Valkyrie
2525
from roboticstoolbox.models.URDF.AL5D import AL5D
26+
from roboticstoolbox.models.URDF.Spot import Spot
2627

2728
__all__ = [
2829
"Panda",
@@ -50,4 +51,5 @@
5051
"FetchCamera",
5152
"Valkyrie",
5253
"AL5D",
54+
"Spot"
5355
]
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2021, Clearpath Robotics Inc.
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
1. Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
3. Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
250 KB
Binary file not shown.
262 KB
Binary file not shown.
423 KB
Binary file not shown.
244 KB
Binary file not shown.
77.9 KB
Binary file not shown.
22.6 KB
Binary file not shown.
170 KB
Binary file not shown.

0 commit comments

Comments
 (0)