Our team has made the switch to use Java this year and we are using RobotBuilder to create our command-based program. We are planning on using the Talon SRX wired via the CAN bus, but noticed that only PWM Talon SRX is an option in RobotBuilder. I’m assuming we can’t use RobotBuilder with a CAN wired Talon SRX?
You are correct that RobotBuilder doesn’t support the Talon SRX in CAN mode currently. However, there are lots of things it doesn’t support, like I2C accelerometers, counters, etc. This doesn’t keep you from using those objects in a RobotBuilder project. As long as you put the objects outside of the // BEGIN AUTOGENERATED CODE and // END AUTOGENERATED CODE robotbuilder won’t mess with it.
Has anyone tried to use RobotBuilder to lay out their drive system with PWM controllers and add code to convert it to use CAN devices? It doesn’t seem possible without totally rewriting RobotMap.[ch]pp.
I managed to get the RobotBuilder sources off of TeamForge (https://usfirst.collab.net/sf/projects/robotbuilder/) and adjusted some of its configuration files to add CAN TalonSRX objects. I tried making a test C++ project with it and it compiled properly in Eclipse. The patch file is attached in case anyone is interested.
Can you post how you were able to download the source and how one might apply the patch? We’re using the RobotBuilder for the first time but we program in Java. We were able to get things working with a 4 motor CAN system by using CANJaguar in the builder and then changing the imports from CANJaguar to CANTalon. Not the best since we have to do this every time we generate code. There are ways we could overcome this using hooks in Eclipse, but your solution would be ideal.
If you haven’t seen them yet, the tutorials on the RobotBuilder from WPI are AMAZINGLY helpful. You can find the first in the series of 6 here…
…my favorite is the second in the series where they show all the amazing stuff you can do in test mode if you’ve used the robot builder.
To check out the sources you would create an account on the TeamForge site you get to when you click above. Once you do switch to the source code tab and you’ll see the robotbuilder project listed below. In the checkout command column will be a git command for cloning from the commandline (assuming you installed the git command line utilities. Netbeans, Eclipse, or SmartGit would probably just want the bit starting with “ssh:” . Finally this is a maven based project so you may need to have maven setup to work in your ide.
One other step - in addition to making the changes in the patch file above you would probably also want SOME icon on the pallete. I simply went into src/main/resources/icons and coppied the “CAN Jaguar.png” file to “CAN TalonSRX.png” and that made an icon show up in the pallete (it still looks like a jaguar and if you care you can create one that looks like a TalonSRX instead)
I managed, with some help from Jeff and Riftware, to get access to the source code for the 2014 version of the RobotBuilder. Based on work done by others before me I’ve updated the RobotBuilder to include the TalonSRX in the CAN controllers section. You can checkout the project from our git Repo…
I included an updated png that says Talon on it as well as updates to the html document. Props to Jeff who provided the bulk of the code to make things go, but I did vary from his original change.
Hope that helps those of use that are using TalonSRX controllers with CAN.
There were some mistakes in the code I posted to github. I’ve updated the branch with the corrections (code generation was right, documentation was inverted)…
…please note that you need to use the jar files in the artifacts folder. That was the most expedient way to make them available for now. Still new to git/github. Also note that it’s a maven project so you’ll need a maven plugin for eclipse if you want to work with the source.
Sorry to revive this thread, but is it just me, or is the CANTalon not LiveWindow Sendable? If so, what do you guys do for test mode? Because the livewindow is awesome for testing stuff but it would totally suck if it doesn’t support CANTalons
We had to work around RobotBuilder to add a custom object we wanted to be our Speed controller. We first set up a RobotDrive and 4 SpeedContollers normally and generated code. Then we removed all that code from BEGIN/END of RobotMap. You also have to remove RobotDrive from RobotBuilder or it will keep regenerating it. So we couldn’t modify speed controller ports or RobotDrive parameters from RobotBuilder any more but the code is available for hand editing. Biggest problem is new devices don’t know that PWM 0-4 (in our case) are taken.
But you can still work with it. I suspect taking 4 Talon’s out and retyping them to TalonSRX could be handled the same way if you can’t work out how to use the patches that have been provided in this thread.
Thanks for the info. on the CAN Talon not being LiveWindow sendable.
Came back to post about a problem we experienced. Our yml file got corrupted during a merge on github. I have an updated version of the jar files in our repo that will give you some hints about what went wrong. Before it would just throw a null pointer exception and not load the file.
You can get the latest jars here…
If anyone wants to post the pieces on how they got it into LiveWindow I can look into getting it into the builder after the build end date. Not enough time right now…