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

plansys_bt_example params not loaded correctly on Humble #45

Open
stinkyElias opened this issue Feb 23, 2024 · 2 comments
Open

plansys_bt_example params not loaded correctly on Humble #45

stinkyElias opened this issue Feb 23, 2024 · 2 comments

Comments

@stinkyElias
Copy link

stinkyElias commented Feb 23, 2024

Hello

Continuing on #42, a new issue arises. Running the plansys_bt_example with humble generates the error

[bt_action_node-2] [INFO] [1708703917.310511893] [move_1_bb_node]: "move" BtActionNode initialized
[bt_action_node-2] [ERROR] [1708703917.311049000] [move_1]: Caught exception in callback for transition 13
[bt_action_node-2] [ERROR] [1708703917.311068135] [move_1]: Original error: Statically typed parameter 'waypoints' must be initialized.
[bt_action_node-2] [WARN] [1708703917.311079767] [move_1]: Error occurred while doing error handling.

I can't seem to find the issue. However, checking the waypoints parameter that is supposed to be loaded from params.yaml, I see that it's not loaded. From params.yaml

move_1:
  ros__parameters:
    plugins:
      - plansys2_move_bt_node
    waypoints: ["wheels_zone", "steering_wheels_zone", "body_car_zone", "assembly_zone", "recharge_zone"]
    waypoint_coords:
      wheels_zone: [0.0, -2.0, 0.0]
      steering_wheels_zone: [1.8, 0.0, 0.0]
      body_car_zone: [0.0, 2.0, 0.0]
      assembly_zone: [-2.0, -0.4, 0.0]
      recharge_zone: [-2.0, -0.4, 0.0]

Using ros2 param list /move_1 returns

  action_name
  bt_file_logging
  bt_minitrace_logging
  bt_xml_file
  enable_groot_monitoring
  max_msgs_per_second
  plugins
  publisher_port
  rate
  server_port
  specialized_arguments
  use_sim_time

and shows that plugins for example is loaded correcly

$ ros2 param get /move_1 plugins
String values are: ['plansys2_move_bt_node']

however waypoints and waypoint_coordsis not. I find it weird that some parameters are loaded and some are not. Given that move_1don't have waypoints it makes sense to me that I receive the aforemention error message. However, I don't understand how to fix this.

As a test, I have verified that all the other examples work as they should, in case it was a setup issue.

I also checked #33 and verified that I have the correct code line.

Have anyone else experienced this?

Thank you

EDIT: The example works fine with rolling but not with humble

@stinkyElias stinkyElias changed the title plansys_bt_example params not loaded correctly plansys_bt_example params not loaded correctly on Humble Feb 28, 2024
@tammerb
Copy link
Contributor

tammerb commented May 1, 2024

Yes I'm having this same issues. Have you found a solution?

@fmrico
Copy link
Contributor

fmrico commented May 27, 2024

Hi,

It is working "as is" in my updated humble installation, in the humble branch, but it could be that in previous ROS 2 parameters API, humble needs to initialize parameters, so in the action Move can be written this line as follows:

node->declare_parameter<std::vector<std::string>>("waypoints", {});

I hope it helps

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

No branches or pull requests

3 participants