Skip to content
Marian Kleineberg edited this page Mar 22, 2019 · 5 revisions

Control via Focbox

(Connected to power supply and USB?)

Note that in the launch files in our codebase, the vesc node is already started. If you use these, you don't need to follow the instructions below.

VESC Tool

The focbox can be setup and adjusted via the VESC tool. To be able to use the steering servo, it is necessary to set SERVO_OUT_ENABLE to 1 in conf_general.h of the firmware. The easiest way is to flash a firmware, in which it is already enabled:

  1. Open the VESC tool
  2. Click on "Firmware" in the left column
  3. Select "Show non-default firmwares"
  4. Select VESC_servoout.bin
  5. Update firmware (click on the "Download"-Button next to the progress bar)

VESC Ros Node

To control the car via a console window, follow these steps:
First terminal:

  1. cd ~/catkin_ws/
  2. catkin_make (optional)
  3. source devel/setup.bash (optional)
  4. cd src/vesc/
  5. roslaunch vesc_driver vesc_driver_node.launch

Second terminal:

  1. cd ~/catkin_ws/
  2. rostopic list (optional, to see all possible commands)

Now choose one of the possible commands, e.g.:

  • rostopic pub -r 20 /commands/servo/position -- std_msgs/Float64 1
    (value between 0 and 1, 0.5 is "wheels straight")
  • rostopic pub -r 20 /commands/motor/speed -- std_msgs/Float64 3000
    (value is wheel rpm; value positive => positive speed; value positive => positive speed)

where -r 20 means, that the message is published with a frequency of 20 Hz.