ArduPilot MATLAB SITL demo

Поделиться
HTML-код
  • Опубликовано: 8 июн 2020
  • This is a demo of connecting ArduPilot SITL to a MATLAB physics back end
    github.com/ArduPilot/ardupilo...
  • НаукаНаука

Комментарии • 24

  • @muammarsaeed6291
    @muammarsaeed6291 4 года назад

    That looks great. thank you for sharing. I am wondering if I can control the input data to ArduPilot to just be the exact location of the drone in time during the flight and the output is the profile motion of the drone in time such as acceleration. Do you suggest me a different autopilot or simulation to do so?

  • @TheAnachronist
    @TheAnachronist 2 года назад +1

    Screen resolution is too high; it's hard to see what's on the screen in this video.

  • @hussainali9840
    @hussainali9840 3 года назад

    Can we simulate this for multiple quadcopters such that each quadcopter gets its individual waypoints automatically from MATLAB script or text file...

  • @mkmabl
    @mkmabl 3 года назад

    This is awesome. Thanks! I have the plumbing all working from SITL on my ubuntu box to Matlab on my Wondos PC: I start SIM_multicopter.m and then I start SITL in ArduCopter dir as, "sim_vehicle.py --map --console -f JSON:10.0.0.173". SITL starts and I see some streaming data in the matlab console so all is good. HOWEVER I am having trouble arming because of an undefined FRAME_TYPE that is only a problem when I start with the -f option above. I'm only about 1 week into this codebase and toolchain so I'm not very knowledgeable, but it seems as though the matlab code is affecting the FRAME_TYPE in SITL via the connection magic. I tried to edit/load params from the SITL console where I can see the FRAME_TYPE is indeed, "undefined" but thus far it doesn't seem to stick. Any ideas?

    • @mkmabl
      @mkmabl 3 года назад

      UPDATE: I did get it to work by (re)loading params...I think the issue is related to the -f option being both for the JSON spec and the frame type specification on the command line. Any advice? is there some frame_type spec in on the matlab side or elsewhere that I need to set so as not to need to reload params each time?

    • @MrIampete
      @MrIampete  3 года назад +1

      @@mkmabl You should just be able to set the FRAME_CLASS and FRAME_TYPE params and they will stick so long as its a valid combination.

    • @JolehisyAcevedoMedina
      @JolehisyAcevedoMedina 5 месяцев назад

      @@mkmabl How did you do it, I'm trying and I'm getting this problem since "f" is used for both JSON and frame_type. Any advice?

    • @JolehisyAcevedoMedina
      @JolehisyAcevedoMedina 5 месяцев назад

      ​@@mkmabl I have got it. For those who need it, I explain how to do it. First you go to the "console" tab then click on "parameter" and click on "editor". You look for the parameter "FRAME_CLASS and FRAME_TYPE" and put the class and configuration you want. FRAME_CLASS = 1 is a "Quadricopter" and FRAME_TYPE = 1 is a quadcopter in "X" configuration.
      All the best.

  • @gsbmadrid
    @gsbmadrid 3 года назад +1

    Hello sir,
    I have a problem each time I put the instruction "$ ../Tools/autotest/sim_vehicle.py -f json:127.0.0.1 --map --console" on Cygwin. On MavProxy it appears "waiting from heartbeat from tcp 127.0.0.1:5760" and on the console "link 1 down". Do you know the reason why this can be? Thank you very much

    • @MrIampete
      @MrIampete  3 года назад +1

      I would guess that its not finding the json backend. You might have to add some exceptions to the firewall. The AP discord or discuss if a better place to ask for help.

  • @NandithaU
    @NandithaU 3 года назад +1

    Hi.
    I am running into issues when I run SIM_Multicopter. m example. The issue is in executing the MEX file statement in SITL_connector.m function call.
    Error Msg:
    "Error using mex
    gcc: error: ws2_32.lib: No such file or directory"
    Any help is appreciated

    • @MrIampete
      @MrIampete  3 года назад

      Hum, not sure, mex stuff can get tricky, it was tested on 2020a both windows and Linux. Might be worth deleting the mex files, it should then try and re-compile. Also worth checking what compiler MATLAB is using.

    • @NandithaU
      @NandithaU 3 года назад

      ​@@MrIampete Thank you for your response. I was able to fix that issue by using wsock32.lib.

    • @vahewolf8686
      @vahewolf8686 Год назад

      @@NandithaU Hello, can you tell me who can I fix the same problem?
      Where will I use wsock32.lib ???

  • @maxvillaverdemejia6341
    @maxvillaverdemejia6341 3 года назад

    Hi men, thanks for share your work.I really have a problem using my simulink model. Parameters like velocity and position can update into the SITL but i have some issue with the attitude. The attitude its the only parameter that takes the same value whatever the input in the send block. I already try with the examples in simulink of the heli or the rover but i am having the same issue. Sorprising the SIM_multicopter example run perfectly.

    • @MrIampete
      @MrIampete  3 года назад

      I'm not sure what would cause that, maybe you can post more info over on the AP forum or discord.

  • @vahewolf8686
    @vahewolf8686 Год назад

    Hi, I have Issues when I run SIM_Multicopter. m :
    Error using mex
    Error in SITL_connector (line 12)
    mex -O -outdir ../tcp_udp_ip_2.0.6 ../tcp_udp_ip_2.0.6/pnet.c ws2_32.lib -DWIN32
    check that you are in the correct current folder, and
    check the spelling of 'C:\Users\OneDrive\Desktop\tcp_udp_ip_2.0.6\pnet.c'.

  • @sugarman418
    @sugarman418 3 года назад

    How the "Console" window run? when I execute ./Tools/autotest/sim_vehicle.py -v ArduPlane -f quadplane, i got error message "RiTW: Window access not found, logging to /tmp/ArduPlane.log"

    • @MrIampete
      @MrIampete  3 года назад

      are you running a X server such as VcXsrv? You also need to set your DISPLAY environment variable in WSL. You can test it with 'xeyes'

  • @hussainali9840
    @hussainali9840 3 года назад

    when i run the code for SIM_multicopter on MATLAB, I dont get any results rather MATLAB is busy forever...I have downloaded TCP/UDP/IP toolbox...I'm running this code on Windows OS...kindly guide what to do?

    • @MrIampete
      @MrIampete  3 года назад

      you need to use the custom version of the toolbox in the ArduPilot repository, ardupilot.org/dev/docs/sitl-with-MATLAB.html

    • @hussainali9840
      @hussainali9840 3 года назад

      ​@@MrIampete i have these files in the repository...do i need to run these files before running the main simulation?

    • @MrIampete
      @MrIampete  3 года назад

      @@hussainali9840 In that case I would guess its a network issue. You might need to add exceptions to the windows firewall. The discord is the best place to get help, ardupilot.org/dev/docs/ardupilot-discord-server.html#ardupilot-discord-server

    • @wenlongxie-uo7ew
      @wenlongxie-uo7ew 5 месяцев назад

      Have you ever resolve this problem, I also find this problem, thanks