Commit Graph

19 Commits

Author SHA1 Message Date
Thomas Clark
ed0df5432f Fixed CANJaguar::GetOutputVoltage for negative voltages
Previously, negative output voltages were unpacked incorrectly.

Now, they're requested as percentages, unpacked, and then scaled
in software based on the bus voltage.  The output voltage and
bus voltage shouldn't ever be out of sync, since they're in
the same message.

Change-Id: I745fffd0faa6cbaab967240271e6cfa8653212e2
2014-07-29 15:25:35 -04:00
Thomas Clark
d66bafb687 CANJaguar::Disable stops periodic setpoints
Calling CANJaguar::Disable() now makes NetComms stop periodic
setpoint messages, so the motor actually stops until EnableControl()
is called again.

Change-Id: Ib4eb4ad5f729be5c74e799f02ed000511de1e03d
2014-07-29 11:09:37 -04:00
thomasclark
f958b65ba6 CANJaguar can be disabled [artf2647]
The CANJaguar class now stores a controlEnabled flag.  When disabled, it
won't verify the control mode, which involves sending enable messages.

Change-Id: I8baa48eec31de6b4d3fee2b5a074320542a1bbef
2014-07-25 12:59:47 -04:00
thomasclark
c81d510ebe CANJaguar::ChangeControlMode marks the controlmode as unverified
This previous caused a bug where the Jaguar would sometimes
behave as if it were in the wrong mode, even when everything was
verfied.

Change-Id: Id5b96e0f7e64066eaaa0e5be4ba53fca76ba0703
2014-07-24 13:54:01 -04:00
thomasclark
b0369342e9 Fixed some bugs with CANJaguar verification in C++
Change-Id: I3f17c090e26c6019523eb92eb47714464aa01baf
2014-07-23 15:22:26 -04:00
Jonathan Leitschuh
f27e16735f Adds resource tracking to CANJaguar in C++
Change-Id: I0d562af5e9f4f50f79d61db15ff25eaf4dae00d5
2014-07-21 14:36:43 -04:00
Jonathan Leitschuh
fc0eb4e956 Adds/updates the documentation for the CANJaguar Classes for C++ & Java.
Also removes private unused methods in Java and an unused constructor.

Change-Id: I0a810a4839a5c6752872d947239dd9305141672e
2014-07-17 14:36:51 -04:00
thomasclark
f566c087dc Fix a few wrong messages in CANJaguar
Change-Id: I8e1a8fa9b0c20a40e060a8319dbbd605173dc407
2014-07-16 10:27:17 -04:00
thomasclark
b97d2eb0c3 Fixed periodic voltage status message
Previously, the voltage was requested as a percentage and decoded as
a number of volts, which resulted in values being scaled wrong. The
correct message is requested now.

Change-Id: I5e81c7a4a2e2698f2e8a84ba747217e0e14f7676
2014-07-02 12:14:49 -04:00
thomasclark
5bd546f1fd CANJaguar uses periodic status updates [artf2621]
All status data is now in 3 messages automatically sent periodically
by the Jaguar, removing the need to send several hundred requests
every second.

The C++ integration test was also updated to be more robust against
timing problems.

Change-Id: I13bacc6c8173ea1a2291a96ad3bd80ff5b18d16f
2014-07-01 12:02:44 -04:00
thomasclark
f380d9c102 Corrected the number of CAN init attempts in C++
Change-Id: Ic86e922b977653515593947d2b3b413c83e056ac
2014-06-26 17:26:56 -04:00
thomasclark
1cafebc5a3 CANJaguar waits in the constructor for initial status data
The C++ and Java CANJaguar constructors now wait up to 50 ms for the status
data to arrive at least one time.  They break early if it arrives sooner.

This allows status getters to always work immediately after the object is
constructed.

Change-Id: I4a1f1538837c11b24d45e87251743b6c106ddefb
2014-06-26 11:54:58 -04:00
thomasclark
abed665c64 CANJaguar in C++ now requires control mode configuration data at compile time
For example, it's no longer possible to compile a program that uses position
control without specifying a position reference, or one that uses an encoder
as a position reference without specifying a CPR.  This eliminates a lot of
common CANJaguar mistakes.

Change-Id: I2b5fe1e2884cf3a0f9d5ccd233da4c2c9c1cff4c
2014-06-25 15:47:16 -04:00
thomasclark
1bbf350811 Java CANJaguar changes
Change-Id: Icb15b1b140816e44caec36cda2466a64e5cabf1d

Change-Id: Idd6aebefe03acff5ab211a5e3e73a29563601515
2014-06-24 16:22:25 -04:00
Jonathan Leitschuh
de96577602 Adds an error if you try to use SetVoltageRampRate in the wrong control mode
Change-Id: I9d6cfd81236f91fdb94defb3fc5ac3f0350daea7
2014-06-24 11:01:52 -04:00
thomasclark
21b58aebd8 Updated CAN Jaguar for C++
All configuration messages are now verified.

All status messages are requested as periodic messages and retrieved on-demand.

All relevant configuration data is re-sent after a power cycle.

Change-Id: I3322d8b41d6fe058ad404b781f54e9c6153981bf
2014-06-21 12:59:07 -04:00
thomasclark
85dff7d2ec New netcomms .so and headers.
CAN isn't fully working yet, but this change is necessary to compile for the v9 image.

Change-Id: Ife99686a7e7a9979c95ec7a395d597011090fa37
2014-06-16 10:24:48 -04:00
thomasclark
58021f7397 Removed analog and digital module numbers
AnalogModule and DigitalModule classes still exist, at least until they are
refactored into the classes that use them.

Change-Id: I5544d5418822f19d54ba0a5d651e64fad8b7b10d
2014-06-13 17:57:40 -04:00
thomasclark
bb50f4b134 C++ testing
Made a toplevel directory for C++ and C++ tests

Change-Id: I4bc2074a7036ec7fe79568b411637a5bee9eb5b3

Added the C++ testing framework and one test

Change-Id: I1e80a1e16b251a49666820a9d4c8caa025da9785
2014-06-02 15:36:18 -04:00