JMU-ROBOTICS-VIVA / ros2_aruco

ROS2 Wrapper for OpenCV Aruco Marker Tracking
MIT License
80 stars 72 forks source link

Inquiry Regarding Compatibility of ros2_aruco with ROS 2 SITL PX4 and gz_x500_depth #12

Closed Meriem-ghrissi closed 6 months ago

Meriem-ghrissi commented 6 months ago

hello I hope this message finds you well. I am currently working on a project involving ROS 2 SITL PX4 and the gz_x500_depth camera, and I came across your GitHub repository, ros2_aruco, which seems to offer a solution for detecting ArUco markers with a camera in a ROS 2 environment.Upon reviewing the repository, I noticed that the topics mentioned in the README.md file do not align with the topics present in the ROS 2 SITL PX4 and gz_x500_depth camera setup. Before proceeding further with the integration of your package into my project, I wanted to reach out to you to inquire about the compatibility of ros2_aruco with this specific setup.

Specifically, I am interested in knowing if ros2_aruco has been tested or configured to work seamlessly with ROS 2 SITL PX4 and gz_x500_depth camera. If so, could you kindly provide some guidance or insights on how to adapt the package to suit this environment? Alternatively, if ros2_aruco is not currently compatible with this setup, I would appreciate any recommendations or suggestions you might have for achieving ArUco marker detection in such a configuration.

I understand that your time is valuable, and I genuinely appreciate any assistance or information you can provide on this matter

jkaniuka commented 6 months ago

Hi @Meriem-ghrissi, I assume that Subscriptions topics mentioned in README are different from topics where your drone camera is publishing images stream. It's not a problem at all. I would say it's a standard situation. All you need to do is to change parameters values in this YAML file (image_topic and camera_info_topic to be exact). Let me know, if you need further assistance :wink:

Meriem-ghrissi commented 6 months ago

thank you for replying the topics available are /camera ,/camera/compressed , /camera/compressedDepth and /camera/theora changing the /camera_info into /camera/coIpressed and /image_raw into /camera i got this message on terminal [aruco_node] MArker size :0.0625 [aruco_node]: MArker type :DICT_5*5_250 [aruco_node] Image topic:/camera [aruco_node] Image info topic :camera/compressed [aruco_node]: No camera info has been received i cannot resolve it because with same camera i applied object detection and it worked

jkaniuka commented 6 months ago

@Meriem-ghrissi launch your entire system, execute the following command, and paste the output

ros2 topic list -t
Meriem-ghrissi commented 6 months ago

hello this is the output /camera [sensor_msgs/msg/Image] /camera/compressed [sensor_msgs/msg/CompressedImage] /camera/compressedDepth [sensor_msgs/msg/CompressedImage] /camera/theora [theora_image_transport/msg/Packet] /fmu/in/actuator_motors [px4_msgs/msg/ActuatorMotors] /fmu/in/actuator_servos [px4_msgs/msg/ActuatorServos] /fmu/in/arming_check_reply [px4_msgs/msg/ArmingCheckReply] /fmu/in/aux_global_position [px4_msgs/msg/VehicleGlobalPosition] /fmu/in/config_control_setpoints [px4_msgs/msg/VehicleControlMode] /fmu/in/config_overrides_request [px4_msgs/msg/ConfigOverrides] /fmu/in/differential_drive_setpoint [px4_msgs/msg/DifferentialDriveSetpoint] /fmu/in/goto_setpoint [px4_msgs/msg/GotoSetpoint] /fmu/in/manual_control_input [px4_msgs/msg/ManualControlSetpoint] /fmu/in/message_format_request [px4_msgs/msg/MessageFormatRequest] /fmu/in/mode_completed [px4_msgs/msg/ModeCompleted] /fmu/in/obstacle_distance [px4_msgs/msg/ObstacleDistance] /fmu/in/offboard_control_mode [px4_msgs/msg/OffboardControlMode] /fmu/in/onboard_computer_status [px4_msgs/msg/OnboardComputerStatus] /fmu/in/register_ext_component_request [px4_msgs/msg/RegisterExtComponentRequest] /fmu/in/sensor_optical_flow [px4_msgs/msg/SensorOpticalFlow] /fmu/in/telemetry_status [px4_msgs/msg/TelemetryStatus] /fmu/in/trajectory_setpoint [px4_msgs/msg/TrajectorySetpoint] /fmu/in/unregister_ext_component [px4_msgs/msg/UnregisterExtComponent] /fmu/in/vehicle_attitude_setpoint [px4_msgs/msg/VehicleAttitudeSetpoint] /fmu/in/vehicle_command [px4_msgs/msg/VehicleCommand] /fmu/in/vehicle_command_mode_executor [px4_msgs/msg/VehicleCommand] /fmu/in/vehicle_mocap_odometry [px4_msgs/msg/VehicleOdometry] /fmu/in/vehicle_rates_setpoint [px4_msgs/msg/VehicleRatesSetpoint] /fmu/in/vehicle_thrust_setpoint [px4_msgs/msg/VehicleThrustSetpoint] /fmu/in/vehicle_torque_setpoint [px4_msgs/msg/VehicleTorqueSetpoint] /fmu/in/vehicle_trajectory_bezier [px4_msgs/msg/VehicleTrajectoryBezier] /fmu/in/vehicle_trajectory_waypoint [px4_msgs/msg/VehicleTrajectoryWaypoint] /fmu/in/vehicle_visual_odometry [px4_msgs/msg/VehicleOdometry] /fmu/out/battery_status [px4_msgs/msg/BatteryStatus] /fmu/out/estimator_status_flags [px4_msgs/msg/EstimatorStatusFlags] /fmu/out/failsafe_flags [px4_msgs/msg/FailsafeFlags] /fmu/out/manual_control_setpoint [px4_msgs/msg/ManualControlSetpoint] /fmu/out/position_setpoint_triplet [px4_msgs/msg/PositionSetpointTriplet] /fmu/out/sensor_combined [px4_msgs/msg/SensorCombined] /fmu/out/timesync_status [px4_msgs/msg/TimesyncStatus] /fmu/out/vehicle_attitude [px4_msgs/msg/VehicleAttitude] /fmu/out/vehicle_control_mode [px4_msgs/msg/VehicleControlMode] /fmu/out/vehicle_global_position [px4_msgs/msg/VehicleGlobalPosition] /fmu/out/vehicle_gps_position [px4_msgs/msg/SensorGps] /fmu/out/vehicle_local_position [px4_msgs/msg/VehicleLocalPosition] /fmu/out/vehicle_odometry [px4_msgs/msg/VehicleOdometry] /fmu/out/vehicle_status [px4_msgs/msg/VehicleStatus] /parameter_events [rcl_interfaces/msg/ParameterEvent] /rosout [rcl_interfaces/msg/Log] i am working with gazebo garden thank you for replying

jkaniuka commented 6 months ago

@Meriem-ghrissi, your image topic is indeed /camera but I don't see camera_info topic with messages of type sensor_msgs.msg.CameraInfo - without this topic you won't be able to launch ArUco detection node

jkaniuka commented 6 months ago

@Meriem-ghrissi I assume you use PX4-ROS2-Gazebo-YOLOv8 repository. Please follow the steps below:

  1. Instead of ros2 run ros_gz_image image_bridge /camera use the following command:
    ros2 run ros_gz_bridge parameter_bridge /camera@sensor_msgs/msg/Image@ignition.msgs.Image 
    /camera_info@sensor_msgs/msg/CameraInfo@ignition.msgs.CameraInfo 
  2. List all available topics with ros2 topic list -t. You should now see /camera_info topic.
  3. In ArUco YAML file set params as listed below:
    image_topic: /camera
    camera_info_topic: /camera_info
Meriem-ghrissi commented 6 months ago

the problem persists here is my topic list /aruco_markers [ros2_aruco_interfaces/msg/ArucoMarkers] /aruco_poses [geometry_msgs/msg/PoseArray] /camera [sensor_msgs/msg/Image] /camera/compressed [sensor_msgs/msg/CameraInfo, sensor_msgs/msg/CompressedImage] /camera/compressedDepth [sensor_msgs/msg/CompressedImage] /camera/theora [theora_image_transport/msg/Packet] /fmu/in/actuator_motors [px4_msgs/msg/ActuatorMotors] /fmu/in/actuator_servos [px4_msgs/msg/ActuatorServos] /fmu/in/arming_check_reply [px4_msgs/msg/ArmingCheckReply] /fmu/in/aux_global_position [px4_msgs/msg/VehicleGlobalPosition] /fmu/in/config_control_setpoints [px4_msgs/msg/VehicleControlMode] /fmu/in/config_overrides_request [px4_msgs/msg/ConfigOverrides] /fmu/in/differential_drive_setpoint [px4_msgs/msg/DifferentialDriveSetpoint] /fmu/in/goto_setpoint [px4_msgs/msg/GotoSetpoint] /fmu/in/manual_control_input [px4_msgs/msg/ManualControlSetpoint] /fmu/in/message_format_request [px4_msgs/msg/MessageFormatRequest] /fmu/in/mode_completed [px4_msgs/msg/ModeCompleted] /fmu/in/obstacle_distance [px4_msgs/msg/ObstacleDistance] /fmu/in/offboard_control_mode [px4_msgs/msg/OffboardControlMode] /fmu/in/onboard_computer_status [px4_msgs/msg/OnboardComputerStatus] /fmu/in/register_ext_component_request [px4_msgs/msg/RegisterExtComponentRequest] /fmu/in/sensor_optical_flow [px4_msgs/msg/SensorOpticalFlow] /fmu/in/telemetry_status [px4_msgs/msg/TelemetryStatus] /fmu/in/trajectory_setpoint [px4_msgs/msg/TrajectorySetpoint] /fmu/in/unregister_ext_component [px4_msgs/msg/UnregisterExtComponent] /fmu/in/vehicle_attitude_setpoint [px4_msgs/msg/VehicleAttitudeSetpoint] /fmu/in/vehicle_command [px4_msgs/msg/VehicleCommand] /fmu/in/vehicle_command_mode_executor [px4_msgs/msg/VehicleCommand] /fmu/in/vehicle_mocap_odometry [px4_msgs/msg/VehicleOdometry] /fmu/in/vehicle_rates_setpoint [px4_msgs/msg/VehicleRatesSetpoint] /fmu/in/vehicle_thrust_setpoint [px4_msgs/msg/VehicleThrustSetpoint] /fmu/in/vehicle_torque_setpoint [px4_msgs/msg/VehicleTorqueSetpoint] /fmu/in/vehicle_trajectory_bezier [px4_msgs/msg/VehicleTrajectoryBezier] /fmu/in/vehicle_trajectory_waypoint [px4_msgs/msg/VehicleTrajectoryWaypoint] /fmu/in/vehicle_visual_odometry [px4_msgs/msg/VehicleOdometry] /fmu/out/battery_status [px4_msgs/msg/BatteryStatus] /fmu/out/estimator_status_flags [px4_msgs/msg/EstimatorStatusFlags] /fmu/out/failsafe_flags [px4_msgs/msg/FailsafeFlags] /fmu/out/manual_control_setpoint [px4_msgs/msg/ManualControlSetpoint] /fmu/out/position_setpoint_triplet [px4_msgs/msg/PositionSetpointTriplet] /fmu/out/sensor_combined [px4_msgs/msg/SensorCombined] /fmu/out/timesync_status [px4_msgs/msg/TimesyncStatus] /fmu/out/vehicle_attitude [px4_msgs/msg/VehicleAttitude] /fmu/out/vehicle_control_mode [px4_msgs/msg/VehicleControlMode] /fmu/out/vehicle_global_position [px4_msgs/msg/VehicleGlobalPosition] /fmu/out/vehicle_gps_position [px4_msgs/msg/SensorGps] /fmu/out/vehicle_local_position [px4_msgs/msg/VehicleLocalPosition] /fmu/out/vehicle_odometry [px4_msgs/msg/VehicleOdometry] /fmu/out/vehicle_status [px4_msgs/msg/VehicleStatus] /parameter_events [rcl_interfaces/msg/ParameterEvent] /rosout [rcl_interfaces/msg/Log] and this is the output of my terminal after running ros2 launch ros2_aruco aruco_recognition.launch.py [INFO] [launch]: All log files can be found below /home/wheelz/.ros/log/2024-05-14-09-51-42-806068-wheelz-IdeaPad-Gaming-3-15ARH05-50808 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [aruco_node-1]: process started with pid [50809] [aruco_node-1] [INFO] [1715676703.435856801] [aruco_node]: Marker size: 0.055 [aruco_node-1] [INFO] [1715676703.436272291] [aruco_node]: Marker type: DICT_5X5_250 [aruco_node-1] [INFO] [1715676703.436592237] [aruco_node]: Image topic: /camera [aruco_node-1] [INFO] [1715676703.436936278] [aruco_node]: Image info topic: /camera/compressed [aruco_node-1] [WARN] [1715676730.723436226] [aruco_node]: No camera info has been received! [aruco_node-1] [WARN] [1715676730.757194200] [aruco_node]: No camera info has been received! [aruco_node-1] [WARN] [1715676730.793969976] [aruco_node]: No camera info has been received! [aruco_node-1] [WARN] [1715676730.822187388] [aruco_node]: No camera info has been received!

jkaniuka commented 6 months ago

@Meriem-ghrissi Your issue is more related to PX4-ROS2-Gazebo-YOLOv8 repository than this repo. ArUco detection will work if you provide appropriate topics. I suggest you close issue here and create new one in PX4-ROS2-Gazebo-YOLOv8 repository regarding camera topics :wink:

Regards, Jan

Meriem-ghrissi commented 6 months ago

ok thank you