Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   Visual Studio (http://www.chiefdelphi.com/forums/showthread.php?t=149795)

joeojazz 08-02-2016 10:02 PM

Visual Studio
 
Our team wants to switch to c++ and program in Visual Studio we where wondering if it is possible to program and deploy code to the robo-rio from Visual Studio. We have found c sharp templates to deploy from Visual Studio but not a c++ one.

marshall 08-02-2016 10:37 PM

Re: Visual Studio
 
Quote:

Originally Posted by joeojazz (Post 1599514)
Our team wants to switch to c++ and program in Visual Studio we where wondering if it is possible to program and deploy code to the robo-rio from Visual Studio. We have found c sharp templates to deploy from Visual Studio but not a c++ one.

I'll bite... why Visual Studio?

balloman 08-02-2016 11:50 PM

Re: Visual Studio
 
Quote:

Originally Posted by marshall (Post 1599517)
I'll bite... why Visual Studio?

I assume because of how nice it is to code in Visual Studio

JamesTerm 08-03-2016 12:02 AM

Re: Visual Studio
 
Quote:

Originally Posted by marshall (Post 1599517)
I'll bite... why Visual Studio?

The Visual Studio compiler is much more powerful and easier to use... well easier for someone who uses it professionally on a daily basis. :)

Maybe I'm bias, but it has been so much preferred that we went through the trouble of writing all the code simulated in visual studio environment, and then porting it over later. As debugging remotely is a real nightmare and 10x more time consuming (that 10x is a conservative estimate, probably more time considering all the times we had to redeploy code).

Last I checked, visual studio 2013 and above can have an Arduino IDE environment, but I've never tested that yet. It could work, but then the trick would be to get WPI libraries built as well... or link to them from VS. I think it can be done, but I haven't really had a chance to pursue this.

Jaci 08-03-2016 12:20 AM

Re: Visual Studio
 
If you want to get the code to work nicely with Visual Studio, you're going to have to do a bit of manual work.

Step 1: Get the WPILib and NT-Core header files. These will usually be under ~/wpilib

You can add these to your project's header files include directory. This should fix up any false-alarm syntax errors you might be getting.

Step 2: Configure your build system.

This is a bit difficult. First, you need the FRC C++ toolchain installed and added to your PATH.

Next, you have to use some form of build system to send over and compile your code. You can use the one provided by WPILib for this.
WPILib uses ANT to build and deploy code. Visual Studio supports ANT builds and you can find instructions here. Reconfigure your build targets to use this build system, and you should be set to go. If you're stuck looking for what tasks to run, run a simple build in eclipse and take note of what tasks are executed, that should help you.

Keep in mind this is only to build and deploy code. The code you build will not run on your system, as it's built for an ARM target (the roborio)

marshall 08-03-2016 07:26 AM

Re: Visual Studio
 
Quote:

Originally Posted by JamesTerm (Post 1599529)
The Visual Studio compiler is much more powerful and easier to use... well easier for someone who uses it professionally on a daily basis. :)

I had no idea Visual Studio was a compiler. ::rtm::

That's sarcasm folks, calm down. For the record, I work in a plethora of development environments as well as compilers as a professional on a daily basis. They are all equally crap, except for VIM, which isn't technically an IDE but there are enough enhancements to it these days that I count it as one. ;)

Jaci 08-03-2016 07:40 AM

Re: Visual Studio
 
Quote:

Originally Posted by marshall (Post 1599542)
I had no idea Visual Studio was a compiler. ::rtm::

That's sarcasm folks, calm down. For the record, I work in a plethora of development environments as well as compilers as a professional on a daily basis. They are all equally crap, except for VIM, which isn't technically an IDE but there are enough enhancements to it these days that I count it as one. ;)


Visual Studio isn't a compiler, but MSVC is :P

I think the main attraction to Visual Studio is just how $@#$@#$@#$@# good IntelliSense is. The only system I've seen come close is JetBrains' code completion, but IntelliSense still tops it IMHO.

marshall 08-03-2016 07:50 AM

Re: Visual Studio
 
Quote:

Originally Posted by Jaci (Post 1599546)
Visual Studio isn't a compiler, but MSVC is :P

I think the main attraction to Visual Studio is just how $@#$@#$@#$@# good IntelliSense is. The only system I've seen come close is JetBrains' code completion, but IntelliSense still tops it IMHO.

It does have some perks. If I were writing in a consistent language then I could see where that would be very useful. I've been using VS lately with some work in Unity and on the CTRE HERO board.

ozrien 08-03-2016 11:30 AM

Re: Visual Studio
 
Quote:

Originally Posted by Jaci (Post 1599546)
...I think the main attraction to Visual Studio is just how $@#$@#$@#$@# good IntelliSense is...

+1 this.

JamesTerm 08-03-2016 11:57 AM

Re: Visual Studio
 
Quote:

Originally Posted by marshall (Post 1599542)
I had no idea Visual Studio was a compiler. ::rtm::

Yes, Visual Studio Compiler...
That's my wording and I'm sticking with it! ;)

Also... in your critique of Visual Studio... did you try it with the Visual Assist plugin? This really makes a difference.

ahaltom 08-03-2016 01:06 PM

Re: Visual Studio
 
Quote:

Originally Posted by Jaci (Post 1599533)
If you want to get the code to work nicely with Visual Studio, you're going to have to do a bit of manual work.

Step 1: Get the WPILib and NT-Core header files. These will usually be under ~/wpilib

You can add these to your project's header files include directory. This should fix up any false-alarm syntax errors you might be getting.

Step 2: Configure your build system.

This is a bit difficult. First, you need the FRC C++ toolchain installed and added to your PATH.

Next, you have to use some form of build system to send over and compile your code. You can use the one provided by WPILib for this.
WPILib uses ANT to build and deploy code. Visual Studio supports ANT builds and you can find instructions here. Reconfigure your build targets to use this build system, and you should be set to go. If you're stuck looking for what tasks to run, run a simple build in eclipse and take note of what tasks are executed, that should help you.

Keep in mind this is only to build and deploy code. The code you build will not run on your system, as it's built for an ARM target (the roborio)

Thanks for the reply, Jaci! It's great to see that someone has worked with robot code in Visual Studio. I've used Visual Studio a TON in college, so it really appeals to me more than Eclipse does (IntelliSense is amazing:cool:). I'll work with Joeojazz and try to get Visual Studio working properly. You may hear from Team 5712 in the next few days if we hit any bumps in the road, but we'll give it a shot!

Alex
Team 5712 Mentor

Rangel(kf7fdb) 08-03-2016 01:33 PM

Re: Visual Studio
 
If you are interested in using C#, RobotDotNet seems to be a pretty solid solution: https://www.chiefdelphi.com/forums/s...d.php?t=140972

marshall 08-04-2016 12:16 AM

Re: Visual Studio
 
Quote:

Originally Posted by JamesTerm (Post 1599576)
Yes, Visual Studio Compiler...
That's my wording and I'm sticking with it! ;)

Also... in your critique of Visual Studio... did you try it with the Visual Assist plugin? This really makes a difference.

I am by no means a critic, just a cynic. I'll check out the plugin though. Always open to new stuff.

JamesTerm 08-04-2016 09:03 AM

Re: Visual Studio
 
Quote:

Originally Posted by marshall (Post 1599681)
I'll check out the plugin though. Always open to new stuff.

For reference:
http://www.wholetomato.com/

I've been using this since around 2002... (It works on all versions of visual studio)


All times are GMT -5. The time now is 10:27 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi