TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #401 · 15 дек.

Функция asyncio.wait() это еще один способ вызвать множество асинхронных задач. Она работает в нескольких режимах. 1. Самый простой - ждем завершения всех задач async def main(): tasks = [asyncio.create_task(do_it(i)) for i in range(10)] done, pending = await asyncio.wait( tasks, return_when=asyncio.ALL_COMPLETED ) for task in done: try: print(task.result()) except Exception as e: print(e) Очень похоже на gather, но работает не так. ▫️возвращает не результаты, а два сета с объектами Task у которых можно забрать результат через task.result() если они в списке done ▫️не гарантирует порядок результатов так как оба объекта это set ▫️не выбрасывает исключение когда оно появляется, а сохраняет его в Task. Исключение появится когда попробуете забрать резултьтат. 2. Ждем завершения первой задачи, даже если там ошибка. async def main(): tasks = [asyncio.create_task(do_it(i)) for i in range(3)] done, pending = await asyncio.wait( tasks, return_when=asyncio.FIRST_COMPLETED ) # в done может быть несколько задач! for task in done: try: print(task.result()) except Exception as e: print(f"Fail: {e}") # Оставшиеся задачи в pending, как правило, нужно отменить, иначе они будут продолжать работать for task in pending: task.cancel() В сете done будут таски которые успели завершится, причем как успешно так и нет. 3. До первой ошибки. Тоже самое, но с аргументом FIRST_EXCEPTION done, pending = await asyncio.wait( tasks, return_when=asyncio.FIRST_EXCEPTION ) Функция завершается как только первая задача упадет с ошибкой. Учтите, что в любом случае done вы можете обранужить несколько задач, как с ошибками так и успешные. ↗️ Полный листинг примеров здесь #async

Hashtags

Резултати

Пронајдени 3 слични објави

Пребарај: #ros2

当前筛选 #ros2清除筛选
GitHub Trends

@githubtrending · Post #15156 · 20.09.2025 г., 13:00

#python#llm#multiagent#robotics#ros2#zenoh OpenMind's OM1 is an open-source, modular AI system that lets you build and control smart robots like humanoids, quadrupeds, and educational bots. It works with many types of sensors (cameras, LIDAR, web data) and supports physical actions like moving and talking. OM1 is easy to use with Python, supports many hardware platforms via plugins, and offers tools for debugging and voice/vision AI integration. You can quickly create custom AI agents that interact naturally and upgrade them for different robots. This helps you develop advanced, human-friendly robots that can navigate, communicate, and perform tasks autonomously or with your commands. It runs on common platforms and supports full autonomy with real-time mapping and control. This system benefits you by simplifying robot development, enabling flexible AI-powered behaviors, and supporting a wide range of hardware and applications. https://github.com/OpenMind/OM1

GitHub Trends

@githubtrending · Post #15616 · 15.04.2026 г., 12:00

#cplusplus#hap#mid_360#ros#ros2 Livox ROS Driver 2 connects your Livox LiDARs like HAP and Mid360 to ROS (Noetic) or ROS2 (Foxy/Humble/Jazzy) on matching Ubuntu versions. Clone the repo in a workspace/src folder, build Livox-SDK2, then run ./build.sh with your ROS version, and launch with roslaunch or ros2 launch files from launch_ROS1/ROS2 folders—edit JSON configs for IP, ports, frequency (up to 100Hz), and formats. This lets you quickly test and visualize point clouds in RViz for robotics development, saving time on setup and debugging. https://github.com/Livox-SDK/livox_ros_driver2

GitHub Trends

@githubtrending · Post #15225 · 15.10.2025 г., 13:00

#mdx#bilateral_teleoperation#force_feedback#genesis#gravity_compensation#humanoid_robot#imitation_learning#machine_learning#moveit2#mujoco#open_source#openarm#python#reinforcement_learning#robot#robot_arm#robotics#ros2#teleoperation OpenArm is a special robot arm that helps with physical AI research. It has 7 degrees of freedom, which means it can move like a human arm. This makes it good for tasks that involve touching or moving things safely around people. The robot is open-source, meaning anyone can build, modify, and use it. This is helpful because it makes advanced robotics available to more people, like researchers and students, without costing too much. A complete system with two arms costs about $6,500, which is much cheaper than similar robots. https://github.com/enactic/openarm