micro_ros_setup: error when I add Joint_state topic to appMain

Issue template

Steps to reproduce the issue

ros2 run micro_ros_setup configure_firmware.sh joint_states_subscriber -t serial -d 1
ros2 run micro_ros_setup build_firmware.sh 

and flash the bin with openocd and

ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyUSB0

and run moveit

ros2 launch run_move_group run_move_group.launch.py

Expected behavior

reveive joint_state topic in callback and print message I get joint_state topic

Actual behavior

sequence in ros_message [ERROR] [ld.ld] [rclc]: [rclc_take_new_data] Error in rcl_take: error not set

[ERROR] [ld.ld] [rclc]: Error number: 1 Failed status on line 79: 1. Aborting.

Additional information

and when I initialize the message like this

        joint_states_msg.name.data = (char *) malloc(ARRAY_LEN * sizeof(char));
        joint_states_msg.name.size = 0;
        joint_states_msg.name.capacity = ARRAY_LEN;

problem still usual.

sequence in ros_message
[ERROR] [ld.ld] [rclc]: [rclc_take_new_data] Error in rcl_take: error not set

[ERROR] [ld.ld] [rclc]: Error number: 1

should I initialize every member of the struct in here? I just initialize name of it.

typedef struct sensor_msgs__msg__JointState
{
  std_msgs__msg__Header header;
  rosidl_runtime_c__String__Sequence name;
  rosidl_runtime_c__double__Sequence position;
  rosidl_runtime_c__double__Sequence velocity;
  rosidl_runtime_c__double__Sequence effort;
} sensor_msgs__msg__JointState;

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 29 (16 by maintainers)

Most upvoted comments

yes,work for me now. amazing.