-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ruff/ruff format to pre-commit & Add integration test #28
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
@@ -91,6 +91,7 @@ CallbackReturn TopicBasedSystem::on_init(const hardware_interface::HardwareInfo& | |||
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By setting this can it cause the connected robot to jump to the initial position when started?
To make it easy to test #25 and #24