Why is RoboRIO not receiving correct Can messages/Packets?

We have Ras Pi sending messages over the CanBus, they are being received and printed out but the data is wrong. When we open the REV Hardware Client we can verify they are being sent correctly. The message that the RoboRio prints out does not match the message that the REV Hardware Client is able to receive.

   private class UpdateThread implements Runnable {
        @Override
        public void run() {
            CANData canData = new CANData();

            while (true) {
                if (pi.readPacketNew(0b0000010000, canData)) {
                    BitSet data = BitSet.valueOf(canData.data);

                    cache = "";
                    for (int x = 0; x < data.length(); x++) {
                        cache += (data.get(x)) ? "1" : "0";
                    }

                   System.out.println(cache);
                }
                Timer.delay(0.2);
            }
        }
    }

team member from the same team here
we tracked the error down to the bits in each byte being sent through backwards (probably)
the bytes came through ok, but the bits in each one were backwards.
we’re working to fix this, but any help / advice on how to do this would also be appreciated

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.