19
19
from traitlets .config import Config
20
20
import IPython
21
21
import argparse
22
- from math import pi # lgtm [py/unused-import]
23
- import numpy as np
24
- import scipy as sp
25
- import matplotlib .pyplot as plt # lgtm [py/unused-import]
26
- from roboticstoolbox import * # lgtm [py/unused-import]
27
- from spatialmath import * # lgtm [py/polluting-import]
28
- from spatialgeometry import * # lgtm [py/polluting-import]
29
- import spatialmath .base as smb
30
- from spatialmath .base import sym
31
- import matplotlib as mpl
32
22
from pathlib import Path
33
23
import sys
34
24
from importlib .metadata import version
42
32
# print('colored not found')
43
33
_colored = False
44
34
35
+ # imports for use by IPython and user
36
+ import math
37
+ from math import pi # lgtm [py/unused-import]
38
+ import numpy as np
39
+ from scipy import linalg , optimize
40
+ import matplotlib .pyplot as plt # lgtm [py/unused-import]
41
+
42
+ from spatialmath import * # lgtm [py/polluting-import]
43
+ from spatialmath .base import *
44
+ import spatialmath .base as smb
45
+ from spatialmath .base import sym
46
+
47
+ from spatialgeometry import * # lgtm [py/polluting-import]
48
+
49
+ from roboticstoolbox import * # lgtm [py/unused-import]
50
+ # load some robot models
51
+ puma = models .DH .Puma560 ()
52
+ panda = models .DH .Panda ()
53
+
54
+
45
55
def main ():
46
56
# setup defaults
47
57
np .set_printoptions (
@@ -131,19 +141,7 @@ def main():
131
141
print (f"Using matplotlb backend { args .backend } " )
132
142
mpl .use (args .backend )
133
143
134
- # load some robot models
135
- puma = models .DH .Puma560 ()
136
- panda = models .DH .Panda ()
137
-
138
144
# build the banner, import * packages and their versions
139
- versions = f"(RTB=={ version ('roboticstoolbox-python' )} , SMTB=={ version ('spatialmath-python' )} "
140
- imports = ["roboticstoolbox" , "spatialmath" ]
141
- if args .vision :
142
- versions += f", MVTB=={ version ('machinevision-toolbox-python' )} "
143
- imports .append ("machinevisiontoolbox" )
144
-
145
- versions += ")"
146
- imports = "\n " .join ([f" from { x } import *" for x in imports ])
147
145
148
146
# banner template
149
147
# https://patorjk.com/software/taag/#p=display&f=Cybermedium&t=Robotics%20Toolbox%0A
@@ -152,11 +150,33 @@ def main():
152
150
|__/ | | |__] | | | | | [__ | | | | | | |__] | | \/
153
151
| \ |__| |__] |__| | | |___ ___] | |__| |__| |___ |__] |__| _/\_
154
152
155
- for Python { versions }
156
-
157
- { imports }
153
+ for Python"""
154
+
155
+ versions = []
156
+ versions .append (f"RTB=={ version ('roboticstoolbox-python' )} " )
157
+ versions .append (f"SMTB=={ version ('spatialmath-python' )} " )
158
+ versions .append (f"SG=={ version ('spatialmath-python' )} " )
159
+ versions .append (f"NumPy=={ version ('numpy' )} " )
160
+ versions .append (f"SciPy=={ version ('scipy' )} " )
161
+ versions .append (f"Matplotlib=={ version ('matplotlib' )} " )
162
+
163
+ # create banner
164
+ banner += " (" + ", " .join (versions ) + ")"
165
+ banner += r"""
166
+
167
+ import math
158
168
import numpy as np
159
- import scipy as sp
169
+ from scipy import linalg, optimize
170
+ import matplotlib.pyplot as plt
171
+ from spatialmath import *
172
+ from spatialmath.base import *
173
+ from spatialmath.base import sym
174
+ from roboticstoolbox import *"
175
+
176
+ # useful variables
177
+ from math import pi
178
+ puma = models.DH.Puma560()
179
+ panda = models.DH.Panda()
160
180
161
181
func/object? - show brief help
162
182
help(func/object) - show detailed help
0 commit comments