![]() |
CAN Bus Java Documentation with Custom Sensors
Hi guys,
Is there anyone who can provide information on any WPIlib documentation on communicating with custom sensors (IR, Ultrasonic, LIDAR, etc.) between the Robo-rio and the CAN Bus? Our team can't seem to find any specific documentation on this stuff other than some basic send/receive methods. Thanks in advance! David |
Re: CAN Bus Java Documentation with Custom Sensors
There aren't any simple wrapper classes for general-purpose CAN communication in WPILib, mostly because every device is a little different. However, you can technically call the FRCNetworkCommunication functions directly. It would look something like this, but you need to fill in the blanks for device-specific things. I'm also not sure if the message tokenization stuff will interfere with it.
PHP Code:
|
Re: CAN Bus Java Documentation with Custom Sensors
Thanks!
Do you know if there's anyway to actually use the data from the sensors (as like a variable) and manipulate it? Or can we only just print these messages? |
Re: CAN Bus Java Documentation with Custom Sensors
Thomas's example demonstrates how to send and receive CAN frames (nice job!). What goes into and out of the frames depends on what CAN device you want to talk to. Wpilib uses this to implement support for ...
CAN Talon SRX CAN Jaguar ...but you can write your own logic to support other CAN devices (As long as they are legal). Did you have something specific in mind? Also if you're just trying to get more analog channels easily, you can wire to the analog input of the Talon SRX and grab its decoded analog value over CAN bus. See software reference manual for details. |
Re: CAN Bus Java Documentation with Custom Sensors
Quote:
Good point. Our team was playing around with reading data from custom sensors (not the motor controllers) like LIDAR, IR etc. I guess we have to write our own logic to support this? |
Re: CAN Bus Java Documentation with Custom Sensors
Are these CAN sensors or analog sensors?
|
| All times are GMT -5. The time now is 22:29. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi