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

[SW-1394] add option for odom/fiducial/camera publishing from ros2 control launchfile #485

Merged
merged 9 commits into from
Sep 23, 2024

Conversation

khughes-bdai
Copy link
Collaborator

@khughes-bdai khughes-bdai commented Sep 20, 2024

Change Overview

Some nodes we have written in spot_driver are compatible with the ros2 control interface -- specifically, the state publisher node, the object sync node, and the camera publishers. This by default will launch these nodes when the ros2 control stack is run on robot. There is the option to turn off image publishing in case of bandwidth issues / if the user does not need it.

Since I was copying and pasting the launch arguments for the image publishers a lot, this PR also moves these into spot_launch_helpers.py so they can simply be imported into all the launchfiles that use it.

Finally, this changes the topic name that the low level joint states are published on from /<robot>/joint_states to /<robot>/low_level/joint_states and updates the nodes that rely on this accordingly. This is useful here because the state publisher node publishes to /<robot>/joint_states and we want to have a clear distinction between these two, as they are being published from two different sources via different BD API calls (unclear if the values the high / low level query produces are the same).

Testing Done

  • Tested wiggle arm example on robot to verify new joint states topic is working properly
  • Verified odom transforms and images are available on robot
  • TF tree is connected properly :

frames_ros2control.png

Copy link
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @khughes-bdai and the rest of your teammates on Graphite Graphite

),
)
)
launch_args += declare_image_publisher_args()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I realize this is not the most ROS-y way to do this but I wasn't sure of a better way to reduce all of this repeated boilerplate

Copy link
Collaborator

Choose a reason for hiding this comment

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

This looks great to me. I wouldn't worry about the most "ROS-y" way and just focus on what is effective and maintainable.

Comment on lines +209 to +228
# launch state publisher node (useful for publishing odom & other statuses)
ld.add_action(
Node(
package="spot_driver",
executable="state_publisher_node",
output="screen",
parameters=[config_file, {"spot_name": spot_name}],
namespace=spot_name,
)
)
# launch object sync node (for fiducials)
ld.add_action(
Node(
package="spot_driver",
executable="object_synchronizer_node",
output="screen",
parameters=[config_file, {"spot_name": spot_name}],
namespace=spot_name,
)
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I didn't add an optional flag for these like with the image publishers since they are pretty minimal and don't have the same issues with bandwidth, open to discussion if anyone thinks these should not be launched by default.

@coveralls
Copy link

coveralls commented Sep 20, 2024

Pull Request Test Coverage Report for Build 10999106474

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 14 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.2%) to 51.208%

Files with Coverage Reduction New Missed Lines %
spot_ros2/spot_ros2/spot_driver/spot_driver/launch/spot_launch_helpers.py 14 80.95%
Totals Coverage Status
Change from base Build 10948915446: 0.2%
Covered Lines: 1929
Relevant Lines: 3767

💛 - Coveralls

Copy link
Collaborator

@tcappellari-bdai tcappellari-bdai left a comment

Choose a reason for hiding this comment

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

lgtm

]


class DepthRegisteredMode(Enum):
Copy link
Collaborator

Choose a reason for hiding this comment

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

docstring please

Copy link
Collaborator Author

khughes-bdai commented Sep 23, 2024

Merge activity

@khughes-bdai khughes-bdai merged commit aff6f67 into main Sep 23, 2024
6 checks passed
@khughes-bdai khughes-bdai deleted the khughes/add_odom_and_cameras_to_lowlevel branch September 23, 2024 17:28
AngelRodriguez8008 added a commit to AngelRodriguez8008/spot_ros2 that referenced this pull request Oct 26, 2024
* main: (23 commits)
  [dependabot] Bump spot_wrapper from `61c2574` to `76e522b` (bdaiinstitute#517)
  [SW-1483] Reorganize ROS 2 control packages (bdaiinstitute#511)
  [dependabot] Bump ros_utilities from `06077a2` to `23a79c9` (bdaiinstitute#513)
  [dependabot] Bump spot_wrapper from `f410423` to `61c2574` (bdaiinstitute#514)
  [dependabot] Bump spot_wrapper from `5c01ea7` to `f410423` (bdaiinstitute#512)
  Bump Spot SDK from `4.0.2` to `4.1.0` (bdaiinstitute#495)
  [MAPLE-743] Add hand posing non blocking option (bdaiinstitute#510)
  [SW-1481] Fix namespacing with spot ros2 control examples  (bdaiinstitute#505)
  [dependabot] Bump ros_utilities from `6ed50d7` to `06077a2` (bdaiinstitute#503)
  [MAPLE-743] Add Cartesian arm pose commands (bdaiinstitute#501)
  [SW-1465] Fix image stitching for greyscale images (bdaiinstitute#499)
  [SW-1391] controller that lets you specify position, velocity, and load at the same time  (bdaiinstitute#493)
  [dependabot] Bump ros_utilities from `e4f6138` to `6ed50d7` (bdaiinstitute#498)
  [dependabot] Bump ros_utilities from `2dc3c6b` to `e4f6138` (bdaiinstitute#496)
  [dependabot] Bump spot_wrapper from `2eec3ab` to `bde75c2` (bdaiinstitute#491)
  Updated navigateTo interface (bdaiinstitute#487)
  [MAPLE-663] Spot Gripper Angle Service (bdaiinstitute#488)
  [dependabot] Bump ros_utilities from `2d3e031` to `2dc3c6b` (bdaiinstitute#490)
  [dependabot] Bump ros_utilities from `e93bfc9` to `2d3e031` (bdaiinstitute#489)
  [SW-1394] add option for odom/fiducial/camera publishing from ros2 control launchfile (bdaiinstitute#485)
  ...
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.

4 participants