From b65ab8cdaf7d35af9605ba89b540bbb62714a28b Mon Sep 17 00:00:00 2001 From: Yoan Mollard Date: Tue, 9 Jun 2020 20:40:20 +0200 Subject: [PATCH] Bugfix: return a copy of points --- src/poppy_ros_control/recorder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/poppy_ros_control/recorder.py b/src/poppy_ros_control/recorder.py index 5a7c032..bc36c03 100644 --- a/src/poppy_ros_control/recorder.py +++ b/src/poppy_ros_control/recorder.py @@ -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): """ @@ -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):