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

Issue258 add fixed size optimizer #308

Open
wants to merge 18 commits into
base: devel
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add fixed size smoother node
jakemclaughlin6 committed Jan 18, 2023
commit bc5c21e90f6ab0d8dcc2cba5ef83ef8a5ec17273
22 changes: 22 additions & 0 deletions fuse_optimizers/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -102,6 +102,28 @@ set_target_properties(fixed_lag_smoother_node
CXX_STANDARD_REQUIRED YES
)

## fixed_size_smoother node
add_executable(fixed_size_smoother_node
src/fixed_size_smoother_node.cpp
)
add_dependencies(fixed_size_smoother_node
${catkin_EXPORTED_TARGETS}
)
target_include_directories(fixed_size_smoother_node
PRIVATE
include
${catkin_INCLUDE_DIRS}
)
target_link_libraries(fixed_size_smoother_node
${PROJECT_NAME}
${catkin_LIBRARIES}
)
set_target_properties(fixed_size_smoother_node
PROPERTIES
CXX_STANDARD 14
CXX_STANDARD_REQUIRED YES
)

#############
## Install ##
#############
51 changes: 51 additions & 0 deletions fuse_optimizers/src/fixed_size_smoother_node.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Software License Agreement (BSD License)
*
* Copyright (c) 2019, Locus Robotics
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <fuse_graphs/hash_graph.h>
#include <fuse_graphs/hash_graph_params.h>
#include <fuse_optimizers/fixed_size_smoother.h>
#include <fuse_optimizers/fixed_size_smoother_params.h>
#include <ros/ros.h>


int main(int argc, char **argv)
{
ros::init(argc, argv, "fixed_size_smoother_node");
ros::NodeHandle private_node_handle("~");
fuse_graphs::HashGraphParams hash_graph_params;
hash_graph_params.loadFromROS(private_node_handle);
fuse_optimizers::FixedSizeSmoother optimizer(fuse_graphs::HashGraph::make_unique(hash_graph_params));
ros::spin();

return 0;
}