From fa564bc356a2e3ce58c710d51eed606e697af18a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Baumg=C3=A4rnter?= <22688144+liquidcronos@users.noreply.github.com> Date: Mon, 13 Sep 2021 11:13:48 +0200 Subject: [PATCH] get_groups now returns deepcopy to fullfill requirements of #40 --- src/trip_kinematics/Robot.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/trip_kinematics/Robot.py b/src/trip_kinematics/Robot.py index d016c30..9039829 100644 --- a/src/trip_kinematics/Robot.py +++ b/src/trip_kinematics/Robot.py @@ -1,5 +1,6 @@ from typing import Dict, List from casadi import SX +from copy import deepcopy from trip_kinematics.Utility import identity_transformation from trip_kinematics.KinematicGroup import KinematicGroup , OpenKinematicGroup @@ -49,12 +50,12 @@ def __init__(self, kinematic_chain: List[KinematicGroup]) -> None: self._virtual_group_mapping[key]=str(group) def get_groups(self): - """Returns a dictionary of the py:class`KinematicGroup` managed by the :py:class`Robot`- + """Returns a dictionary of the py:class`KinematicGroup` managed by the :py:class`Robot`_ Returns: Dict[str, KinematicGroup]: The dictionary of py:class`KinematicGroup` objects. """ - return self._group_dict + return deepcopy(self._group_dict) def pass_group_arg_v_to_a(self,argv_dict): for key in argv_dict.keys():