REVrobotics / CANBridge

Generic CAN Bridge emulating FRC netcomm CAN driver for connecting a PC to the CAN Bus with WPILib 2020+ and SPARK MAX (FW 1.5.0 or higher) or other drivers, currently only supported in Windows.
Other
11 stars 5 forks source link

New Error: No Such Thing as Publish? #11

Open adimehrotra opened 4 years ago

adimehrotra commented 4 years ago

Tried to tun ./gradlew publish and got this:

./gradlew publish

FAILURE: Build failed with an exception.

BUILD FAILED in 850ms

adimehrotra commented 4 years ago

Platform Information: I'm on a MAC and have VS Code installed with WPILIB 2020

willtoth commented 4 years ago

Note that this is not a roboRIO project, so importing it using the import tool will likely have adverse effects on the gradle settings.

This is set up as a 'vendor dependency'. The right way to build this is to simply open the folder from VS Code.

This project also explicitly does not build for roboRIO and is designed for non-RIO platforms. I have never used the build environment for Mac so I don't know what would be required there.

ThadHouse commented 4 years ago

As Will said above, this is a vendor library, and is explicitly something that should not be sent through the wpilib importer. We just have no way of detecting the difference from VS Code, so it will still prompt, but it definitely will fail if you actually try to import.

Anything specific you are trying to do with this?

adimehrotra commented 4 years ago

Ooh okay this I did not know about WPILIB importer.

Im trying to get a computer to control some spark maxes for a project - right now I'm on a MAC later I want to use a Jetson TX1. Want to use CAN because I want to use the features like velocity control and etc!

Any tips on how to use the library after I build it?

adimehrotra commented 4 years ago

Update: I got this to say "Build Successful" for both the gradle build and gradle publish scripts - but I don't see an output under ~/releases/maven what does this build do what am I supposed to be able to do after I've built it.

I built this on a Jetson TX1 running Ubuntu 18.04

willtoth commented 4 years ago

The outputs will be under the project directory. /build/repos

The output will be a vendor dep that can be installed the same way as other projects.

You can also cross compile this one Windows/Linux, gradleRIO includes some tasks to install the correct toolchain.

I don't have a good example code for using this project yet so to be honest it may be a bit tough to get and running. The best example is probably the test here https://github.com/REVrobotics/CANBridge/blob/master/src/test/cpp/main.cpp

This code should be created from a WPILib VS Code Robot project targeting aarch64

adimehrotra commented 4 years ago

I really don't have enough experience with this to understand how to install it - I navigated in that directory to CANBridge-cpp and do I need to install this with MAVEN? do I need to get the source files? Like how do I install this so I may use it? Sorry for all the questions

adimehrotra commented 4 years ago

Also if I were to use this in like a project not being deployed to a roborio with the spark max c++ API, would I import through WPILIB the spark max API, and etc, where would I install the API?

adimehrotra commented 4 years ago

I guess let's make this super simple: I want to make a ROS node that controls a bunch of SparkMAXs on USB-to-CAN.

willtoth commented 4 years ago

Understood. So one problem here is that this project only currently has a Windows driver. We need to add a SocketCAN driver as well for it to be compatible on Linux.

adimehrotra commented 4 years ago

Aw man

dfiel commented 4 years ago

I am interested in doing the same as @bumblebeerobotics, creating a ROS node to control some SPARK MAX controllers utilizing a USB to CAN adapter on Linux. Is there a timeline for introducing SocketCAN/Linux support?

willtoth commented 4 years ago

We don't have a timeline at the moment. The biggest thing is adding a driver type to this project for SocketCAN, everything else should be able to build for Linux/Raspi/aarch64.

The Spark Max will already work as a generic SocketCAN device, it just needs a udev rule (as well as the can/socketcan/gs_usb driver). Right now this udev rule works, but needs some improvement:

ACTION=="add", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a30e", RUN+="/sbin/modprobe gs_usb" RUN+="/bin/sh -c 'echo 0483 a30e ff > /sys/bus/usb/drivers/gs_usb/new_id'"

The closest thing is probably this: https://github.com/ThadHouse/HALSIM_SocketCAN

@ThadHouse

dfiel commented 4 years ago

Can you explain that repository you linked? The readme is just some WPI boilerplate. From some rummaging around in the repository, is it just a SocketCAN wrapper for FRC?