clearpathrobotics / clearpath_simulator

BSD 3-Clause "New" or "Revised" License
8 stars 6 forks source link

Unable to Publish Data in ROS Topic #41

Closed gaudelbijay closed 11 hours ago

gaudelbijay commented 2 days ago

I am able to run the simulation with the Jackal robot, and when I did ros2 topic list, I got the following topics:

/j100_0000/cmd_vel
/j100_0000/diagnostics
/j100_0000/dynamic_joint_states
/j100_0000/joint_state_broadcaster/transition_event
/j100_0000/joy_teleop/cmd_vel
/j100_0000/joy_teleop/joy
/j100_0000/joy_teleop/joy/set_feedback
/j100_0000/platform/cmd_vel_unstamped
/j100_0000/platform/emergency_stop
/j100_0000/platform/joint_states
/j100_0000/platform/odom
/j100_0000/platform/odom/filtered
/j100_0000/platform_velocity_controller/transition_event
/j100_0000/rc_teleop/cmd_vel
/j100_0000/robot_description
/j100_0000/sensors/gps_0/fix
/j100_0000/sensors/imu_0/data
/j100_0000/sensors/imu_0/data_raw
/j100_0000/sensors/lidar2d_0/scan
/j100_0000/sensors/lidar2d_1/scan
/j100_0000/sensors/lidar3d_0/points
/j100_0000/sensors/lidar3d_0/scan
/j100_0000/set_pose
/j100_0000/tf
/j100_0000/tf_static
/j100_0000/twist_marker_server/cmd_vel
/j100_0000/twist_marker_server/feedback
/j100_0000/twist_marker_server/update
/parameter_events
/rosout

However, when I try to echo any topic, the output is empty. For example, ros2 topic echo /j100_0000/cmd_vel outputs nothing. The info of ros2 topic info /j100_0000/cmd_vel -v is:

Type: geometry_msgs/msg/Twist

Publisher count: 1

Node name: cmd_vel_bridge
Node namespace: /j100_0000
Topic type: geometry_msgs/msg/Twist
Endpoint type: PUBLISHER
GID: 01.0f.e6.20.8a.a4.56.e5.00.00.00.00.00.00.13.03.00.00.00.00.00.00.00.00
QoS profile:
  Reliability: RELIABLE
  History (Depth): UNKNOWN
  Durability: VOLATILE
  Lifespan: Infinite
  Deadline: Infinite
  Liveliness: AUTOMATIC
  Liveliness lease duration: Infinite

Subscription count: 1

Node name: twist_mux
Node namespace: /j100_0000
Topic type: geometry_msgs/msg/Twist
Endpoint type: SUBSCRIPTION
GID: 01.0f.e6.20.73.a4.d5.2c.00.00.00.00.00.00.13.04.00.00.00.00.00.00.00.00
QoS profile:
  Reliability: BEST_EFFORT
  History (Depth): UNKNOWN
  Durability: VOLATILE
  Lifespan: Infinite
  Deadline: Infinite
  Liveliness: AUTOMATIC
  Liveliness lease duration: Infinite

How can I fix this problem?

gaudelbijay commented 1 day ago

My robot.yaml file is:

version: 0
system:
  hosts:
    - hostname: cpr-j100-0000
      ip: 192.168.131.1
  ros2:
    namespace: j100_0000
platform:
  attachments:
    - name: front_fender
      type: j100.fender
    - name: rear_fender
      type: j100.fender
      rpy: [0.0, 0.0, 3.1415]
links:
  cylinder:
  - name: cylinder
    parent: default_mount
    xyz: [0.0, 0.0, 0.05]
    rpy: [0.0, 0.0, 0.0]
    radius: 0.05
    length: 0.1
mounts:
  bracket:
  - parent: front_0_mount
    xyz: [0.0, 0.0, 0.0]
    rpy: [0.0, 0.0, 0.0]
    model: horizontal
  - parent: rear_0_mount
    xyz: [0.0, 0.0, 0.0]
    rpy: [0.0, 0.0, 0.0]
    model: horizontal
sensors:
  lidar2d:
  - model: hokuyo_ust
    urdf_enabled: true
    launch_enabled: true
    parent: bracket_0_mount
    xyz: [0.0, 0.0, 0.0]
    rpy: [0.0, 0.0, 0.0]
    ros_parameters:
      urg_node:
        laser_frame_id: lidar2d_0_laser
        ip_address: 192.168.131.20
        ip_port: 10940
        angle_min: -3.141592653589793
        angle_max: 3.141592653589793
  - model: hokuyo_ust
    urdf_enabled: true
    launch_enabled: true
    parent: bracket_1_mount
    xyz: [0.0, 0.0, 0.0]
    rpy: [0.0, 0.0, 3.1415]
    ros_parameters:
      urg_node:
        laser_frame_id: lidar2d_1_laser
        ip_address: 192.168.131.21
        ip_port: 10940
        angle_min: -3.141592653589793
        angle_max: 3.141592653589793
  lidar3d:
  - model: velodyne_lidar
    urdf_enabled: true
    launch_enabled: true
    parent: default_mount
    xyz: [0.0, 0.0, 0.1]
    rpy: [0.0, 0.0, 0.0]
    ros_parameters:
      velodyne_driver_node:
        frame_id: lidar3d_0_laser
        device_ip: 192.168.131.25
        port: 2368
        model: VLP16
      velodyne_transform_node:
        model: VLP16
        fixed_frame: lidar3d_0_laser
        target_frame: lidar3d_0_laser
gaudelbijay commented 11 hours ago

Fixed it.