Add ruff/ruff format to pre-commit & Add integration test#28
Add ruff/ruff format to pre-commit & Add integration test#28
Conversation
07572d0 to
a6486ff
Compare
| current_joint_state = robot.get_current_joint_state() | ||
| urdf_initial_values = [0.2, 0.3, 0.1] | ||
| assert ( | ||
| current_joint_state == urdf_initial_values | ||
| ), f"{current_joint_state=} != {urdf_initial_values=}" |
There was a problem hiding this comment.
Test a bug, should be fixed with a6486ff
| throttle_duration_sec=2.0, | ||
| skip_first=True, | ||
| ) | ||
| rclpy.spin_once(self, timeout_sec=0.0) |
There was a problem hiding this comment.
With this approach is the node's spin coupled to the topics it's processing? Why are you setting the timeout to 0? Does that cause it to move on immediately and not block?
There was a problem hiding this comment.
Yes, this will process current callbacks and return without waiting, so if there are none it will just return
There was a problem hiding this comment.
What happens if there is no message and this returns. How would this get future callbacks if nothing is spinning?
There was a problem hiding this comment.
We only care about processing them when we call get_current_joint_command, that is why we only spin when we need the values from those callbacks
| msg = f"Joint name '{joint_name}' not in input keys {msg.name}" | ||
| raise ValueError(msg) from None |
There was a problem hiding this comment.
Should this be masking the function variable msg? I also don't see any try statements around the call to filter_joint_state_msg so what happens to a test when this is triggered?
| // Check the initial_value param is used | ||
| if (!interface.initial_value.empty()) | ||
| { | ||
| joint_states_[index][i] = std::stod(interface.initial_value); |
There was a problem hiding this comment.
By setting this can it cause the connected robot to jump to the initial position when started?
There was a problem hiding this comment.
I think this should fix the issue of the robot jumping to the initial position
MarqRazz
left a comment
There was a problem hiding this comment.
Thanks for adding new tests!
To make it easy to test #25 and #24