Skip to content
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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

JafarAbdi
Copy link
Collaborator

To make it easy to test #25 and #24

Comment on lines +40 to +44
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=}"
Copy link
Collaborator Author

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

@JafarAbdi JafarAbdi changed the title .lmlAdd ruff/ruff format to pre-commit & Add integration test Add ruff/ruff format to pre-commit & Add integration test Oct 10, 2024
throttle_duration_sec=2.0,
skip_first=True,
)
rclpy.spin_once(self, timeout_sec=0.0)
Copy link
Contributor

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?

Copy link
Collaborator Author

@JafarAbdi JafarAbdi Nov 4, 2024

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

Copy link
Contributor

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?

Copy link
Collaborator Author

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

Comment on lines +81 to +82
msg = f"Joint name '{joint_name}' not in input keys {msg.name}"
raise ValueError(msg) from None
Copy link
Contributor

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);
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants