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

fuse -> ROS 2 fuse_variables: Port fuse_variables #288

Merged
merged 3 commits into from
Dec 8, 2022

Conversation

methylDragon
Copy link
Collaborator

See: #276

Description

This PR ports the entirety of fuse_variables, including:

  • CMakeLists and packages
  • Source code
  • Tests

Other stuff like docs are in other PRs

Notes

Pinging @svwilliams for visibility.

)

install(
FILES fuse_plugins.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
DESTINATION share/${PROJECT_NAME}
Copy link

Choose a reason for hiding this comment

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

Same comment #287 (comment) about using pluginlib_export_plugin_description_file()


## fuse_variables library
add_library(${PROJECT_NAME}
add_library(${PROJECT_NAME} SHARED
Copy link

Choose a reason for hiding this comment

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

same comment about leaving off SHARED and using ament_cmake_ros instead of ament_cmake #287 (comment)

target_link_libraries(test_load_device_id ${PROJECT_NAME})

ament_add_pytest_test(test_load_device_id_py "launch_tests/test_load_device_id.py"
PYTHON_EXECUTABLE "${_PYTHON_EXECUTABLE}"
Copy link

Choose a reason for hiding this comment

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

Where is _PYTHON_EXECUTABLE coming from?


install(
DIRECTORY launch_tests
DESTINATION share/${PROJECT_NAME}/test
Copy link

Choose a reason for hiding this comment

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

I don't think tests should be installed

{
exec_ = std::make_shared<rclcpp::executors::SingleThreadedExecutor>();

spinning_ = true;
Copy link

Choose a reason for hiding this comment

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

I don't think spinning is needed here, just exec_->cancel() to stop the thread.

spinning_ = true;
spinner_ = std::thread([&](){
auto context = rclcpp::contexts::get_global_default_context();
while(context->is_valid() && spinning_) {
Copy link

Choose a reason for hiding this comment

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

This loop and context getting can be removed and replaced with exec_->spin().


@pytest.mark.launch_test
@launch_testing.markers.keep_alive
def generate_test_description():
Copy link

Choose a reason for hiding this comment

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

Use launch_pytest instead of launch_testing

@methylDragon methylDragon force-pushed the rolling-variables branch 3 times, most recently from beb5af7 to 57301bb Compare November 30, 2022 02:49
@methylDragon methylDragon requested a review from sloretz November 30, 2022 02:49
@methylDragon methylDragon force-pushed the rolling-variables branch 2 times, most recently from 1696f10 to 6b3f4d2 Compare December 7, 2022 21:19
<build_depend>libceres-dev</build_depend>
<build_depend>fuse_core</build_depend>
<build_depend>pluginlib</build_depend>
<build_depend>rclcpp</build_depend>
Copy link

Choose a reason for hiding this comment

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

is rclcpp required? I don't see it find_package()'d in the main CMakeLists.txt - it looks like it's just a <test_depend>.

Copy link
Collaborator Author

@methylDragon methylDragon Dec 8, 2022

Choose a reason for hiding this comment

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

I made it a test_depend. Although, rclcpp gets included via fuse_core; if that's the case should I remove it entirely?
Likewise, outside of tests, rclcpp::Time gets included and used via #include <fuse_core/time.hpp>

Changes made:
https://github.com/locusrobotics/fuse/compare/6b3f4d22c89fe058bceb106625f5bd8ef49c3e40..7a247f8bd9753e0c185d8011cb6f48c537614452

Copy link

Choose a reason for hiding this comment

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

Ahh I only looked at the headers. I didn't check for types. Having a <build_depend> or <depend> on rclcpp seems fine to me then!

Copy link

@sloretz sloretz left a comment

Choose a reason for hiding this comment

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

With package.xml fixes, a rebase, and a green RPr job this looks good to me!

Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
@methylDragon methylDragon merged commit 280465a into locusrobotics:rolling Dec 8, 2022
@methylDragon methylDragon deleted the rolling-variables branch December 8, 2022 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants