ArduPilot / MissionPlanner

Mission Planner Ground Control Station for ArduPilot (c# .net)
http://ardupilot.org/planner/
GNU General Public License v3.0
1.74k stars 2.37k forks source link

Linux & Mac fixes and packages #1148

Open ustramooner opened 8 years ago

ustramooner commented 8 years ago

I've been playing around with MissionPlanner to get it working for Linux. I've had some luck (not 100% yet) - but I'd like to share my work. It's not ready for merging yet, but would like to hear some feedback on it. I haven't dug any deaper into the hidden functionality and layout issues, but it's usable for me now.

https://github.com/ustramooner/MissionPlanner/tree/MONO-linux

The kind of stuff I've worked on is:

bigger issues i've come across:

currently left to do:

Looking forward to hearing some feedback!

meee1 commented 8 years ago

you seem to have got the major issues identified, i do know of some others mainly datagridview, and its lack of support for virtualmode.

meee1 commented 8 years ago

ive also tested running windows built mission planner under ubuntu and mint. it does run, and is usable.

meee1 commented 8 years ago

ive merged a few of your commits. the ones that made initial sence. There are a few commits that are corrections to other commits, which i skipped.

ustramooner commented 8 years ago

@meee1 thanks.

Main problem is still the Joystick - I've ordered one so i can work on it myself. once that part is done then i think we can run through the entire patch to get it merged.

Nitrosito commented 8 years ago

nice job !

We must have a GNU/Linux version of this software!

meee1 commented 8 years ago

if you install mono, and use the zip version of mission planner you can already use it.

minus a few features

kikislater commented 8 years ago

Last time I tried, Calibration screen does not works, because I think due to use of directx for this part of the software. Should it be solve ?

ustramooner commented 8 years ago

this patch is more about building on linux and packaging. there are a few minor issues fixed, but MP did already work

Nitrosito commented 8 years ago

This ocurred when open MisionPlaner10.exe with mono mplanet

meee1 commented 8 years ago

why do you have such an old version?

Nitrosito commented 8 years ago

ups! I donwload from google search "APM zip install" Where are the zip files?

kikislater commented 8 years ago

It's here : http://ardupilot.com/downloads/?did=83

Raviu8 commented 6 years ago

Hi, There are updates and I think this could be done. I'm not a developer but a Linux user. I've tried to get things working as much as possible to the least number of errors. Here are the steps - hoping it could help someone to get a native Linux version.

At first to get almost ready environment the best is to use the method here https://www.mono-project.com/download/stable/#download-docker Using any Linux system with docker. The docker image is based on debian 8 - good.

After running docker run -it mono:latest bash and getting it working for the 1st time you can Ctrl+D then run docker ps -a and get its name - the right most column - . Then you can run docker start -i Name-name to start the same docker image again.

You'll find that you've latest mono with the new msbuild package - xbuild is deprecated.

Run the following command to install needed packages; apt install libunwind8 openssl git wget apt-transport-https sudo

Then go here https://www.microsoft.com/net/learn/get-started-with-dotnet-tutorial and install .net-sdk, choose debian 8 and follow the steps. Then run apt install mono-complete

Then git clone MissionPlanner repo.

Then to build I've tried the different following approaches; but before trying another method clean the repo git clean -f -x -d; git reset --hard

dotnet restore
dotnet build

Alternatively you can run;

dotnet restore
msbuild MissionPlanner.sln /property:Configuration=Release

Yet another alternative method I've tried

nuget restore
msbuild MissionPlanner.sln /property:Configuration=Release

There are errors, of course, which need a lot of sln, csproj, json edits and, most probably, code changes. But, again, I'm not a developer, I just wanted to be make it easier for someone to start.

Raviu8 commented 6 years ago

Update: In an attempt to avoid the many file name case sensitivity issues. I've move the repo to a separate ntfs volume and mounted it like that; lowntfs-3g /ntfs.fs /mnt -o rw,ignore_case

This helped a lot to reveal underlying errors without "file not found" issues.

meee1 commented 6 years ago

you do realize that a exe compiled on windows will run on Linux with no changes don't you?

Raviu8 commented 6 years ago

@meee1 Yes, But a lot of bugs are existing. mono MissionPlanner.exe you mean.

It's:

  1. Very slow.
  2. Sluggish.
  3. Windows behave strange - vibrating randomly in strange way.
  4. On switching tabs - specially when there is active connection it takes a lot to update displayed data and freeze until done.
  5. Changing parameters in "Full parameter list" is a real pain. Specially when you've many to change. You have to switch away, then back again every while as the list is vanished. And the search box causes more bugs.
  6. No full parameter tree.
  7. Sometimes it just crash on establishing connection.
  8. Resizing sub-windows - I don't know exactly what it's called - is a big pain. Like when you need to make waypoints part larger in Flight Plan tab.
  9. When you click/switch to any button, menu, sub-menu, tab or so on it's initially unresponsive and you've to wait. This is impractical if you are in-flight.
  10. Sometimes you've to work much to know where exactly you've to click for the item to interact. Like changing waypoint type in Flight Plan -> waypoints.
  11. No user-friendly way to display the full text of options or description for some parameter in Full Parameter list.
  12. Click find in Advanced params to filter the output and try to go page down them mouse wheel -> pain.
  13. Bars in servo output display strange output, go on/off randomly. Other functions too have the same bug.
  14. You have to click on the needed area to have mouse wheel for example working on it. It doesn't work on another area on the same window unless you click there.

I have experienced other bugs but I cannot remember of all them.

Getting it to run with wine with dotnet stuff is overall better but very bad ugly eye-hurting fonts. Which I've worked a lot to make it better, just made it less worse.

Overall, it's not native. Other native mono-based projects works very fine recently on Linux.

Raviu8 commented 6 years ago

Update2: Actually, I don't think I can go further.

I found that I've to declare two variables to get things in the right direction and to avoid major failures.

export RuntimeIdentifier=$(dotnet --info | grep "RID" | awk '{print $2}')
export FrameworkPathOverride=/usr/lib/mono/4.6.1-api/

References: https://stackoverflow.com/questions/44770702/build-nuget-package-on-linux-that-targets-net-framework https://github.com/dotnet/netcorecli-fsc/wiki/.NET-Core-SDK-rc4#using-net-framework-as-targets-framework-the-osxunix-build-fails

This allowed me to see "native" errors.

I've created a small patch - below - against master that could get dotnet restore /p:Configuration=Release working. Actually, I know that just changing version numbers this way is not right, but I just want it to go forward and solve downgrade errors.

diff --git a/ExtLibs/BSE.Windows.Forms/BSE.Windows.Forms.csproj b/ExtLibs/BSE.Windows.Forms/BSE.Windows.Forms.csproj
index 0ebc401..156632d 100644
--- a/ExtLibs/BSE.Windows.Forms/BSE.Windows.Forms.csproj
+++ b/ExtLibs/BSE.Windows.Forms/BSE.Windows.Forms.csproj
@@ -82,8 +82,8 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
+    <Reference Include="Newtonsoft.Json, Version=10.0.1.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\Newtonsoft.Json.10.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
     </Reference>
     <Reference Include="System" />
     <Reference Include="System.Data" />
@@ -233,4 +233,4 @@
   <Target Name="AfterBuild">
   </Target>
   -->
-</Project>
\ No newline at end of file
+</Project>
diff --git a/ExtLibs/Comms/MissionPlanner.Comms.csproj b/ExtLibs/Comms/MissionPlanner.Comms.csproj
index 073e439..f6b98f7 100644
--- a/ExtLibs/Comms/MissionPlanner.Comms.csproj
+++ b/ExtLibs/Comms/MissionPlanner.Comms.csproj
@@ -11,7 +11,7 @@
   </PropertyGroup>

   <ItemGroup>
-    <PackageReference Include="log4net" Version="2.0.8" />
+    <PackageReference Include="log4net" Version="2.0.0" />
     <PackageReference Include="System.IO.Ports" Version="4.5.0" />
   </ItemGroup>

diff --git a/ExtLibs/Controls/MissionPlanner.Controls.csproj b/ExtLibs/Controls/MissionPlanner.Controls.csproj
index c4423bf..61e67c7 100644
--- a/ExtLibs/Controls/MissionPlanner.Controls.csproj
+++ b/ExtLibs/Controls/MissionPlanner.Controls.csproj
@@ -312,7 +312,7 @@
   </ItemGroup>
   <ItemGroup>
     <PackageReference Include="log4net">
-      <Version>2.0.8</Version>
+      <Version>2.0.0</Version>
     </PackageReference>
     <PackageReference Include="OpenTK">
       <Version>3.0.1</Version>
@@ -331,4 +331,4 @@
     </PackageReference>
   </ItemGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-</Project>
\ No newline at end of file
+</Project>
diff --git a/ExtLibs/GDAL/GDAL.NET.csproj b/ExtLibs/GDAL/GDAL.NET.csproj
index e8e067f..6f9470a 100644
--- a/ExtLibs/GDAL/GDAL.NET.csproj
+++ b/ExtLibs/GDAL/GDAL.NET.csproj
@@ -27,7 +27,7 @@

   <ItemGroup>
     <PackageReference Include="GDAL" Version="1.11.1" />
-    <PackageReference Include="log4net" Version="2.0.8" />
+    <PackageReference Include="log4net" Version="2.0.0" />
     <PackageReference Include="MP.GDAL.Native" Version="2.2.3" />
     <PackageReference Include="System.Drawing.Common" Version="4.5.0" />
     <ProjectReference Include="..\GMap.NET.Core\GMap.NET.Core.csproj" />
diff --git a/ExtLibs/Mavlink/MAVLink.csproj b/ExtLibs/Mavlink/MAVLink.csproj
index 59844d8..65ca1b6 100644
--- a/ExtLibs/Mavlink/MAVLink.csproj
+++ b/ExtLibs/Mavlink/MAVLink.csproj
@@ -21,7 +21,7 @@
   </ItemGroup>

   <ItemGroup>
-    <PackageReference Include="log4net" Version="2.0.8" />
+    <PackageReference Include="log4net" Version="2.0.0" />
   </ItemGroup>

diff --git a/ExtLibs/MissionPlanner.Gridv2/MissionPlanner.Gridv2.csproj b/ExtLibs/MissionPlanner.Gridv2/MissionPlanner.Gridv2.csproj
index d9db8aa..983d879 100644
--- a/ExtLibs/MissionPlanner.Gridv2/MissionPlanner.Gridv2.csproj
+++ b/ExtLibs/MissionPlanner.Gridv2/MissionPlanner.Gridv2.csproj
@@ -47,7 +47,7 @@
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="log4net">
-      <HintPath>..\..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
+      <HintPath>..\..\packages\log4net.2.0.0\lib\net45-full\log4net.dll</HintPath>
       <Private>false</Private>
     </Reference>
     <Reference Include="ProjNet">
diff --git a/ExtLibs/SimpleExample/SimpleExample.csproj b/ExtLibs/SimpleExample/SimpleExample.csproj
index 27d6655..9a3499e 100644
--- a/ExtLibs/SimpleExample/SimpleExample.csproj
+++ b/ExtLibs/SimpleExample/SimpleExample.csproj
@@ -36,8 +36,8 @@
     <StartupObject />
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
-      <HintPath>packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
+    <Reference Include="log4net, Version=2.0.0.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
+      <HintPath>packages\log4net.2.0.0\lib\net45-full\log4net.dll</HintPath>
     </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core" />
diff --git a/ExtLibs/SimpleGrid/MissionPlanner.SimpleGrid.csproj b/ExtLibs/SimpleGrid/MissionPlanner.SimpleGrid.csproj
index 4f633b5..632e85e 100644
--- a/ExtLibs/SimpleGrid/MissionPlanner.SimpleGrid.csproj
+++ b/ExtLibs/SimpleGrid/MissionPlanner.SimpleGrid.csproj
@@ -47,7 +47,7 @@
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="log4net">
-      <HintPath>..\..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
+      <HintPath>..\..\packages\log4net.2.0.0\lib\net45-full\log4net.dll</HintPath>
       <Private>false</Private>
     </Reference>
     <Reference Include="ProjNet">
diff --git a/ExtLibs/SvgNet/SvgNet.csproj b/ExtLibs/SvgNet/SvgNet.csproj
index dd55571..7198a24 100644
--- a/ExtLibs/SvgNet/SvgNet.csproj
+++ b/ExtLibs/SvgNet/SvgNet.csproj
@@ -20,4 +20,4 @@
   <ItemGroup>
     <PackageReference Include="System.Drawing.Common" Version="4.5.0" />
   </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/ExtLibs/Utilities/MissionPlanner.Utilities.csproj b/ExtLibs/Utilities/MissionPlanner.Utilities.csproj
index 3977ecd..ff683ba 100644
--- a/ExtLibs/Utilities/MissionPlanner.Utilities.csproj
+++ b/ExtLibs/Utilities/MissionPlanner.Utilities.csproj
@@ -15,7 +15,7 @@
     <PackageReference Include="BitMiracle.LibTiff.NET" Version="2.4.560" />
     <PackageReference Include="CSMatIO" Version="1.0.20" />
     <PackageReference Include="DirectShowLib" Version="1.0.0" />
-    <PackageReference Include="log4net" Version="2.0.8" />
+    <PackageReference Include="log4net" Version="2.0.0" />
     <PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
     <PackageReference Include="netDXF" Version="2.1.0" />
     <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
diff --git a/ExtLibs/solo/solo.csproj b/ExtLibs/solo/solo.csproj
index 9799de7..8d3be41 100644
--- a/ExtLibs/solo/solo.csproj
+++ b/ExtLibs/solo/solo.csproj
@@ -22,13 +22,14 @@
   </ItemGroup>

   <ItemGroup>
+    <PackageReference Include="System.Threading.ThreadPool" Version="4.0.10" />
     <PackageReference Include="Flurl" Version="2.7.1" />
     <PackageReference Include="Flurl.Http" Version="2.3.1" />
     <PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
-    <PackageReference Include="SSH.NET" Version="2016.1.0" />
+    <PackageReference Include="SSH.NET" Version="2013.0.0" />
     <PackageReference Include="System.Net.Http" Version="4.3.3" />
     <PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
   </ItemGroup>

-</Project>
\ No newline at end of file
+</Project>
diff --git a/MissionPlanner.csproj b/MissionPlanner.csproj
index af775b8..ae2344a 100644
--- a/MissionPlanner.csproj
+++ b/MissionPlanner.csproj
@@ -66,6 +66,7 @@
     <None Remove="packages\**" />
   </ItemGroup> 
   <ItemGroup>
+    <Reference Include="netstandard" />
     <Reference Include="Ionic.Zip.NetStandard">
       <HintPath>ExtLibs\Ionic.Zip.NetStandard.dll</HintPath>
     </Reference>
@@ -214,7 +215,7 @@
     <PackageReference Include="GeoJSON.Net" version="1.1.64" targetFramework="net462" />
     <PackageReference Include="IronPython" version="2.7.7" targetFramework="net462" />
     <PackageReference Include="IronPython.StdLib" version="2.7.7" targetFramework="net462" />
-    <PackageReference Include="log4net" version="2.0.8" targetFramework="net462" />
+    <PackageReference Include="log4net" version="2.0.0" targetFramework="net462" />
     <PackageReference Include="Microsoft.Win32.Registry" Version="4.5.0" />
     <PackageReference Include="MP.GDAL.Native" Version="2.2.3" />

@@ -2162,4 +2163,4 @@
   </ItemGroup>

-</Project>
\ No newline at end of file
+</Project>
diff --git a/SikRadio/SikRadio.csproj b/SikRadio/SikRadio.csproj
index a19056c..9c8ac27 100644
--- a/SikRadio/SikRadio.csproj
+++ b/SikRadio/SikRadio.csproj
@@ -238,7 +238,7 @@
   </ItemGroup>
   <ItemGroup>
     <PackageReference Include="log4net">
-      <Version>2.0.8</Version>
+      <Version>2.0.0</Version>
     </PackageReference>
     <PackageReference Include="System.Drawing.Common">
       <Version>4.5.0</Version>
@@ -258,4 +258,4 @@
   <Target Name="AfterBuild">
   </Target>
   -->
-</Project>
\ No newline at end of file
+</Project>

One small change is add <Reference Include="netstandard" /> to MissionPlanner.csproj, This solved many errors as of this issue https://github.com/dotnet/standard/issues/542

Now most of the errors are about types and such programming things :)

Hoping someone can continue.

kikislater commented 6 years ago

Well resumed @Raviu8 I will add : 15 - No GPS information in main screen : https://github.com/ArduPilot/MissionPlanner/issues/1292 Could be workaround by adding item in HUD

16 - Gauges display problem capture du 2018-07-26 08-05-27 May be related to this : https://github.com/ArduPilot/MissionPlanner/issues/79

17 - Simulation not usable

18 - Auto log analysis crash

Mission Planner constantly use 16% of CPU (BaseThread in process) on i7 4790k which is a lot. On slow computer like intel atom tablet or laptop even with i5 3rd generation, artefacts in panels appears. I found that it runs better with latest mono version, but still have some problems and slow interface. I use mono 5.12.0.260-1 at this time.

atmadeep commented 5 years ago

Hi, It seems to me that these problems are persistent. I have Ubuntu 18.04. I tried it with mono (mono-complete). The features which are a "Minus" are essential to my project. Can someone please answer my following queries:

  1. How is 'Mission planner 1.x' different than 'APM 2.x'? The list of options in Mission planner is different than the ones in APM. Can you please provide me a list or guide which I can use as a lookup table?

  2. Is there a way to run Mission planner 1.x version 'natively' on ubuntu/Linux? As most of the tutorials which I see, they use Mission planner v/s APM, and would like to use it for my project.

  3. I cannot use SITL on ubuntu with APM 2.x. The dependencies are broken/ mismatched between component viz. pymavlink, dronekit-sitl and mavproxy. Can you please provide a solution or a guide which I can use to create mission for my quadcopter for aerial imagery?

kikislater commented 5 years ago

Why not using qgroundcontrol : https://github.com/mavlink/qgroundcontrol ? No need to build it, there is appimage. And it runs natively instead of MP.

kschoelpple commented 4 years ago

I'm simply using Wine. MP works straight away and have been using it like that for the past two years. (on 18.04 and now on 20.04) However, there are some limitations. More info: https://appdb.winehq.org/objectManager.php?sClass=version&iId=38641&iTestingId=107520