ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
copy.deepcopy
is the recommended way of creating a deep copy of a message, according to this ticket.
2 | No.2 Revision |
copy.deepcopy
is the recommended way of creating a deep copy of a message, according to this ticket.
Edit: You probably named a function copy after the import line. Python has only one namespace, i.e. by defining a function copy, you overwrite the package copy. Either do a from copy import deepcopy and just call deepcopy, not copy.deepcopy or rename your function.
3 | No.3 Revision |
copy.deepcopy
is the recommended way of creating a deep copy of a message, according to this ticket.
Edit:
You probably named a function copy after the import line. Python has only one namespace, i.e. by defining a function copy, you overwrite the package copy. Either do a
from copy import deepcopy deepcopy
and just call deepcopy, not copy.deepcopy or rename your function.function. You can also import the module copy
under a different name:
import copy as copy_module
4 | No.4 Revision |
copy.deepcopy
is the recommended way of creating a deep copy of a message, according to this ticket.
Edit: You probably named a function copy after the import line. Python has only one namespace, i.e. by defining a function copy, you overwrite the package copy. Either do
from copy import deepcopy
and just call deepcopy, not copy.deepcopy or rename your function. You can also import the module copy
under a different name:
import copy as copy_module
Then you can call the deepcopy function like this:
new_odometry = copy_module.deepcopy(odometry)
5 | No.5 Revision |
copy.deepcopy
is the recommended way of creating a deep copy of a message, according to this ticket.
Edit: You probably named a function copy after the import line. Python has only one namespace, i.e. by defining a function copy, you overwrite the package copy. Either do
from copy import deepcopy
and just call deepcopy, not copy.deepcopy or rename your function. You can also import the module copy
under a different name:
import copy as copy_module
Then you can call the deepcopy function like this:
new_odometry odom_new = copy_module.deepcopy(odometry)
copy_module.deepcopy(odom_old)
6 | No.6 Revision |
copy.deepcopy
is the recommended way of creating a deep copy of a message, according to this ticket.
Edit:
You probably named a function copy after the import line. Python has only one namespace, namespace for variables and functions (in contrast to Common Lisp for instance), i.e. by defining naming a function copy, copy
, you overwrite the package copy. copy
. Either do
from copy import deepcopy
and just call deepcopy, deepcopy
, not copy.deepcopy copy.deepcopy
or rename your function. You can also import the module copy
under a different name:
import copy as copy_module
Then you can call the deepcopy function like this:
odom_new = copy_module.deepcopy(odom_old)