Skip to content

Commit 198bb49

Browse files
Merge remote-tracking branch 'origin/release-1.1.1'
2 parents 990bb65 + bd44b8c commit 198bb49

File tree

5 files changed

+53
-19
lines changed

5 files changed

+53
-19
lines changed

CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
1.1.1 (2015-5-15)
2+
---------------------------------
3+
- Fixed a bug that caused the JTAS to error with a path of one or two points is supplied as a trajectory
4+
15
1.1.0 (2015-1-2)
26
---------------------------------
37
- Updates baxter_interface to ROS Indigo

package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<package>
33
<name>baxter_interface</name>
4-
<version>1.1.0</version>
4+
<version>1.1.1</version>
55
<description>
66
Convenient python interface classes for control
77
of the Baxter Research Robot from Rethink Robotics.

src/baxter_interface/settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
HEAD_PAN_ANGLE_TOLERANCE = 0.1396263401
3030

3131
## Versioning
32-
SDK_VERSION = '1.1.0'
32+
SDK_VERSION = '1.1.1'
3333
CHECK_VERSION = True
3434
# Version Compatibility Maps - {current: compatible}
35-
VERSIONS_SDK2ROBOT = {'1.1.0': ['1.1.0']}
36-
VERSIONS_SDK2GRIPPER = {'1.1.0':
35+
VERSIONS_SDK2ROBOT = {'1.1.1': ['1.1.1', '1.1.0']}
36+
VERSIONS_SDK2GRIPPER = {'1.1.1':
3737
{
3838
'warn': '2014/5/20 00:00:00', # Version 1.0.0
3939
'fail': '2013/10/15 00:00:00', # Version 0.6.2

src/joint_trajectory_action/bezier.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,19 +135,25 @@ def de_boor_control_pts(points_array, d0=None,
135135
# Construct de Boor Control Points from A matrix
136136
d_pts = np.zeros((N+3, k))
137137
for col in range(0, k):
138-
x = np.zeros((N-1, 1))
139-
# Compute start / end conditions
140-
if natural:
141-
x[N-2, 0] = 6*points_array[-2, col] - points_array[-1, col]
142-
x[0, 0] = 6*points_array[1, col] - points_array[0, col]
143-
else:
144-
x[N-2, 0] = 6*points_array[-2, col] - 1.5*dN[0, col]
145-
x[0, 0] = 6*points_array[1, col] - 1.5*d0[0, col]
146-
x[range(1, N-3+1), 0] = 6*points_array[range(2, N-2+1), col]
147-
# Solve bezier interpolation
138+
x = np.zeros((max(N-1, 1), 1))
148139
if N > 2:
140+
# Compute start / end conditions
141+
if natural:
142+
x[N-2, 0] = 6*points_array[-2, col] - points_array[-1, col]
143+
x[0, 0] = 6*points_array[1, col] - points_array[0, col]
144+
else:
145+
x[N-2, 0] = 6*points_array[-2, col] - 1.5*dN[0, col]
146+
x[0, 0] = 6*points_array[1, col] - 1.5*d0[0, col]
147+
x[range(1, N-3+1), 0] = 6*points_array[range(2, N-2+1), col]
148+
# Solve bezier interpolation
149149
d_pts[2:N+1, col] = np.linalg.solve(A, x).T
150150
else:
151+
# Compute start / end conditions
152+
if natural:
153+
x[0, 0] = 6*points_array[1, col] - points_array[0, col]
154+
else:
155+
x[0, 0] = 6*points_array[1, col] - 1.5*d0[col]
156+
# Solve bezier interpolation
151157
d_pts[2, col] = x / A
152158
# Store off start and end positions
153159
d_pts[0, :] = points_array[0, :]

src/joint_trajectory_action/joint_trajectory_action.py

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,24 @@ def _on_trajectory_action(self, goal):
354354
control_rate = rospy.Rate(self._control_rate)
355355

356356
dimensions_dict = self._determine_dimensions(trajectory_points)
357-
# Force Velocites/Accelerations to zero at the final timestep
357+
358+
if num_points == 1:
359+
# Add current position as trajectory point
360+
first_trajectory_point = JointTrajectoryPoint()
361+
first_trajectory_point.positions = self._get_current_position(joint_names)
362+
# To preserve desired velocities and accelerations, copy them to the first
363+
# trajectory point if the trajectory is only 1 point.
364+
if dimensions_dict['velocities']:
365+
first_trajectory_point.velocities = deepcopy(trajectory_points[0].velocities)
366+
if dimensions_dict['accelerations']:
367+
first_trajectory_point.accelerations = deepcopy(trajectory_points[0].accelerations)
368+
first_trajectory_point.time_from_start = rospy.Duration(0)
369+
trajectory_points.insert(0, first_trajectory_point)
370+
num_points = len(trajectory_points)
371+
372+
# Force Velocites/Accelerations to zero at the final timestep
358373
# if they exist in the trajectory
359-
# Remove this behavior if you are stringing together trajectories,
374+
# Remove this behavior if you are stringing together trajectories,
360375
# and want continuous, non-zero velocities/accelerations between
361376
# trajectories
362377
if dimensions_dict['velocities']:
@@ -366,9 +381,18 @@ def _on_trajectory_action(self, goal):
366381

367382
# Compute Full Bezier Curve Coefficients for all 7 joints
368383
pnt_times = [pnt.time_from_start.to_sec() for pnt in trajectory_points]
369-
b_matrix = self._compute_bezier_coeff(joint_names,
370-
trajectory_points,
371-
dimensions_dict)
384+
try:
385+
b_matrix = self._compute_bezier_coeff(joint_names,
386+
trajectory_points,
387+
dimensions_dict)
388+
except Exception as ex:
389+
rospy.logerr(("{0}: Failed to compute a Bezier trajectory for {1}"
390+
" arm with error \"{2}: {3}\"").format(
391+
self._action_name,
392+
self._name,
393+
type(ex).__name__, ex))
394+
self._server.set_aborted()
395+
return
372396
# Wait for the specified execution time, if not provided use now
373397
start_time = goal.trajectory.header.stamp.to_sec()
374398
if start_time == 0.0:

0 commit comments

Comments
 (0)