Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

has invalid type: expected [double_array] got [double]

Aperta
#258 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Start by checking the generated parameter declarations in parameter.hpp against the YAML types, then trace how the node declares and loads manipulator.approach_object_min_dist. The report says the generated field is double, but runtime expects double_array; identify where that mismatch is introduced and verify the parameter loads without the exception.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

when I create a double parameter,it's always expect double_array.

My yaml file is bellow:

yx_robot:
  # This is the manipulator configuration
  manipulator:
    arm_group_name:
      type: string
      default_value: "yx_robot_arm" 
      validation:
        not_empty<>: []
    hand_group_name:
      type: string
      default_value: "yx_robot_hand" 
      validation:
        not_empty<>: []
    eef_name:
      type: string
      default_value: "yx_robot_hand" 
      validation:
        not_empty<>: []
    hand_frame:
      type: string
      default_value: "hand_link" 
      validation:
        not_empty<>: []
    cartesian_ik_frame:
      type: string
      default_value: "Link6"
      validation:
        not_empty<>: []
    grasp_ik_frame:
      type: string
      default_value: "Link6"
      validation:
        not_empty<>: []
    grasp_frame_transform:
      type: double_array
      default_value: [0.0,0.0,0.0,0.0,0.0,0.0]
      validation:
        fixed_size<>: [6]
    approach_object_min_dist:
      type: double
      default_value: 0.05
      validation:
        not_empty<>: 
    approach_object_max_dist:
      type: double
      default_value: 0.15
      validation:
        not_empty<>: 
    lift_object_min_dist:
      type: double
      default_value: 0.05
      validation:
        not_empty<>: 
    lift_object_max_dist:
      type: double
      default_value: 0.15
      validation:
        not_empty<>: 

  gripper: 
    max_position: # 夹爪自身最大行程
      type: double
      default_value: 0.030 
      validation:
        not_empty<>: []
    min_position: # 夹爪自身最小行程
      type: double
      default_value:  0.00
    full_open_position: # 增加夹指之后最大行程
      type: double
      default_value: 0.030 
    full_close_position: # 增加夹指之后最小行程
      type: double
      default_value: 0.010 
    grasping_position:
      type: double
      default_value: 0.020 #合适的夹取行程

Then I look at compile file parameter.hpp:

struct Params {
        struct Manipulator {
            std::string arm_group_name = "yx_robot_arm";
            std::string hand_group_name = "yx_robot_hand";
            std::string eef_name = "yx_robot_hand";
            std::string hand_frame = "hand_link";
            std::string cartesian_ik_frame = "Link6";
            std::string grasp_ik_frame = "Link6";
            std::vector<double> grasp_frame_transform = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
            double approach_object_min_dist = 0.05;
            double approach_object_max_dist = 0.15;
            double lift_object_min_dist = 0.05;
            double lift_object_max_dist = 0.15;
        } manipulator;
        struct Gripper {
            double max_position = 0.03;
            double min_position = 0.0;
            double full_open_position = 0.03;
            double full_close_position = 0.01;
            double grasping_position = 0.02;
        } gripper;
        // for detecting if the parameter struct has been updated
        rclcpp::Time __stamp;
    };

It's looks ok,but when I use it 👍

[yx_robot_control_node-1] [DEBUG] [1745225220.014621954] [mtc_warpper]: manipulator.arm_group_name: string = yx_robot_arm
[yx_robot_control_node-1] [DEBUG] [1745225220.014739223] [mtc_warpper]: manipulator.hand_group_name: string = yx_robot_hand
[yx_robot_control_node-1] [DEBUG] [1745225220.014747771] [mtc_warpper]: manipulator.eef_name: string = yx_robot_hand
[yx_robot_control_node-1] [DEBUG] [1745225220.014753069] [mtc_warpper]: manipulator.hand_frame: string = hand_link
[yx_robot_control_node-1] [DEBUG] [1745225220.014757762] [mtc_warpper]: manipulator.cartesian_ik_frame: string = Link6
[yx_robot_control_node-1] [DEBUG] [1745225220.014762380] [mtc_warpper]: manipulator.grasp_ik_frame: string = Link6
[yx_robot_control_node-1] [DEBUG] [1745225220.014779245] [mtc_warpper]: manipulator.grasp_frame_transform: double_array = [0, 0, 0, 0, 0, 0]
[yx_robot_control_node-1] [DEBUG] [1745225220.014789394] [mtc_warpper]: manipulator.approach_object_min_dist: double = 0.050000
[yx_robot_control_node-1] terminate called after throwing an instance of 'rclcpp::exceptions::InvalidParameterTypeException'
[yx_robot_control_node-1]   what():  parameter 'manipulator.approach_object_min_dist' has invalid type: expected [double_array] got [double]
[ERROR] [yx_robot_control_node-1]: process has died [pid 52891, exit code -6, cmd '/home/alang/ros2_ws/install/yx_robot_control/lib/yx_robot_control/yx_robot_control_node --ros-args --params-file /tmp/launch_params_n_qzkidg --params-file /tmp/launch_params_kena0njv'].

Why?

Lingua principale
Python
Stelle
385
Fork
81
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PickNikRobotics/generate_parameter_library

Tutte le issue di PickNikRobotics/generate_parameter_library

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.