OPT4SMART / crazychoir

Flying Swarms of Crazyflie Quadrotors in ROS 2
https://opt4smart.github.io/crazychoir/
GNU General Public License v3.0
37 stars 3 forks source link

Run-time problems cause by different class constructors #7

Closed dbortoluzzi closed 1 year ago

dbortoluzzi commented 1 year ago

Hi, we have some problems running some your examples (like formation_webots.launch.py) using your repo (branch master).

Here the logs of command ros2 launch crazychoir_examples formation_webots.launch.py

crazychoir_formation_webots_controller_followers-20]   File "/opt/crazy_choir_ws/install/crazychoir_examples/lib/crazychoir_examples/crazychoir_formation_webots_controller_followers", line 33, in <module>
[crazychoir_formation_webots_controller_followers-20]     sys.exit(load_entry_point('crazychoir-examples', 'console_scripts', 'crazychoir_formation_webots_controller_followers')())
[crazychoir_formation_webots_controller_followers-20]   File "/opt/crazy_choir_ws/build/crazychoir_examples/crazychoir_examples/formation_webots/controller_followers.py", line 16, in main
[crazychoir_formation_webots_controller_followers-20]     controller = HierarchicalController(pose_handler='pubsub', pose_topic='odom', pose_callback=None,
[crazychoir_formation_webots_controller_followers-20]   File "/opt/crazy_choir_ws/build/crazychoir/crazychoir/controller/hierarchical_control.py", line 50, in __init__
[crazychoir_formation_webots_controller_followers-20]     super().__init__(pose_handler, pose_topic, pose_callback, command_sender, traj_handler)
[crazychoir_formation_webots_controller_followers-20]   File "/opt/crazy_choir_ws/build/crazychoir/crazychoir/controller/hierarchical_control.py", line 31, in __init__
[crazychoir_formation_webots_controller_followers-20]     super().__init__(pose_handler, pose_topic, pose_callback)
[crazychoir_formation_webots_controller_followers-20] TypeError: __init__() takes from 1 to 3 positional arguments but 4 were given
[crazychoir_formation_webots_controller_leaders-6] Traceback (most recent call last):
[crazychoir_formation_webots_controller_leaders-6]   File "/opt/crazy_choir_ws/install/crazychoir_examples/lib/crazychoir_examples/crazychoir_formation_webots_controller_leaders", line 33, in <module>
[crazychoir_formation_webots_controller_leaders-6]     sys.exit(load_entry_point('crazychoir-examples', 'console_scripts', 'crazychoir_formation_webots_controller_leaders')())
[crazychoir_formation_webots_controller_leaders-6]   File "/opt/crazy_choir_ws/build/crazychoir_examples/crazychoir_examples/formation_webots/controller_leaders.py", line 16, in main
[crazychoir_formation_webots_controller_leaders-6]     controller = HierarchicalController(pose_handler='pubsub', pose_topic='odom', pose_callback=None,
[crazychoir_formation_webots_controller_leaders-6]   File "/opt/crazy_choir_ws/build/crazychoir/crazychoir/controller/hierarchical_control.py", line 50, in __init__
[crazychoir_formation_webots_controller_leaders-6]     super().__init__(pose_handler, pose_topic, pose_callback, command_sender, traj_handler)
[crazychoir_formation_webots_controller_leaders-6]   File "/opt/crazy_choir_ws/build/crazychoir/crazychoir/controller/hierarchical_control.py", line 31, in __init__
[crazychoir_formation_webots_controller_leaders-6]     super().__init__(pose_handler, pose_topic, pose_callback)
[crazychoir_formation_webots_controller_leaders-6] TypeError: __init__() takes from 1 to 3 positional arguments but 4 were given
[ERROR] [crazychoir_formation_webots_controller_followers-20]: process has died [pid 66465, exit code 1, cmd '/opt/crazy_choir_ws/install/crazychoir_examples/lib/crazychoir_examples/crazychoir_formation_webots_controller_followers --ros-args -r __ns:=/agent_3 --params-file /tmp/launch_params_ouo5b120'].
[driver-3] Cannot open file: /tmp/webots-66389-kTxAtG/WEBOTS_SERVER (retry count 2)
[driver-8] Cannot open file: /tmp/webots-66389-kTxAtG/WEBOTS_SERVER (retry count 2)
[driver-13] Cannot open file: /tmp/webots-66389-kTxAtG/WEBOTS_SERVER (retry count 2)
[ERROR] [crazychoir_formation_webots_controller_leaders-6]: process has died [pid 66397, exit code 1, cmd '/opt/crazy_choir_ws/install/crazychoir_examples/lib/crazychoir_examples/crazychoir_formation_webots_controller_leaders --ros-args -r __ns:=/agent_0 --params-file /tmp/launch_params_aay3thid'].
[driver-17] Cannot open file: /tmp/webots-66389-kTxAtG/WEBOTS_SERVER (retry count 2)
[crazychoir_formation_webots_controller_followers-44] Traceback (most recent call last):
[crazychoir_formation_webots_controller_followers-44]   File "/opt/crazy_choir_ws/install/crazychoir_examples/lib/crazychoir_examples/crazychoir_formation_webots_controller_followers", line 33, in <module>
[crazychoir_formation_webots_controller_followers-44]     sys.exit(load_entry_point('crazychoir-examples', 'console_scripts', 'crazychoir_formation_webots_controller_followers')())
[crazychoir_formation_webots_controller_followers-44]   File "/opt/crazy_choir_ws/build/crazychoir_examples/crazychoir_examples/formation_webots/controller_followers.py", line 16, in main
[crazychoir_formation_webots_controller_followers-44]     controller = HierarchicalController(pose_handler='pubsub', pose_topic='odom', pose_callback=None,
[crazychoir_formation_webots_controller_followers-44]   File "/opt/crazy_choir_ws/build/crazychoir/crazychoir/controller/hierarchical_control.py", line 50, in __init__
[crazychoir_formation_webots_controller_followers-44]     super().__init__(pose_handler, pose_topic, pose_callback, command_sender, traj_handler)
[crazychoir_formation_webots_controller_followers-44]   File "/opt/crazy_choir_ws/build/crazychoir/crazychoir/controller/hierarchical_control.py", line 31, in __init__
[crazychoir_formation_webots_controller_followers-44]     super().__init__(pose_handler, pose_topic, pose_callback)
[crazychoir_formation_webots_controller_followers-44] TypeError: __init__() takes from 1 to 3 positional arguments but 4 were given
[crazychoir_formation_webots_controller_followers-24] Traceback (most recent call last):
[crazychoir_formation_webots_controller_followers-24]   File "/opt/crazy_choir_ws/install/crazychoir_examples/lib/crazychoir_examples/crazychoir_formation_webots_controller_followers", line 33, in <module>
[crazychoir_formation_webots_controller_followers-24]     sys.exit(load_entry_point('crazychoir-examples', 'console_scripts', 'crazychoir_formation_webots_controller_followers')())
[crazychoir_formation_webots_controller_followers-24]   File "/opt/crazy_choir_ws/build/crazychoir_examples/crazychoir_examples/formation_webots/controller_followers.py", line 16, in main
[crazychoir_formation_webots_controller_followers-24]     controller = HierarchicalController(pose_handler='pubsub', pose_topic='odom', pose_callback=None,
[crazychoir_formation_webots_controller_followers-24]   File "/opt/crazy_choir_ws/build/crazychoir/crazychoir/controller/hierarchical_control.py", line 50, in __init__
[crazychoir_formation_webots_controller_followers-24]     super().__init__(pose_handler, pose_topic, pose_callback, command_sender, traj_handler)
[crazychoir_formation_webots_controller_followers-24]   File "/opt/crazy_choir_ws/build/crazychoir/crazychoir/controller/hierarchical_control.py", line 31, in __init__
[crazychoir_formation_webots_controller_followers-24]     super().__init__(pose_handler, pose_topic, pose_callback)
[crazychoir_formation_webots_controller_followers-24] TypeError: __init__() takes from 1 to 3 positional arguments but 4 were given
[crazychoir_formation_webots_trajectory-12] [INFO] [1688651181.198286344] [agent_1.trajectory]: FullState reference 1 started
[driver-21] Cannot open file: /tmp/webots-66389-kTxAtG/WEBOTS_SERVER (retry count 2)
[crazychoir_formation_webots_trajectory-12] [WARN] [1688651181.201009801] [agent_1.trajectory]: No trajectory parameters passed by argument.
[crazychoir_formation_webots_trajectory-12] [WARN] [1688651181.202736481] [agent_1.trajectory]: Wait for topic: "/agent_1/traj_params"
[crazychoir_formation_webots_trajectory-12] [INFO] [1688651181.205234673] [agent_1.trajectory]: Go!
[ERROR] [crazychoir_formation_webots_controller_followers-44]: process has died [pid 66914, exit code 1, cmd '/opt/crazy_choir_ws/install/crazychoir_examples/lib/crazychoir_examples/crazychoir_formation_webots_controller_followers --ros-args -r __ns:=/agent_9 --params-file /tmp/launch_params_vkh3q0rh'].
[crazychoir_formation_webots_controller_leaders-11] Traceback (most recent call last):
[crazychoir_formation_webots_controller_leaders-11]   File "/opt/crazy_choir_ws/install/crazychoir_examples/lib/crazychoir_examples/crazychoir_formation_webots_controller_leaders", line 33, in <module>
[crazychoir_formation_webots_controller_leaders-11]     sys.exit(load_entry_point('crazychoir-examples', 'console_scripts', 'crazychoir_formation_webots_controller_leaders')())
[crazychoir_formation_webots_controller_leaders-11]   File "/opt/crazy_choir_ws/build/crazychoir_examples/crazychoir_examples/formation_webots/controller_leaders.py", line 16, in main
[crazychoir_formation_webots_controller_leaders-11]     controller = HierarchicalController(pose_handler='pubsub', pose_topic='odom', pose_callback=None,
[crazychoir_formation_webots_controller_leaders-11]   File "/opt/crazy_choir_ws/build/crazychoir/crazychoir/controller/hierarchical_control.py", line 50, in __init__
[crazychoir_formation_webots_controller_leaders-11]     super().__init__(pose_handler, pose_topic, pose_callback, command_sender, traj_handler)
[crazychoir_formation_webots_controller_leaders-11]   File "/opt/crazy_choir_ws/build/crazychoir/crazychoir/controller/hierarchical_control.py", line 31, in __init__
[crazychoir_formation_webots_controller_leaders-11]     super().__init__(pose_handler, pose_topic, pose_callback)
[crazychoir_formation_webots_controller_leaders-11] TypeError: __init__() takes from 1 to 3 positional arguments but 4 were given
[ERROR] [crazychoir_formation_webots_controller_followers-24]: process has died [pid 66582, exit code 1, cmd '/opt/crazy_choir_ws/install/crazychoir_examples/lib/crazychoir_examples/crazychoir_formation_webots_controller_followers --ros-args -r __ns:=/agent_4 --params-file /tmp/launch_params__erkytfs'].
[driver-25] Cannot open file: /tmp/webots-66389-kTxAtG/WEBOTS_SERVER (retry count 2)
[crazychoir_formation_webots_controller_followers-28] Traceback (most recent call last):
[crazychoir_formation_webots_controller_followers-28]   File "/opt/crazy_choir_ws/install/crazychoir_examples/lib/crazychoir_examples/crazychoir_formation_webots_controller_followers", line 33, in <module>
[crazychoir_formation_webots_controller_followers-28]     sys.exit(load_entry_point('crazychoir-examples', 'console_scripts', 'crazychoir_formation_webots_controller_followers')())
[crazychoir_formation_webots_controller_followers-28]   File "/opt/crazy_choir_ws/build/crazychoir_examples/crazychoir_examples/formation_webots/controller_followers.py", line 16, in main
[crazychoir_formation_webots_controller_followers-28]     controller = HierarchicalController(pose_handler='pubsub', pose_topic='odom', pose_callback=None,
[crazychoir_formation_webots_controller_followers-28]   File "/opt/crazy_choir_ws/build/crazychoir/crazychoir/controller/hierarchical_control.py", line 50, in __init__
[crazychoir_formation_webots_controller_followers-28]     super().__init__(pose_handler, pose_topic, pose_callback, command_sender, traj_handler)
[crazychoir_formation_webots_controller_followers-28]   File "/opt/crazy_choir_ws/build/crazychoir/crazychoir/controller/hierarchical_control.py", line 31, in __init__
[crazychoir_formation_webots_controller_followers-28]     super().__init__(pose_handler, pose_topic, pose_callback)
[crazychoir_formation_webots_controller_followers-28] TypeError: __init__() takes from 1 to 3 positional arguments but 4 were given
[crazychoir_formation_webots_controller_followers-16] Traceback (most recent call last):
[crazychoir_formation_webots_controller_followers-16]   File "/opt/crazy_choir_ws/install/crazychoir_examples/lib/crazychoir_examples/crazychoir_formation_webots_controller_followers", line 33, in <module>
[crazychoir_formation_webots_controller_followers-16]     sys.exit(load_entry_point('crazychoir-examples', 'console_scripts', 'crazychoir_formation_webots_controller_followers')())
[crazychoir_formation_webots_controller_followers-16]   File "/opt/crazy_choir_ws/build/crazychoir_examples/crazychoir_examples/formation_webots/controller_followers.py", line 16, in main
[crazychoir_formation_webots_controller_followers-16]     controller = HierarchicalController(pose_handler='pubsub', pose_topic='odom', pose_callback=None,
[crazychoir_formation_webots_controller_followers-16]   File "/opt/crazy_choir_ws/build/crazychoir/crazychoir/controller/hierarchical_control.py", line 50, in __init__
[crazychoir_formation_webots_controller_followers-16]     super().__init__(pose_handler, pose_topic, pose_callback, command_sender, traj_handler)
[crazychoir_formation_webots_controller_followers-16]   File "/opt/crazy_choir_ws/build/crazychoir/crazychoir/controller/hierarchical_control.py", line 31, in __init__
[crazychoir_formation_webots_controller_followers-16]     super().__init__(pose_handler, pose_topic, pose_callback)
[crazychoir_formation_webots_controller_followers-16] TypeError: __init__() takes from 1 to 3 positional arguments but 4 were given
[ERROR] [crazychoir_formation_webots_controller_leaders-11]: process has died [pid 66409, exit code 1, cmd '/opt/crazy_choir_ws/install/crazychoir_examples/lib/crazychoir_examples/crazychoir_formation_webots_controller_leaders --ros-args -r __ns:=/agent_1 --params-file /tmp/launch_params_4ypctnuc'].
[driver-29] Cannot open file: /tmp/webots-66389-kTxAtG/WEBOTS_SERVER (retry count 2)
[ERROR] [crazychoir_formation_webots_controller_followers-28]: process has died [pid 66635, exit code 1, cmd '/opt/crazy_choir_ws/install/crazychoir_examples/lib/crazychoir_examples/crazychoir_formation_webots_controller_followers --ros-args -r __ns:=/agent_5 --params-file /tmp/launch_params_o22npk05'].
[driver-33] Cannot open file: /tmp/webots-66389-kTxAtG/WEBOTS_SERVER (retry count 2)
[ERROR] [crazychoir_formation_webots_controller_followers-16]: process has died [pid 66444, exit code 1, cmd '/opt/crazy_choir_ws/install/crazychoir_examples/lib/crazychoir_examples/crazychoir_formation_webots_controller_followers --ros-args -r __ns:=/agent_2 --params-file /tmp/launch_params_dle06skd'].
[crazychoir_formation_webots_controller_followers-48] Traceback (most recent call last):
[crazychoir_formation_webots_controller_followers-48]   File "/opt/crazy_choir_ws/install/crazychoir_examples/lib/crazychoir_examples/crazychoir_formation_webots_controller_followers", line 33, in <module>
[crazychoir_formation_webots_controller_followers-48]     sys.exit(load_entry_point('crazychoir-examples', 'console_scripts', 'crazychoir_formation_webots_controller_followers')())
[crazychoir_formation_webots_controller_followers-48]   File "/opt/crazy_choir_ws/build/crazychoir_examples/crazychoir_examples/formation_webots/controller_followers.py", line 16, in main
[crazychoir_formation_webots_controller_followers-48]     controller = HierarchicalController(pose_handler='pubsub', pose_topic='odom', pose_callback=None,
[crazychoir_formation_webots_controller_followers-48]   File "/opt/crazy_choir_ws/build/crazychoir/crazychoir/controller/hierarchical_control.py", line 50, in __init__
[crazychoir_formation_webots_controller_followers-48]     super().__init__(pose_handler, pose_topic, pose_callback, command_sender, traj_handler)
[crazychoir_formation_webots_controller_followers-48]   File "/opt/crazy_choir_ws/build/crazychoir/crazychoir/controller/hierarchical_control.py", line 31, in __init__
[crazychoir_formation_webots_controller_followers-48]     super().__init__(pose_handler, pose_topic, pose_callback)
[crazychoir_formation_webots_controller_followers-48] TypeError: __init__() takes from 1 to 3 positional arguments but 4 were given

We are using:

Hint: maybe we have to use different branches of submodules? For example, in ChoiRbot, I've seen that there are some branches called foxy and foxy-devel, but in .gitmodules they aren't used.

Tell me if you need more informations. Daniele

lorenzopichierri commented 1 year ago

Hi Daniele, thank you for your inquiry! Just to be sure, have you followed this guide? Especially, did you run the submodule update for ChoiRbot? git submodule update --remote --merge ChoiRbot/

Thank you again for your interest and let us know if this suggestion solves your problem!

dbortoluzzi commented 1 year ago

Now it works! Maybe I was outdated in subrepository. Other two questions:

Thanks! Best regards, Daniele

lorenzopichierri commented 1 year ago

Thank you for pointing out the safe zone issue. We have increased the safe zone limits so that you can now launch every experiment available in the example package. If you need to increase or decrease the safe zone limits, you will need to modify the appropriate file. Specifically:

The variable to modify is the same in both files, namely self.safezone_limits.

Regarding the GUI, we are currently providing comprehensive documentation. To draw trajectories, follow these steps:

  1. Run the take-off by clicking the TAKE-OFF button in the ROS tab.
  2. Go to the DRAW tab and draw the desired trajectory. Save it by clicking SAVE.
  3. To make the trajectory runnable, switch to the SPLINE tab, select your trajectory, and compile the spline by clicking the SPLINE button.
  4. Now, the drawn trajectory will appear on the right. Pay attention to the acceleration! You can smooth the trajectory by adjusting the interpolation distance and the time scale. We recommend staying within the range of [-2; 2] m/s^2. After modifying any parameter, remember to recompile the spline by clicking the SPLINE button.
  5. Once you are satisfied, compare the obtained spline with the original one.
  6. To run the drawn trajectory, go back to the ROS tab, select the trajectory file, choose your Crazyflie ID, and click FLY.
  7. Enjoy! :)

I hope this resolves your issues. Please don't hesitate to open new issues if anything else comes up!

dbortoluzzi commented 1 year ago

Thanks!
Issue closed.