We built a joystick system for Ogai Lab to make our EV-COMS funny. Tested Vehicle: COMS3.
Click to view the video:
Having fun controling the EV COMS in our Lab with Joystick!
This ROS package had been tested on ROS Kinect on Ubuntu 16.04
We use Lawicel CANUSB(http://www.can232.com) in our Lab to fulfill CAN_Bus communication
We tested two kinds of Joystick(Logitech F310 and Logitech F710)
The test tool for Lawicel CANUSB
sudo apt-get install can-utils
Install joystick drivers package for your ROS:
sudo apt-get install ros-kinetic-joystick-drivers
If failed to find the package "ros-kinect-joystick-drivers":
sudo apt-cache search ros-kinetic
sudo apt-get update
sudo apt-get install ros-kinetic-joystick-drivers
Download the code:
# In your cankin_ws/
cd src/
git clone https://github.com/wolfram2012/joystick2coms.git
Build:
# In you catkin_ws/src/
cd ..
catkin_make
You got it !
Make sure you have sourced setup.bash
in your catkin_ws. Then run the roslaunch to make CAN-Bus and Joystick ready:
roslaunch joystick2coms joy2coms.launch
Maybe you will be asked for passward for opening the CANUSB. Don't worry, be happy.
If there is an error of:
- Roslaunch got a 'No such file or directory' error while attempting to run:terminator -x
Just install terminator, it's a good terminal:
sudo apt-get install terminator
If there is an error of:
- [ERROR]: Couldn't open joystick /dev/input/js0. Will retry every second.
That you just forget to plugin your joystick
When you roslaunch successfully, you will find a reconfig window:
You can set the CAN-Bus ID to send and regulate the rate of CAN-Bus(Defalut:Stop)Then you can control our COMS (Control Program Version: BC_v1.2)
If you want to check the CAN message using CAN-utils:
candump slcan0
Module Number | Name | Function |
---|---|---|
1 | Throttle Command | Accel Pedal |
2 | Brake Command | Brake Pedal |
3 | Steering Mode | Pressed:Large Angle Mode; Eased: Old Woman Mode |
4 | Lamps Command | ←:left; →:right; ↓:double flash; ↑:cancel |
5 | Gear Command | A:drive; B:neutral; Y:reverse |
6 | Steering Command | Steering Wheel |
If you want to check the trajectory on Rviz:
roslaunch joystick2coms coms2trajectory.launch
You are welcome.