nagyistoce / tin-man

Automatically exported from code.google.com/p/tin-man
GNU General Public License v3.0
0 stars 0 forks source link

Body.HJ1.MoveToWithGain not available in Mono (ubuntu 10.04) #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run monodevelop 2.4 installed from the badgerports repository
2. Create a project, and add the TinMan dll as a reference
3. User the Body.HJ1.MoveToWithGain method on any body part
4. Try to compile/run the code

What is the expected output? What do you see instead?
For the Body.HJ1.MoveToWithGain method monodevelop tells me that type 
TinMan.Hinge does not contain a definition for MoveToWithGain

ALL other methods/properties work!! including Body.RAJ1.DesiredSpeed and 
Body.LAJ1.LimitAngle(Angle.FromDegrees(10));

What version of the product are you using? On what operating system?
Ubuntu 10.04, Monodevelop 2.4
The same project works just fine in visual studio 2010 in windows 7

Original issue reported on code.google.com by faizan.k...@gmail.com on 9 Oct 2010 at 5:55

GoogleCodeExporter commented 9 years ago
Hi Faizan,

Unfortunately I don't currently have access to an Ubuntu installation, so I 
can't test this myself.  I hope to get one set up soon to better support TinMan 
for RoboCup competition environments.

{{MoveToWithGain}} is a C# Extension Method 
(http://msdn.microsoft.com/en-us/library/bb383977.aspx).  They were introduced 
in version 3.5 of the Microsoft C# compiler.  The version of Mono you are using 
may be older than that.  I read a blog post from 2007 saying that Mono supports 
extension methods 
(http://mareksafar.blogspot.com/2007/02/c-30-extension-methods.html) but that 
you had to pass the "langversion:linq" option to the compiler.  Unsure if 
that's still relevant.  According to Mono's release notes, extension methods 
have been supported since version 2.0, Oct 2008 
(http://www.mono-project.com/Release_Notes_Mono_2.0).

Note that in order for extension methods to work, you must have the correct 
'using' directive in your code.  Make sure that this line is at the top of the 
file (although it probably already is):

    using TinMan;

There is a workaround to your problem.  If you cannot use extension methods, 
then change your code to read like this:

    HingeControlFunctions.MoveToWithGain(Body.HJ1, newAngle, gain);

Could you please respond and let me know what version of Mono you are using?  
Please include the full output from this command:

    $ mono -V

Looking forward to your response.

Original comment by drewnoakes on 9 Oct 2010 at 2:25

GoogleCodeExporter commented 9 years ago
Could you also find out which compiler you are using?  It's likely to be either 
"smcs" or "dmcs".

More information here: http://www.mono-project.com/CSharp_Compiler

I'm downloading an Ubuntu ISO to try this out in the next day or two myself.  
Thanks for your help and your patience. 

Original comment by drewnoakes on 9 Oct 2010 at 2:33

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
On Ubuntu 10.04 I have this version of Mono:

drew@ubuntu:/etc$ mono -V
Mono JIT compiler version 2.4.4 (Debian 2.4.4~svn151842-1ubuntu4)
Copyright (C) 2002-2010 Novell, Inc and Contributors. www.mono-project.com
    TLS:           __thread
    GC:            Included Boehm (with typed GC)
    SIGSEGV:       altstack
    Notifications: epoll
    Architecture:  x86
    Disabled:      none

I too see the compilation error you are talking about in MonoDevelop and will 
continue investigating.

Note that the extension method appears in the intellisense window when you 
press Ctrl+Space.

Original comment by drewnoakes on 11 Oct 2010 at 2:23

GoogleCodeExporter commented 9 years ago
It turns out that Mono requires you to add a reference to `System.Core` in your 
project.

I just added that reference, and everything's running fine on my machine.

Please confirm that this solves the issue for you.  In the meantime, I'll make 
a note of this in the project's documentation somewhere.

Thank you.

Original comment by drewnoakes on 11 Oct 2010 at 2:30

GoogleCodeExporter commented 9 years ago
Sorry for the delayed response.... I tried updating my mono version to 2.8 and 
in doing so, have done something wrong, because monodevelop currently fails to 
start... ive been struggling to fix it the last couple days.

however, if you say it works now, then thats great! :) cant wait to develop 
using TinMan!

Ill double check as soon as i get monodevelop back up and working

Original comment by faizan.k...@gmail.com on 11 Oct 2010 at 4:25

GoogleCodeExporter commented 9 years ago
Sorry to hear that. Well, once you are up and running, you should just need 
that assembly reference.  I had a player waving at me, running through the 
MonoDevelop debugger.

Original comment by drewnoakes on 11 Oct 2010 at 4:31

GoogleCodeExporter commented 9 years ago
Just a note to capture the fact that I ran the same tests on Fedora 13 and had 
the same results -- if you add a reference to System.Core, all's well.

Note that Fedora 13 doesn't come bundled with Mono, though it's easy enough to 
add.  In fact, just add MonoDevelop, and it'll bring down Mono with it.  The 
version of Mono I tried was 2.6.something, and TinMan worked just fine.

I will try again with Fedora 14 once it has been released.

Original comment by drewnoakes on 12 Oct 2010 at 10:38

GoogleCodeExporter commented 9 years ago
Thanks! 
After adding System.Core to my project references the "TinMan.Hinge does not 
define method or extension MoveToGain .. " error is gone. 

Works fine on Mono 2.2.1 running on Ubuntu 10.04.

Original comment by osamakhn on 3 Nov 2010 at 9:04

GoogleCodeExporter commented 9 years ago
Glad you're up and running Osama.  Happy robo-coding :)

Original comment by drewnoakes on 4 Nov 2010 at 11:11