Open NickFranken opened 3 years ago
Yes, I believe you need to connect multiple PCs to use multiple drones. For 2 drones I used 2 Raspberry Pis, plus a main computer running flock2. Each pi connected to a drone via wifi, and was also networked via ethernet. Each pi was running UDP forwarding software to move packets across the 2 networks. (I think you can also tinker with the pi networking settings to set up a more general bridge, but I found it easier to build a simple packet forwarding tool.)
Using Flock2 for swarm applications – Port selection for 2 drones
Hello!
My name is Nick and I am trying to use flock2 to control two (and hopefully more) Tello drones over WI-FI and I am running into issues with the port assignments for each drone. When I assign ports 8890 and 11111 to data and video respectively for drone 1, I can’t use these ports for drone 2. However, it seems that these ports are set by the Tello drones, meaning I would need to use multiple PCs to receive video and data from multiple drones.
I am curious if you were able to control two drones while receiving data and video from each using the launch_two.py launch file over one PC and if so, how did you assign the ports of the drones/PC in the launch file.
Thank you, Nick
Here is what is currently output when launching launch_two.py:
[INFO] [launch]: Default logging verbosity is set to INFO [INFO] [rviz2-1]: process started with pid [38092] [INFO] [robot_state_publisher-2]: process started with pid [38094] [INFO] [robot_state_publisher-3]: process started with pid [38096] [INFO] [tello_driver_main-4]: process started with pid [38098] [INFO] [tello_driver_main-5]: process started with pid [38100] [INFO] [joy_node-6]: process started with pid [38102] [INFO] [flock_base-7]: process started with pid [38104] [INFO] [drone_base-8]: process started with pid [38124] [INFO] [drone_base-9]: process started with pid [38147] [INFO] [vmap_main-10]: process started with pid [38152] [INFO] [vloc_main-11]: process started with pid [38162] [INFO] [vloc_main-12]: process started with pid [38176] [robot_state_publisher-2] [WARN] [1632159875.495913222] [robot_state_publisher]: No robot_description parameter, but command-line argument available. Assuming argument is name of URDF file. This backwards compatibility fallback will be removed in the future. [robot_state_publisher-2] Parsing robot urdf xml string. [robot_state_publisher-2] The root link base_link_1 has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF. [robot_state_publisher-2] Link camera_link_1 had 0 children [robot_state_publisher-2] [INFO] [1632159875.498078838] [robot_state_publisher]: got segment base_link_1 [robot_state_publisher-2] [INFO] [1632159875.498108969] [robot_state_publisher]: got segment camera_link_1 [robot_state_publisher-3] [WARN] [1632159875.488483731] [robot_state_publisher]: No robot_description parameter, but command-line argument available. Assuming argument is name of URDF file. This backwards compatibility fallback will be removed in the future. [robot_state_publisher-3] Parsing robot urdf xml string. [robot_state_publisher-3] The root link base_link_2 has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF. [robot_state_publisher-3] Link camera_link_2 had 0 children [robot_state_publisher-3] [INFO] [1632159875.490501757] [robot_state_publisher]: got segment base_link_2 [robot_state_publisher-3] [INFO] [1632159875.490530713] [robot_state_publisher]: got segment camera_link_2 [flock_base-7] [INFO] [1632159875.506022962] [flock_base]: FlockBase Parameters [flock_base-7] [INFO] [1632159875.506186703] [flock_base]: drones = [drone1, drone2] [flock_base-7] [INFO] [1632159875.506212316] [flock_base]: 2 drones, joystick controls drone1, right bumper to change [drone_base-8] [INFO] [1632159875.519132936] [drone1.base1]: DroneBase Parameters [drone_base-8] [INFO] [1632159875.519233918] [drone1.base1]: flight_data_timeout_sec = 1.500000 [drone_base-8] [INFO] [1632159875.519250222] [drone1.base1]: odom_timeout_sec = 1.500000 [drone_base-8] [INFO] [1632159875.519283064] [drone1.base1]: FlightControllerSimple Parameters [drone_base-8] [INFO] [1632159875.519296658] [drone1.base1]: stabilize_time_sec = 5.000000 [drone_base-8] [INFO] [1632159875.527997042] [drone1.base1]: drone initialized [drone_base-9] [INFO] [1632159875.532914035] [drone2.base2]: DroneBase Parameters [drone_base-9] [INFO] [1632159875.533012095] [drone2.base2]: flight_data_timeout_sec = 1.500000 [drone_base-9] [INFO] [1632159875.533029937] [drone2.base2]: odom_timeout_sec = 1.500000 [drone_base-9] [INFO] [1632159875.533068480] [drone2.base2]: FlightControllerSimple Parameters [drone_base-9] [INFO] [1632159875.533084173] [drone2.base2]: stabilize_time_sec = 5.000000 [drone_base-9] [INFO] [1632159875.538016663] [drone2.base2]: drone initialized [vmap_main-10] [INFO] [1632159875.550734818] [vmap_node]: VmapNode Parameters [vmap_main-10] [INFO] [1632159875.550857270] [vmap_node]: fiducial_map_pub_topic = /fiducial_map [vmap_main-10] [INFO] [1632159875.550875912] [vmap_node]: fiducial_markers_pub_topic = fiducial_markers [vmap_main-10] [INFO] [1632159875.550888577] [vmap_node]: fiducial_observations_sub_topic = /fiducial_observations [vmap_main-10] [INFO] [1632159875.550900164] [vmap_node]: map_frame_id = map [vmap_main-10] [INFO] [1632159875.550912667] [vmap_node]: marker_prefix_frameid = marker [vmap_main-10] [INFO] [1632159875.550926234] [vmap_node]: publish_tfs = 1 [vmap_main-10] [INFO] [1632159875.550938388] [vmap_node]: publish_marker_visualizations = 1 [vmap_main-10] [INFO] [1632159875.550956310] [vmap_node]: marker_map_publish_frequency_hz = 0.500000 [vmap_main-10] [INFO] [1632159875.550971200] [vmap_node]: marker_map_save_full_filename = fiducial_marker_locations.yaml [vmap_main-10] [INFO] [1632159875.550983819] [vmap_node]: marker_map_load_full_filename = fiducial_marker_locations_saved.yaml [vmap_main-10] [INFO] [1632159875.550995501] [vmap_node]: make_not_use_map = 1 [vmap_main-10] [INFO] [1632159875.551006178] [vmap_node]: map_init_style = 1 [vmap_main-10] [INFO] [1632159875.551017293] [vmap_node]: map_init_id = 1 [vmap_main-10] [INFO] [1632159875.551032279] [vmap_node]: map_init_pose_x = 0.000000 [vmap_main-10] [INFO] [1632159875.551044637] [vmap_node]: map_init_pose_y = 0.000000 [vmap_main-10] [INFO] [1632159875.551062023] [vmap_node]: map_init_pose_z = 1.000000 [vmap_main-10] [INFO] [1632159875.551073137] [vmap_node]: map_init_pose_roll = 1.570796 [vmap_main-10] [INFO] [1632159875.551086550] [vmap_node]: map_init_pose_pitch = 0.000000 [vmap_main-10] [INFO] [1632159875.551099269] [vmap_node]: map_init_pose_yaw = -1.570796 [vmap_main-10] [INFO] [1632159875.551110720] [vmap_node]: marker_length = 0.162700 [vmap_main-10] [INFO] [1632159875.553181696] [vmap_node]: vmap_node ready [vloc_main-11] [INFO] [1632159875.672138411] [drone1.vloc1]: VlocNode Parameters [vloc_main-11] [INFO] [1632159875.672305582] [drone1.vloc1]: fiducial_observations_pub_topic = /fiducial_observations [vloc_main-11] [INFO] [1632159875.672327807] [drone1.vloc1]: camera_pose_pub_topic = camera_pose [vloc_main-11] [INFO] [1632159875.672341619] [drone1.vloc1]: base_pose_pub_topic = base_pose [vloc_main-11] [INFO] [1632159875.672353629] [drone1.vloc1]: camera_odometry_pub_topic = camera_odom [vloc_main-11] [INFO] [1632159875.672363905] [drone1.vloc1]: base_odometry_pub_topic = base_odom [vloc_main-11] [INFO] [1632159875.672374647] [drone1.vloc1]: image_marked_pub_topic = image_marked [vloc_main-11] [INFO] [1632159875.672385152] [drone1.vloc1]: fiducial_map_sub_topic = /fiducial_map [vloc_main-11] [INFO] [1632159875.672395058] [drone1.vloc1]: camera_info_sub_topic = camera_info [vloc_main-11] [INFO] [1632159875.672409035] [drone1.vloc1]: image_raw_sub_topic = image_raw [vloc_main-11] [INFO] [1632159875.672419148] [drone1.vloc1]: map_frame_id = map [vloc_main-11] [INFO] [1632159875.672429062] [drone1.vloc1]: camera_frame_id = camera [vloc_main-11] [INFO] [1632159875.672440062] [drone1.vloc1]: base_frame_id = base_link [vloc_main-11] [INFO] [1632159875.672453733] [drone1.vloc1]: publish_camera_pose = 1 [vloc_main-11] [INFO] [1632159875.672466591] [drone1.vloc1]: publish_base_pose = 1 [vloc_main-11] [INFO] [1632159875.672478216] [drone1.vloc1]: publish_tfs = 1 [vloc_main-11] [INFO] [1632159875.672490387] [drone1.vloc1]: publish_tfs_per_marker = 1 [vloc_main-11] [INFO] [1632159875.672501436] [drone1.vloc1]: publish_camera_odom = 1 [vloc_main-11] [INFO] [1632159875.672512571] [drone1.vloc1]: publish_base_odom = 1 [vloc_main-11] [INFO] [1632159875.672523984] [drone1.vloc1]: publish_image_marked = 1 [vloc_main-11] [INFO] [1632159875.672534599] [drone1.vloc1]: stamp_msgs_with_current_time = 0 [vloc_main-11] [INFO] [1632159875.672554655] [drone1.vloc1]: t_camera_base_x = 0.000000 [vloc_main-11] [INFO] [1632159875.672568455] [drone1.vloc1]: t_camera_base_y = 0.000000 [vloc_main-11] [INFO] [1632159875.672582016] [drone1.vloc1]: t_camera_base_z = -0.035000 [vloc_main-11] [INFO] [1632159875.672594683] [drone1.vloc1]: t_camera_base_roll = 1.570796 [vloc_main-11] [INFO] [1632159875.672605309] [drone1.vloc1]: t_camera_base_pitch = -1.570796 [vloc_main-11] [INFO] [1632159875.672615800] [drone1.vloc1]: t_camera_base_yaw = 0.000000 [vloc_main-11] [INFO] [1632159875.672625630] [drone1.vloc1]: sub_camera_info_best_effort_not_reliable = 1 [vloc_main-11] [INFO] [1632159875.672635416] [drone1.vloc1]: sub_image_raw_best_effort_not_reliable = 1 [vloc_main-11] [INFO] [1632159875.672644855] [drone1.vloc1]: corner_refinement_method = 2 [vloc_main-11] [INFO] [1632159875.681271106] [drone1.vloc1]: vloc_node ready [vloc_main-12] [INFO] [1632159875.700955897] [drone2.vloc2]: VlocNode Parameters [vloc_main-12] [INFO] [1632159875.702088606] [drone2.vloc2]: fiducial_observations_pub_topic = /fiducial_observations [vloc_main-12] [INFO] [1632159875.702112089] [drone2.vloc2]: camera_pose_pub_topic = camera_pose [vloc_main-12] [INFO] [1632159875.702124371] [drone2.vloc2]: base_pose_pub_topic = base_pose [vloc_main-12] [INFO] [1632159875.702134683] [drone2.vloc2]: camera_odometry_pub_topic = camera_odom [vloc_main-12] [INFO] [1632159875.702144701] [drone2.vloc2]: base_odometry_pub_topic = base_odom [vloc_main-12] [INFO] [1632159875.702154487] [drone2.vloc2]: image_marked_pub_topic = image_marked [vloc_main-12] [INFO] [1632159875.702165508] [drone2.vloc2]: fiducial_map_sub_topic = /fiducial_map [vloc_main-12] [INFO] [1632159875.702175802] [drone2.vloc2]: camera_info_sub_topic = camera_info [vloc_main-12] [INFO] [1632159875.702185569] [drone2.vloc2]: image_raw_sub_topic = image_raw [vloc_main-12] [INFO] [1632159875.702198318] [drone2.vloc2]: map_frame_id = map [vloc_main-12] [INFO] [1632159875.702208431] [drone2.vloc2]: camera_frame_id = camera [vloc_main-12] [INFO] [1632159875.702219286] [drone2.vloc2]: base_frame_id = base_link [vloc_main-12] [INFO] [1632159875.702234844] [drone2.vloc2]: publish_camera_pose = 1 [vloc_main-12] [INFO] [1632159875.702246523] [drone2.vloc2]: publish_base_pose = 1 [vloc_main-12] [INFO] [1632159875.702256850] [drone2.vloc2]: publish_tfs = 1 [vloc_main-12] [INFO] [1632159875.702266845] [drone2.vloc2]: publish_tfs_per_marker = 1 [vloc_main-12] [INFO] [1632159875.702277025] [drone2.vloc2]: publish_camera_odom = 1 [vloc_main-12] [INFO] [1632159875.702287262] [drone2.vloc2]: publish_base_odom = 1 [vloc_main-12] [INFO] [1632159875.702297344] [drone2.vloc2]: publish_image_marked = 1 [vloc_main-12] [INFO] [1632159875.702307228] [drone2.vloc2]: stamp_msgs_with_current_time = 0 [vloc_main-12] [INFO] [1632159875.702326384] [drone2.vloc2]: t_camera_base_x = 0.000000 [vloc_main-12] [INFO] [1632159875.702338109] [drone2.vloc2]: t_camera_base_y = 0.000000 [vloc_main-12] [INFO] [1632159875.702349784] [drone2.vloc2]: t_camera_base_z = -0.035000 [vloc_main-12] [INFO] [1632159875.702360196] [drone2.vloc2]: t_camera_base_roll = 1.570796 [vloc_main-12] [INFO] [1632159875.702370547] [drone2.vloc2]: t_camera_base_pitch = -1.570796 [vloc_main-12] [INFO] [1632159875.702380688] [drone2.vloc2]: t_camera_base_yaw = 0.000000 [vloc_main-12] [INFO] [1632159875.702390689] [drone2.vloc2]: sub_camera_info_best_effort_not_reliable = 1 [vloc_main-12] [INFO] [1632159875.702400960] [drone2.vloc2]: sub_image_raw_best_effort_not_reliable = 1 [vloc_main-12] [INFO] [1632159875.702411441] [drone2.vloc2]: corner_refinement_method = 2 [tello_driver_main-5] [INFO] [1632159875.710720822] [drone2.driver2]: Drone at 192.168.0.170:8889 [tello_driver_main-5] [INFO] [1632159875.711594870] [drone2.driver2]: Listening for command responses on localhost:38065 [tello_driver_main-5] [INFO] [1632159875.711619869] [drone2.driver2]: Listening for data on localhost:8890 [tello_driver_main-5] [INFO] [1632159875.711628016] [drone2.driver2]: Listening for video on localhost:11111 [tello_driver_main-5] [INFO] [1632159875.712979661] [drone2.driver2]: Parsed camera info for 'tello_camera' [vloc_main-12] [INFO] [1632159875.718717761] [drone2.vloc2]: vloc_node ready [tello_driver_main-4] [INFO] [1632159875.721484535] [drone1.driver1]: Drone at 192.168.0.208:8889 [tello_driver_main-4] [INFO] [1632159875.721664161] [drone1.driver1]: Listening for command responses on localhost:38065 [tello_driver_main-4] [INFO] [1632159875.721684243] [drone1.driver1]: Listening for data on localhost:8890 [tello_driver_main-4] [INFO] [1632159875.721696992] [drone1.driver1]: Listening for video on localhost:11111 [tello_driver_main-4] terminate called after throwing an instance of 'std::system_error' [tello_driver_main-4] what(): bind: Address already in use [rviz2-1] [INFO] [1632159875.851522617] [rviz2]: Stereo is NOT SUPPORTED [rviz2-1] [INFO] [1632159875.851606443] [rviz2]: OpenGl version: 4.6 (GLSL 4.6) [rviz2-1] [INFO] [1632159875.874784599] [rviz2]: Stereo is NOT SUPPORTED [ERROR] [tello_driver_main-4]: process has died [pid 38098, exit code -6, cmd '/home/nick/flock2_ws/install/tello_driver/lib/tello_driver/tello_driver_main --ros-args -r node:=driver1 -r ns:=/drone1 --params-file /tmp/launch_params_mk79s5to']. [rviz2-1] [INFO] [1632159875.982234431] [rviz2]: Stereo is NOT SUPPORTED