Only these commands are enough to launch the gimbal control. The rest are for the unit tests.
cd ros2_ghadron_gimbal
colcon build --packages-select gimbal_bringup gimbal_angle_control gimbal_status stream_publisher image_viewer yolo_detection human_tracking PayloadSdk --cmake-args -DGHADRON=1
source install/setup.bash
ros2 launch gimbal_bringup gimbal_system.launch.pycd ros2_gremsy_gimbal_control
colcon build --cmake-args -DGHADRON=1
colcon build --packages-select gimbal_bringup gimbal_angle_control gimbal_status stream_publisher image_viewer yolo_detection human_tracking PayloadSdk --cmake-args -DGHADRON=1
source install/setup.bashros2 run gimbal_angle_control gimbal_angle_control_node
ros2 run gimbal_status gimbal_status_node
ros2 run image_publisher image_publisher_node rtsp://10.3.1.124:8554/ghadron
ros2 run stream_publisher stream_node --ros-args -p rtsp_url:="rtsp://10.3.1.124:8554/ghadron" -p width:=1280 -p height:=720
ros2 run yolo_detection yolo_detection_node
ros2 run human_tracking tracking_node
ros2 run image_viewer image_viewer_nodelaunch all the packages in the gimbal system
ros2 launch gimbal_bringup gimbal_system.launch.pyThe rest of the nodes are automatically launched by gimbal_system.launch.py
ros2 run gimbal_angle_control gimbal_angle_control_nodeSend control commands (pitch=0, row=0, yaw=90). The range of the pitch is -90 pointing down to 90 pointing up. The range of the yaw is -120 to the left to 120 to the right. But the gimbal may lock if you switch the direction too fast like -120 to 120 directly. It is better to do it incrementally like by 10 degrees each time.
ros2 topic pub /gimbal_angles geometry_msgs/msg/Vector3 "{x: 0.0, y: 0.0, z: 90.0}"ros2 run gimbal_status gimbal_status_nodeView topic information
ros2 topic echo /gimbal_attituderos2 run eo_image eo_image_noderos2 run ir_image ir_image_noderos2 run ir_zoom ir_zoom_nodeset zoom range 50% for ir camera, 0 means no zoom in, 100 means 8x zoom in.
ros2 topic pub /ir_zoom/range std_msgs/msg/Float32 "data: 50.0" # 0.0% to 100.0%ros2 run eo_zoom eo_zoom_nodeset zoom range 50% for eo camera, 0 means no zoom in, 100 means 12x zoom in.
ros2 topic pub /eo_zoom/range std_msgs/msg/Float32 "data: 50.0" # 0.0% to 100.0%ros2 run yolo_detection yolo_detection_nodecheck the published topics
ros2 topic info /detection_box
ros2 topic info /detection_box_centerros2 run human_tracking tracking_nodecheck the published topics
ros2 topic info /gimbal_anglesimage_publisher is a node that publishes the streaming video to the topic /image_raw, image_viewer is a node that subscribes to the topic /image_raw and displays the video. We don't use them for now because the streaming video contains ir and eo overlapped and not being able to display separately.
ros2 run image_publisher image_publisher_node rtsp://10.3.1.124:8554/ghadron
ffmpeg -y -i rtsp://10.3.1.124:8554/ghadron 1 do.jpg
ros2 topic echo /image_rawneeded to be changed to if code is migrated to other machine
/home/dtc-mrsd/Downloads/ros2_gimbal_ws/