-
Notifications
You must be signed in to change notification settings - Fork 63
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
[N/A] Add a mock launch argument #199
Conversation
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
68d28d9
to
2202fef
Compare
spot_driver/spot_driver/spot_ros2.py
Outdated
@@ -2343,7 +2349,7 @@ def populate_camera_static_transforms(self, image_data: image_pb2.Image) -> None | |||
# We exclude the odometry frames from static transforms since they are not static. We can ignore the body | |||
# frame because it is a child of odom or vision depending on the preferred_odom_frame, and will be published | |||
# by the non-static transform publishing that is done by the state callback | |||
frame_prefix = MOCK_HOSTNAME + "/" | |||
frame_prefix = "" |
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.
I think we need to duplicate this: https://github.com/bdaiinstitute/spot_wrapper/blob/ae0f808eeb9c2792dd44e83fc5bc8863f2f687b3/spot_wrapper/wrapper.py#L422
217290e
to
0432abf
Compare
716d3da
to
80fd72b
Compare
…from the launch file.
9725e97
to
166eb4e
Compare
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.
Approved with a non-urgent question/comment
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.
LGTM - one hesitation on warning vs error
spot_driver/spot_driver/spot_ros2.py
Outdated
if self.frame_prefix != self.spot_wrapper.frame_prefix: | ||
self.get_logger().warn( | ||
f"WARNING: disagreement between `self.frame_prefix` ({self.frame_prefix}) and" | ||
f" `self.spot_wrapper.frame_prefix` ({self.spot_wrapper.frame_prefix})" | ||
) |
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.
is this safe to just keep a as a warning rather than a failure? since some of the replacement code depends on this being true, i wonder if we should fail here even if this is a "should never happen" kind of scenario
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.
+1. Honestly not sure if it matters or not, but it would be good if someone knew
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.
That's a good point. The safe options are
- make this an error
- restore some of the logic at https://github.com/bdaiinstitute/spot_ros2/pull/199/files#diff-11ccb5e01196250d5a8ef23315e44c8111eeb856fcc11e14b36789f915ba207aL2347 and handle the mocked case specially
I think 1 is better.
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.
I think the error makes sense, a hard failure will get reported so we can figure out when/why this actually occurs.
I made disagreement about |
This PR uses node / launch arguments to specify whether the driver should operate in "mock" mode, instead of using the sentinel name `Mock_spot`. With an explicit parameter, we can have multiple mocks, with different names, and also affect whether there is an arm. For example, with this modification you can do ``` cd spot_driver colcon build --symlink # (`symlink` [does not apply to launch files](colcon/colcon-core#407)) source install/setup.bash ros2 launch spot_driver spot_driver.launch.py spot_name:=AnyNameHere mock_enable:=True mock_has_arm:=True ``` and then, for example (`spot_utilities`, specifically in `bdai` repo) ``` # source so that `spot_driver` can be found cd spot_utilities # /workspaces/bdai/ws/src/spot_utilities colcon build source install/setup.bash ros2 run spot_utilities spot_teleop.py AnyNameHere ```
This PR uses node / launch arguments to specify whether the driver should operate in "mock" mode, instead of using the sentinel name
Mock_spot
. With an explicit parameter, we can have multiple mocks, with different names, and also affect whether there is an arm.For example, with this modification you can do
and then, for example (
spot_utilities
, specifically inbdai
repo)