Open Meriem-ghrissi opened 2 months ago
@Meriem-ghrissi Hi. Did you add the aruco model inside gazebo?
yes , but it is not detecting it
this is from the camera window
@Meriem-ghrissi If you are seeing the marker in the camera window it means the topic has the information, maybe the issue is in the config part, especially # Declare parameters
.
do you have any idea how to calibrate the camera of gz_x500_depth (how to edit calibration_chessboard.yaml)
hello i am trying to detect /track aruco markers using this code import rclpy # Python library for ROS 2 from rclpy.node import Node # Handles the creation of nodes from rclpy.qos import qos_profile_sensor_data # Uses Best Effort reliability for camera from cv_bridge import CvBridge # Package to convert between ROS and OpenCV Images from geometry_msgs.msg import TransformStamped # Handles TransformStamped message from sensor_msgs.msg import Image # Image is the message type from std_msgs.msg import Bool # Handles boolean messages from std_msgs.msg import Int32 # Handles int 32 type message
Import Python libraries
import cv2 # OpenCV library import numpy as np # Import Numpy library
The different ArUco dictionaries built into the OpenCV library.
ARUCO_DICT = { "DICT_4X4_50": cv2.aruco.DICT_4X4_50, "DICT_4X4_100": cv2.aruco.DICT_4X4_100, "DICT_4X4_250": cv2.aruco.DICT_4X4_250, "DICT_4X4_1000": cv2.aruco.DICT_4X4_1000, "DICT_5X5_50": cv2.aruco.DICT_5X5_50, "DICT_5X5_100": cv2.aruco.DICT_5X5_100, "DICT_5X5_250": cv2.aruco.DICT_5X5_250, "DICT_5X5_1000": cv2.aruco.DICT_5X5_1000, "DICT_6X6_50": cv2.aruco.DICT_6X6_50, "DICT_6X6_100": cv2.aruco.DICT_6X6_100, "DICT_6X6_250": cv2.aruco.DICT_6X6_250, "DICT_6X6_1000": cv2.aruco.DICT_6X6_1000, "DICT_7X7_50": cv2.aruco.DICT_7X7_50, "DICT_7X7_100": cv2.aruco.DICT_7X7_100, "DICT_7X7_250": cv2.aruco.DICT_7X7_250, "DICT_7X7_1000": cv2.aruco.DICT_7X7_1000, "DICT_ARUCO_ORIGINAL": cv2.aruco.DICT_ARUCO_ORIGINAL }
class ArucoNode(Node): """ Create an ArucoNode class, which is a subclass of the Node class. """ def init(self): """ Class constructor to set up the node """
Initiate the Node class's constructor and give it a name
def listener_callback(self, data): """ Callback function. """
Convert ROS Image message to OpenCV image
def main(args=None):
Initialize the rclpy library
rclpy.init(args=args)
Create the node
aruco_node = ArucoNode()
Spin the node so the callback function is called.
rclpy.spin(aruco_node)
Destroy the node explicitly
(optional - otherwise it will be done automatically
when the garbage collector destroys the node object)
aruco_node.destroy_node()
Shutdown the ROS client library for Python
rclpy.shutdown() got it from automatic addison repository but it displays the window and never detect the aruco on the camera frame python3 aruco_marker_detector.py [INFO] [1715685902.300350418] [aruco_node]: [INFO] detecting 'DICT_ARUCO_ORIGINAL' markers... can you help me resolve it i am using your model as example