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

save_total_state parameter: ParameterAlreadyDeclaredException using subscribe.launch.py #249

Closed
pglira opened this issue May 11, 2022 · 3 comments · Fixed by #259
Closed
Labels
bug Something isn't working

Comments

@pglira
Copy link

pglira commented May 11, 2022

When running

ros2 launch ov_msckf subscribe.launch.py config:=euroc_mav

from the tutorial https://docs.openvins.com/gs-tutorial.html I get the following error:

[run_subscribe_msckf-1] terminate called after throwing an instance of 'rclcpp::exceptions::ParameterAlreadyDeclaredException'
[run_subscribe_msckf-1]   what():  parameter 'save_total_state' has already been declared
[ERROR] [run_subscribe_msckf-1]: process has died [pid 11507, exit code -6, cmd '/ros_ws/install/ov_msckf/lib/ov_msckf/run_subscribe_msckf --ros-args -r __ns:=/ --params-file /tmp/launch_params_qa5bw91m --params-file /tmp/launch_params_0mltn1c9 --params-file /tmp/launch_params_0q29k68h --params-file /tmp/launch_params_t72tj74y --params-file /tmp/launch_params_effor9qu'].

Commenting out this line

{"save_total_state": LaunchConfiguration("save_total_state")},

"solves" the issue.

@goldbattle goldbattle added the debugging Might be a bug, looking into the issue label May 12, 2022
@hodnajit
Copy link

Hi, I am facing the same error. May the error comes from this line
run_subscribe_msckf.cpp line 64
options.automatically_declare_parameters_from_overrides(true);

@hodnajit
Copy link

I am facing the same error while running it on galactic docker ov_ros2_20_04 :)

@goldbattle
Copy link
Member

goldbattle commented Jun 14, 2022

You should be able to change these lines:

// Load if we should save the total state to file
node->declare_parameter<bool>("save_total_state", false);
node->get_parameter("save_total_state", save_total_state);

To something like this:

if (node->has_parameter("save_total_state")) {
  node->get_parameter<bool>("save_total_state", save_total_state);
}

@goldbattle goldbattle added bug Something isn't working and removed debugging Might be a bug, looking into the issue labels Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants