ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
This is most likely a Python problem, not a ROS problem.
The start
in your callback(msg)
method is a different variable. The name is the same, but that variable shadows the start
in the global scope. To refer to the global start
, add global
before it.
2 | No.2 Revision |
This is most likely a Python problem, not a ROS problem.
The start
in your callback(msg)
method is a different variable. The name is the same, but that variable shadows the start
in the global scope. To refer to the global start
, add global
before it.
See Python Global, Local and Nonlocal variables (random Google search result) for some more explanation.