ModalAI Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    1. Home
    2. cy208183395
    C
    • Profile
    • Following 0
    • Followers 0
    • Topics 6
    • Posts 12
    • Best 0
    • Controversial 0
    • Groups 0

    cy208183395

    @cy208183395

    0
    Reputation
    6
    Profile views
    12
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    cy208183395 Unfollow Follow

    Latest posts made by cy208183395

    • Help!!! When flying can't control speed

      VelocityNedYaw fails when it controls the code of flight distance and speed, no matter how to adjust the parameters, it will fly at the same speed. And the orientation of the header at initialization is random rather than fixed to the north.

      #!/usr/bin/env python3
      
      import asyncio
      from mavsdk import System
      from mavsdk.offboard import (PositionNedYaw, VelocityNedYaw, OffboardError)
      
      async def run():
      drone = System()
      await drone.connect(system_address="udp://:14551")
      
      print("Waiting for drone to connect...")
      async for state in drone.core.connection_state():
          if state.is_connected:
              print(f"-- Connected to drone!")
              break
      
      # print("Waiting for drone to have a global position estimate...")
      # async for health in drone.telemetry.health():
      #     if health.is_global_position_ok and health.is_home_position_ok:
      #         print("-- Global position estimate OK")
      #         break
      print("-- Arming")
      await drone.action.arm()
      # need delay!!
      await asyncio.sleep(5)
      
      print("-- Setting initial setpoint")
      await drone.offboard.set_position_ned(PositionNedYaw(0.0, 0.0, 0.0, 0.0))
      
      print("-- Starting offboard")
      try:
          await drone.offboard.start()
      except OffboardError as error:
          print(f"Starting offboard mode failed with error code: {error._result.result}")
          print("-- Disarming")
          await drone.action.disarm()
          return
      
      # async def print_z_velocity(drone):
      #     async for odom in drone.telemetry.position_velocity_ned():
      #         print(f"{odom.velocity.north_m_s} {odom.velocity.down_m_s}")
      
      # asyncio.ensure_future(print_z_velocity(drone))
      
      # print("-- Go 0m North, 0m East, -10m Down within local coordinate system")
      # await drone.offboard.set_position_velocity_ned(
      #     PositionNedYaw(0.0, 0.0, -10.0, 0.0),
      #     VelocityNedYaw(0.0, 0.0, -1.0, 0.0))
      # await asyncio.sleep(10)
      
      # print("-- Go 10m North, 0m East, 0m Down within local coordinate system")
      # await drone.offboard.set_position_velocity_ned(
      #     PositionNedYaw(50.0, 0.0, -10.0, 0.0),
      #     VelocityNedYaw(1.0, 0.0, 0.0, 0.0))
      # await asyncio.sleep(20)
      
      print("-- Go 0m North, 0m East, -0.5m Down within local coordinate system")
      await drone.offboard.set_position_velocity_ned(
          PositionNedYaw(0.0, 0.0, -0.5, 0.0),
          VelocityNedYaw(0.0, 0.0, -1.0, 0.0))
      await asyncio.sleep(5)
      
      print("-- Go 0.5m North, 0m East, -0.5m Down within local coordinate system")
      await drone.offboard.set_position_velocity_ned(
          PositionNedYaw(0.5, 0.0, -0.5, 90.0),
          VelocityNedYaw(0.2, 0.0, 0.0, 90.0)
          )
      await asyncio.sleep(5)
      
      # print("-- Go 0.5m North, 0m East, -0.5m Down within local coordinate system")
      # await drone.offboard.set_position_velocity_ned(
      #     PositionNedYaw(0.3, 0.3, -0.5, 90.0),
      #     VelocityNedYaw(0.0, 0.2, 0, 0.0))
      # await asyncio.sleep(5)
      
      
      
      
      
      
      # await drone.action.land()
      
      
      try:
          await drone.action.land()
      except:
          print("Failed to land")
      
      print("-- Disarming")
      try:
          await drone.action.disarm()
      except:
          print("Disarming failed")
      
      
      
      # print("-- Stopping offboard")
      # try:
      #     await drone.offboard.stop()
      # except OffboardError as error:
      #     print(f"Stopping offboard mode failed with \
      #             error code: {error._result.result}")
      if __name__ == "__main__":
          # Run the asyncio loop
          # asyncio.run(run())
          loop = asyncio.get_event_loop()
          loop.run_until_complete(run())
      
      posted in VOXL 2 velocitynedyaw
      C
      cy208183395
    • offboard_position_velocity_ned.py

      VelocityNedYaw fails when it controls the code of flight distance and speed, no matter how to adjust the parameters, it will fly at the same speed. And the orientation of the header at initialization is random rather than fixed to the north.

      #!/usr/bin/env python3

      import asyncio
      from mavsdk import System
      from mavsdk.offboard import (PositionNedYaw, VelocityNedYaw, OffboardError)

      async def run():

      drone = System()
      await drone.connect(system_address="udp://:14551")
      
      print("Waiting for drone to connect...")
      async for state in drone.core.connection_state():
          if state.is_connected:
              print(f"-- Connected to drone!")
              break
      
      # print("Waiting for drone to have a global position estimate...")
      # async for health in drone.telemetry.health():
      #     if health.is_global_position_ok and health.is_home_position_ok:
      #         print("-- Global position estimate OK")
      #         break
      print("-- Arming")
      await drone.action.arm()
      # need delay!!
      await asyncio.sleep(5)
      
      print("-- Setting initial setpoint")
      await drone.offboard.set_position_ned(PositionNedYaw(0.0, 0.0, 0.0, 0.0))
      
      print("-- Starting offboard")
      try:
          await drone.offboard.start()
      except OffboardError as error:
          print(f"Starting offboard mode failed with error code: {error._result.result}")
          print("-- Disarming")
          await drone.action.disarm()
          return
      
      # async def print_z_velocity(drone):
      #     async for odom in drone.telemetry.position_velocity_ned():
      #         print(f"{odom.velocity.north_m_s} {odom.velocity.down_m_s}")
      
      # asyncio.ensure_future(print_z_velocity(drone))
      
      # print("-- Go 0m North, 0m East, -10m Down within local coordinate system")
      # await drone.offboard.set_position_velocity_ned(
      #     PositionNedYaw(0.0, 0.0, -10.0, 0.0),
      #     VelocityNedYaw(0.0, 0.0, -1.0, 0.0))
      # await asyncio.sleep(10)
      
      # print("-- Go 10m North, 0m East, 0m Down within local coordinate system")
      # await drone.offboard.set_position_velocity_ned(
      #     PositionNedYaw(50.0, 0.0, -10.0, 0.0),
      #     VelocityNedYaw(1.0, 0.0, 0.0, 0.0))
      # await asyncio.sleep(20)
      
      print("-- Go 0m North, 0m East, -0.5m Down within local coordinate system")
      await drone.offboard.set_position_velocity_ned(
          PositionNedYaw(0.0, 0.0, -0.5, 0.0),
          VelocityNedYaw(0.0, 0.0, -1.0, 0.0))
      await asyncio.sleep(5)
      
      print("-- Go 0.5m North, 0m East, -0.5m Down within local coordinate system")
      await drone.offboard.set_position_velocity_ned(
          PositionNedYaw(0.3, 0.0, -0.5, 90.0),
          VelocityNedYaw(0.2, 0.0, 0.0, 0.0)
          )
      await asyncio.sleep(5)
      
      print("-- Go 0.5m North, 0m East, -0.5m Down within local coordinate system")
      await drone.offboard.set_position_velocity_ned(
          PositionNedYaw(0.3, 0.3, -0.5, 90.0),
          VelocityNedYaw(0.0, 0.2, 0, 0.0))
      await asyncio.sleep(5)
      
      
      
      
      
      
      # await drone.action.land()
      
      
      try:
          await drone.action.land()
      except:
          print("Failed to land")
      
      print("-- Disarming")
      try:
          await drone.action.disarm()
      except:
          print("Disarming failed")
      
      
      
      # print("-- Stopping offboard")
      # try:
      #     await drone.offboard.stop()
      # except OffboardError as error:
      #     print(f"Stopping offboard mode failed with \
      #             error code: {error._result.result}")
      if __name__ == "__main__":
      # Run the asyncio loop
      # asyncio.run(run())
      loop = asyncio.get_event_loop()
      loop.run_until_complete(run())
      
      posted in VOXL 2
      C
      cy208183395
    • RE: Starting the HITL mode for VOXL2

      @Eric-Katzfey
      So, am I because I didn't connect the JST connector to the VOXL2 J18 port.
      The original type-c connection is not able to read data?

      posted in VOXL 2
      C
      cy208183395
    • Starting the HITL mode for VOXL2

      Hello, I followed the tutorial(https://docs.modalai.com/voxl2-PX4-hitl/) to set up the simulation environment and disabled px4 and qvio.:
      2024-07-19 15-57-48屏幕截图.png

      Then I ran

      voxl-px4-hitl
      

      and used the command

      qshell dsp_hitl status
      

      to query the status of the HITL driver:

      2024-07-19 15-57-00屏幕截图.png

      Why is there no data?

      I am connecting to VOXL2 via type-c to adb. Could this be related to the issue? (I did not connect the JST connector to the VOXL2 J18 port)

      If the pins of VOXL2 are not connected, please tell me where the J18 port of VOXL2 (VOXL2 Starlight) is located. Thank you very much for your help!

      posted in VOXL 2
      C
      cy208183395
    • RE: Regarding the issue of recovering voxl-suite!

      @tom

      1. I connected to my personal WiFi, but this WiFi cannot connect to the external network.
        2024-07-13 14-35-36屏幕截图.png

      2024-07-13 14-35-08屏幕截图.png

      1. Which tutorial should I follow? Please point it out for me. Thank you!
      posted in VOXL 2
      C
      cy208183395
    • Regarding the issue of recovering voxl-suite!

      First, I encountered issues while installing the Docker environment on VOXL2. The main problem occurred with the sudo apt update command. After executing this command, it showed that I couldn't fetch Docker from the Docker website. I suspect it is a network issue with VOXL2, so I tried changing the source. However, I still got stuck due to Python3 issues. I then attempted to uninstall Python3, and finally, the following problem appeared
      (the version number after voxl-suite disappeared) :

      2024-07-12 22-36-03屏幕截图.png

      Therefore, I have two issues that need your kind assistance:

      1. Is the network problem here related to an inability to connect to the external network?
      2. How can I recover voxl-suite? Should I reflash the SDK?
        Honestly, I appreciate your previous help that has gotten me this far, but since I am a beginner, I hope you can explain it to me carefully. Thank you very much for your assistance!
      posted in VOXL 2
      C
      cy208183395
    • RE: Regarding building the mavsdk-python Docker image.

      @Eric-Katzfey Yes, I currently have Docker installed on my host machine, but it is not installed on the voxl2.

      posted in VOXL 2
      C
      cy208183395
    • RE: Regarding building the mavsdk-python Docker image.

      @Eric-Katzfey

      I encountered a new problem. After I installed Docker as you suggested this website .I successfully started and ran it:

      1.png
      &&
      2.png

      But when I followed the tutorial to download the repository and executed the command

      ./build-image.sh
      

      it showed "command not found":
      4.png

      I tried setting the environment variable, but it still didn't work.

      Then I continued to watch the tutorial video, entered the voxl2 shell, navigated to the folder /data/docker/mavsdk, and executed the command ./run-docker.sh. It still showed that the docker command was not found:
      6.png

      This means that whether I am in the voxl2 shell environment or not, the docker command is not found.

      Can you help me? I followed your requirements, but I am stuck here. Please help me, thank you!

      posted in VOXL 2
      C
      cy208183395
    • RE: Regarding controlling drone flight using code

      @Eric-Katzfey said in Regarding controlling drone flight using code:

      @cy208183395 I would take a look at the documentation for MAVSDK. It has a python interface available and can do drone control.

      Thanks for your reply

      posted in Starling & Starling 2
      C
      cy208183395
    • RE: Regarding building the mavsdk-python Docker image.

      @Eric-Katzfey said in Regarding building the mavsdk-python Docker image.:

      @cy208183395 The voxl-configure-docker-support script is only used on VOXL. For VOXL 2 you need to install Docker and not run that script.
      Thank you very much for your reply

      posted in VOXL 2
      C
      cy208183395