Skip to content

Commit

Permalink
Bugfix: return a copy of points
Browse files Browse the repository at this point in the history
  • Loading branch information
ymollard committed Jun 9, 2020
1 parent 7766103 commit b65ab8c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/poppy_ros_control/recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from trajectory_msgs.msg import JointTrajectoryPoint, JointTrajectory
from moveit_msgs.msg import RobotTrajectory
import json, rospy
from copy import deepcopy

def to_dict(points):
"""
Expand Down Expand Up @@ -34,7 +35,7 @@ def from_dict(trajectory):
for point in trajectory["points"]:
jtp.positions = point["positions"]
jtp.time_from_start = rospy.Duration(point["time"])
jt.points.append(jtp)
jt.points.append(deepcopy(jtp))
return jt

class RecorderBase(object):
Expand Down

0 comments on commit b65ab8c

Please sign in to comment.