8000 take workspace attr of passed workspace arg · hanm2019/robotics-toolbox-python@41c755a · GitHub
[go: up one dir, main page]

Skip to content

Commit 41c755a

Browse files
committed
take workspace attr of passed workspace arg
graphics tidyup
1 parent f43c6e0 commit 41c755a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

roboticstoolbox/mobile/drivers.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,11 @@ def __init__(self, workspace, speed=1, dthresh=0.05, seed=0, headinggain=0.3, go
120120

121121
# TODO options to specify region, maybe accept a Map object?
122122

123-
124-
self._workspace = base.expand_dims(workspace)
123+
if hasattr(workspace, 'workspace'):
124+
# workspace can be defined by an object with a workspace attribute
125+
self._workspace = base.expand_dims(workspace.workspace)
126+
else:
127+
self._workspace = base.expand_dims(workspace)
125128

126129
self._speed = speed
127130
self._dthresh = dthresh * np.diff(self._workspace[0:2])
@@ -131,6 +134,7 @@ def __init__(self, workspace, speed=1, dthresh=0.05, seed=0, headinggain=0.3, go
131134
'marker': 'D',
132135
'markersize': 6,
133136
'color': 'r',
137+
'linestyle': 'None',
134138
}
135139
else:
136140
self._goal_marker_style = goalmarkerstyle
@@ -230,7 +234,7 @@ def init(self, ax=None):
230234
# delete(driver.h_goal); % delete the goal
231235
# driver.h_goal = [];
232236
if ax is not None:
233-
self._goal_marker = plt.plot(np.nan, np.nan, **self._goal_marker_style)[0]
237+
self._goal_marker = plt.plot(np.nan, np.nan, **self._goal_marker_style, label='random waypoint')[0]
234238

235239
def demand(self):
236240
"""

0 commit comments

Comments
 (0)
0