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?
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?
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?
@@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.
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
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.
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
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.
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.
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'.
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"
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?
@@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
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?
Screen resolution is too high; it's hard to see what's on the screen in this video.
Can we simulate this for multiple quadcopters such that each quadcopter gets its individual waypoints automatically from MATLAB script or text file...
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?
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?
@@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.
@@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?
@@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.
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
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.
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
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.
@@MrIampete Thank you for your response. I was able to fix that issue by using wsock32.lib.
@@NandithaU Hello, can you tell me who can I fix the same problem?
Where will I use wsock32.lib ???
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.
I'm not sure what would cause that, maybe you can post more info over on the AP forum or discord.
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'.
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"
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'
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?
you need to use the custom version of the toolbox in the ArduPilot repository, ardupilot.org/dev/docs/sitl-with-MATLAB.html
@@MrIampete i have these files in the repository...do i need to run these files before running the main simulation?
@@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
Have you ever resolve this problem, I also find this problem, thanks