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_optimizers: Port fuse_optimizers #307

Merged
merged 18 commits into from Jan 26, 2023

Conversation

methylDragon
Copy link
Collaborator

@methylDragon methylDragon commented Jan 10, 2023

See: #276

Description

This PR ports the entirety of fuse_optimizers, including:

  • CMakeLists and packages
  • Source code
  • Tests
  • Other stuff like docs are in other PRs.
  • This introduces changes to the usage of rclcpp::Time (defaulting to use of RCL_ROS_TIME where time is default initialized.)

Pinging @svwilliams for visibility.

@methylDragon methylDragon force-pushed the rolling-optimizers branch 4 times, most recently from 9fa6009 to d69cc5b Compare January 13, 2023 08:08
@methylDragon methylDragon changed the title fuse -> ROS 2 fuse_optimizers: WIP fuse -> ROS 2 fuse_optimizers Jan 13, 2023
@methylDragon methylDragon marked this pull request as ready for review January 13, 2023 08:37
methylDragon and others added 6 commits January 18, 2023 06:02
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
Copy link
Collaborator

@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.

In progress review - will continue tomorrow

fuse_core/src/timestamp_manager.cpp Outdated Show resolved Hide resolved
fuse_optimizers/CMakeLists.txt Outdated Show resolved Hide resolved
fuse_optimizers/CMakeLists.txt Outdated Show resolved Hide resolved
fuse_optimizers/CMakeLists.txt Outdated Show resolved Hide resolved
fuse_optimizers/CMakeLists.txt Outdated Show resolved Hide resolved
fuse_optimizers/src/fixed_lag_smoother.cpp Outdated Show resolved Hide resolved
Signed-off-by: methylDragon <methylDragon@gmail.com>
sloretz and others added 5 commits January 20, 2023 17:51
Uses user provided timestamp to construct
TimestampManager::MotionModelSegment to ensure all rclcpp::Time points
use the same clock type that's being fed in.

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
Signed-off-by: methylDragon <methylDragon@gmail.com>
@methylDragon methylDragon changed the title fuse -> ROS 2 fuse_optimizers fuse -> ROS 2 fuse_optimizers: Port fuse_optimizers Jan 22, 2023
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
Copy link
Collaborator

@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.

These are my last comments on this PR. Once they're addressed and methylDragon#5 is included then this PR will LGTM 🚀

// It needs to be free to handle the response to this service call.
// Have a callback do the rest of the work when a response comes.
auto result_future = reset_client_->async_send_request(srv,
[this, post_process, &graph, msg](rclcpp::Client<std_srvs::srv::Empty>::SharedFuture result){
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like graph is a local variable (of type std::unique_ptr<...>), so if I understand correctly it will probably already be destructed by the time this lambda is run. I think this needs to be a move capture , graph = std::move(graph), instead

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 had to convert the graph uniqueptr into a shared_ptr so it can be copyable.
    • This is because the async service call signature we're using requires a std::function, which must be copyable (and so requires all args to be copyable)

But aside from that, this bug is fixed! Nice catch!


#include <XmlRpcValue.h>
//#include <XmlRpcValue.h>
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit, delete this line

// TODO(CH3): pass a rclcpp::Context, and a CallbackGroup
Optimizer::Optimizer(rclcpp::NodeOptions options, fuse_core::Graph::UniquePtr graph) :
Node("optimizer_node", options),
// XXX pass a rclcpp::Context, and a CallbackGroup
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit, comment no longer required

test_variable_stamp_index
)

foreach(test_name ${TEST_TARGETS})
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit, looks like the loop and TEST_TARGETS variable are no longer necessary. I'd recommend removing them

// Load a positive parameter:
{
double parameter{default_value};
fuse_core::getPositiveParam(node, "positive_parameter", parameter);
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 like a copy of a test from fuse_core. I think this file can be deleted.

@methylDragon methylDragon merged commit 8e76155 into locusrobotics:rolling Jan 26, 2023
@methylDragon methylDragon deleted the rolling-optimizers branch January 26, 2023 17:37
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.

None yet

2 participants