robotdotnet / WPILib

DotNet implementation of WPILib for FIRST Robotics Competition (FRC)
27 stars 8 forks source link

Status for 2018 #122

Open ThadHouse opened 6 years ago

ThadHouse commented 6 years ago

Hello everyone.

I'm sorry to have to do this, but I don't think I'm going to have the time to get this project updated for the 2018 season. I will try this week, but between work and school, and other projects I have just been swamped. The only part I know I won't get to is CAN Talon support, as the CTRE library has went through a massive rewrite and I definitely will not have time to rewrite that and get this working.

If someone wants to attempt to pick this up I will happily help get all the build infrastructure tooling set up, but its more work then just rerunning a build.

Sorry. I will try again for 2019 if there is interest. -Thad

msoucy commented 6 years ago

I'm interested in trying to get some of the updates in place. What kind of infrastructure is needed? What are the actual tasks that need to be done? I saw a list of changes to the C++ and Java versions, but there's more than just that correct?

ThadHouse commented 6 years ago

I'll try an upload a new version of the mono runtime tonight or tomorrow. That will be the first thing that will be required. Then mostly just testing. I pushed a few updates to the wpilib repo to make some of the newer things in the hal work. So once I have mono updated, basically the plugin will need to be updated to install the new version of mono and to check for the 2018 image. Once that happens, just testing. Once that happens I can just tag the repos and they automatically publish to nuget.

For ctre, you'll have to wait for their release to happen this weekend, and then basically write all the native entry points and the new wrapper. None of the old code for can talon works anymore.

msoucy commented 6 years ago

I've been attempting to make some of the user-visible changes for 2018, but it turns out that NetworkTables also needs to be redone... Taking a look at that now, but I'm not sure how much I'll be able to do.

EDIT: I don't have the time or sanity to port a year's worth of ntcore changes into the NetworkTables project, especially in two days. Sorry.

danlucka commented 6 years ago

How much work will be required to get this going? Maybe I can help? I was looking forward to using RobotDotNet this season.

ThadHouse commented 6 years ago

I got enough done to publish a 2018 extension. So anybody who wants to use this in 2018, it now runs. However, it has not been tested at all with any real code, just enough so that it boots.

Note it is missing 2 things. First is AutoSPI, and by extension the ADXRS_540 gyro. To fix this, the new HAL calls will need to be added, and then the new high level wrapper copied from java and rewritten.

CANTalon is the other thing missing. Basically, the whole support for that gets to start from scratch. Downloading the native library from CTRE, writing the P/Invoke wrappers, and then writing the wrapper from the new phoenix lib.

Also it is missing any new WPILib functionality for 2018. NetworkTables is still at the 2017 version, so any of the new functionality from that will need a NetworkTables rewrite.

danlucka commented 6 years ago

Thank you for all your work! If I can help, please contact me (email is on my profile).

monkeyman22 commented 6 years ago

just enough so that it boots.

I can't even get it to boot. Have things in the FRCUpdateSuite changed to cause this?


 ERROR  1  ERROR Unhandled exception instantiating robot TestRobot System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'HAL.Base.HALPWM' threw an exception. ---> System.TypeLoadException: Method not found: /usr/local/frc/lib/libwpiHal.so: undefined symbol: HAL_GetLoopTiming
  at NativeLibraryUtilities.EmbeddedLibraryLoader.NativeLibraryUtilities.ILibraryLoader.GetProcAddress (System.String name) [0x0003a] in <21c5e15597a4426c9cc1fa218c578b77>:0 
  at NativeLibraryUtilities.NativeDelegateInitializer.SetupNativeDelegates[T] (NativeLibraryUtilities.ILibraryInformation library) [0x00061] in <21c5e15597a4426c9cc1fa218c578b77>:0 
  at HAL.Base.HALPWM..cctor () [0x00005] in <b1f21a72175b4957ba6da0c85704dc48>:0 
   --- End of inner exception stack trace ---
  at (wrapper managed-to-native) System.Object:__icall_wrapper_mono_generic_class_init (intptr)
  at WPILib.SensorBase.CheckPwmChannel (System.Int32 channel) [0x00000] in <82907561960840d7a1620c22c16e0887>:0 
  at WPILib.PWM..ctor (System.Int32 channel) [0x00006] in <82907561960840d7a1620c22c16e0887>:0 
  at WPILib.SafePWM..ctor (System.Int32 channel) [0x00000] in <82907561960840d7a1620c22c16e0887>:0 
  at WPILib.PWMSpeedController..ctor (System.Int32 channel) [0x00000] in <82907561960840d7a1620c22c16e0887>:0 
  at WPILib.Talon..ctor (System.Int32 channel) [0x00000] in <82907561960840d7a1620c22c16e0887>:0 
  at WPILib.RobotDrive..ctor (System.Int32 leftMotorChannel, System.Int32 rightMotorChannel) [0x0002b] in <82907561960840d7a1620c22c16e0887>:0 
  at TestRobot.TestRobot..ctor () [0x00006] in <b2c17c18e0684056890c25887e29d6da>:0 
  at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in <29fdfdbc814140639aff38b424f30780>:0 
   --- End of inner exception stack trace ---
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00014] in <29fdfdbc814140639aff38b424f30780>:0 
  at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic) [0x000a8] in <29fdfdbc814140639aff38b424f30780>:0 
  at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00009] in <29fdfdbc814140639aff38b424f30780>:0 
  at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00027] in <29fdfdbc814140639aff38b424f30780>:0 
  at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00020] in <29fdfdbc814140639aff38b424f30780>:0 
  at System.Activator.CreateInstance (System.Type type) [0x00000] in <29fdfdbc814140639aff38b424f30780>:0 
  at WPILib.RobotBase.Main (System.Reflection.Assembly robotAssembly, System.Type robotType) [0x000ab] in <82907561960840d7a1620c22c16e0887>:0  at   at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00014] in <29fdfdbc814140639aff38b424f30780>:0 
  at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic) [0x000a8] in <29fdfdbc814140639aff38b424f30780>:0 
  at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00009] in <29fdfdbc814140639aff38b424f30780>:0 
  at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00027] in <29fdfdbc814140639aff38b424f30780>:0 
  at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00020] in <29fdfdbc814140639aff38b424f30780>:0 
  at System.Activator.CreateInstance (System.Type type) [0x00000] in <29fdfdbc814140639aff38b424f30780>:0 
  at WPILib.RobotBase.Main (System.Reflection.Assembly robotAssembly, System.Type robotType) [0x000ab] in <82907561960840d7a1620c22c16e0887>:0   WPILib: Main, File: C:\projects\robotdotnet-wpilib\WPILib\RobotBase.cs, Line: 129
Caller: TestRobot.Program.Main () [0x00000] in <b2c17c18e0684056890c25887e29d6da>:0 

 Error at WPILib: Main, File: C:\projects\robotdotnet-wpilib\WPILib\RobotBase.cs, Line: 129 
 Caller: TestRobot.Program.Main () [0x00000] in <b2c17c18e0684056890c25887e29d6da>:0  
 : ERROR Unhandled exception instantiating robot TestRobot System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'HAL.Base.HALPWM' threw an exception. ---> System.TypeLoadException: Method not found: /usr/local/frc/lib/libwpiHal.so: undefined symbol: HAL_GetLoopTiming 
   at NativeLibraryUtilities.EmbeddedLibraryLoader.NativeLibraryUtilities.ILibraryLoader.GetProcAddress (System.String name) [0x0003a] in <21c5e15597a4426c9cc1fa218c578b77>:0  
   at NativeLibraryUtilities.NativeDelegateInitializer.SetupNativeDelegates[T] (NativeLibraryUtilities.ILibraryInformation library) [0x00061] in <21c5e15597a4426c9cc1fa218c578b77>:0  
   at HAL.Base.HALPWM..cctor () [0x00005] in <b1f21a72175b4957ba6da0c85704dc48>:0  
    --- End of inner exception stack trace --- 
   at (wrapper managed-to-native) System.Object:__icall_wrapper_mono_generic_class_init (intptr) 
   at WPILib.SensorBase.CheckPwmChannel (System.Int32 channel) [0x00000] in <82907561960840d7a1620c22c16e0887>:0  
   at WPILib.PWM..ctor (System.Int32 channel) [0x00006] in <82907561960840d7a1620c22c16e0887>:0  
   at WPILib.SafePWM..ctor (System.Int32 channel) [0x00000] in <82907561960840d7a1620c22c16e0887>:0  
   at WPILib.PWMSpeedController..ctor (System.Int32 channel) [0x00000] in <82907561960840d7a1620c22c16e0887>:0  
   at WPILib.Talon..ctor (System.Int32 channel) [0x00000] in <82907561960840d7a1620c22c16e0887>:0  
   at WPILib.RobotDrive..ctor (System.Int32 leftMotorChannel, System.Int32 rightMotorChannel) [0x0002b] in <82907561960840d7a1620c22c16e0887>:0  
   at TestRobot.TestRobot..ctor () [0x00006] in <b2c17c18e0684056890c25887e29d6da>:0  
   at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) 
   at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in <29fdfdbc814140639aff38b424f30780>:0  
    --- End of inner exception stack trace --- 
   at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00014] in <29fdfdbc814140639aff38b424f30780>:0  
   at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic) [0x000a8] in <29fdfdbc814140639aff38b424f30780>:0  
   at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00009] in <29fdfdbc814140639aff38b424f30780>:0  
   at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00027] in <29fdfdbc814140639aff38b424f30780>:0  
   at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00020] in <29fdfdbc814140639aff38b424f30780>:0  
   at System.Activator.CreateInstance (System.Type type) [0x00000] in <29fdfdbc814140639aff38b424f30780>:0  
   at WPILib.RobotBase.Main (System.Reflection.Assembly robotAssembly, System.Type robotType) [0x000ab] in <82907561960840d7a1620c22c16e0887>:0  at   at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00014] in <29fdfdbc814140639aff38b424f30780>:0  
   at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic) [0x000a8] in <29fdfdbc814140639aff38b424f30780>:0  
   at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00009] in <29fdfdbc814140639aff38b424f30780>:0  
   at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00027] in <29fdfdbc814140639aff38b424f30780>:0  
   at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00020] in <29fdfdbc814140639aff38b424f30780>:0  
   at System.Activator.CreateInstance (System.Type type) [0x00000] in <29fdfdbc814140639aff38b424f30780>:0  
   at WPILib.RobotBase.Main (System.Reflection.Assembly robotAssembly, System.Type robotType) [0x000ab] in <82907561960840d7a1620c22c16e0887>:0  
 WARNING: Robots don't quit! 
 Error: Could not instantiate robot TestRobot! 
Brzzrs commented 6 years ago

I know I'm bringing up a dead topic, but I'm interested in this mainly for the NetworkTables, any hints on the difficulty of updating the ntcore implementation to work for 2018? I'm open to all help, suggestions, and anything in general, thanks!

ThadHouse commented 6 years ago

It would need a complete rewrite. From the interface to the native library to the user facing code itself. I had started on it last summer, so I have a bit of the user facing side, but not much else.

Brzzrs commented 6 years ago

Would you consider working with me to update it? this would allow huge advantages for our driver-station as the java framework for user interfaces is absolute trash, the idea of using actual c# push buttons and such would highly benefit my drive team. Let me know, thanks! (all I need from the library is to get NetworkTables running as a client on my driver-station PC)

On 17 April 2018 at 19:19, Thad House notifications@github.com wrote:

It would need a complete rewrite. From the interface to the native library to the user facing code itself. I had started on it last summer, so I have a bit of the user facing side, but not much else.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/robotdotnet/WPILib/issues/122#issuecomment-382187988, or mute the thread https://github.com/notifications/unsubscribe-auth/AbYFktFeeQiguOo_EKf2uf3VRn_vS00Uks5tpnh0gaJpZM4RP-Ei .

ThadHouse commented 6 years ago

@Brzzrs Can you create an issue in the NetworkTables repo? I'm actually working on getting the wrappers around NT4 implemented in the newnt4 branch. Nothings been pushed, but should be soon

jrmoreno1 commented 1 year ago

Current status?