Skip to content

Conversation

@JafarAbdi
Copy link
Contributor

To make it easy to test #25 and #24

@JafarAbdi JafarAbdi force-pushed the feature/integration_test branch from 07572d0 to a6486ff Compare October 8, 2024 22:57
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
Contributor 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
Contributor 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
Contributor 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?

// 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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should fix the issue of the robot jumping to the initial position

Copy link
Contributor

@MarqRazz MarqRazz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding new tests!

@JafarAbdi JafarAbdi merged commit 8ba98de into main Apr 21, 2025
4 checks passed
@JafarAbdi JafarAbdi deleted the feature/integration_test branch April 21, 2025 12:41
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