https://github.com/michdo93/robotcar_controller
https://github.com/michdo93/robotcar_controller
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/michdo93/robotcar_controller
- Owner: Michdo93
- Created: 2020-08-01T15:30:38.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-06-18T14:51:23.000Z (about 5 years ago)
- Last Synced: 2025-01-14T06:19:50.380Z (over 1 year ago)
- Language: CMake
- Size: 33.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# robotcar_controller
Is used on the control computer respectively operating computer to control the [RobotCar](https://github.com/Michdo93/robotcar). At first you have to make sure that the roscore is running and the [robotcar-pkg](https://github.com/Michdo93/robotcar-pkg) is publishing informations.

## How to Use
As recommended in the [ROS Tutorials](https://wiki.ros.org/ROS/Tutorials) the control computer respectively operating computer should run the roscore. So at first open a terminal window and execute `roscore`. After that open a second terminal window and run `rosrun robotcar_controller controller.py`.
The String variable `robot_host` uses the hostname of one RobotCar. As example it could be `robotcar`.
The following table shows the needed key's for controlling the RobotCar:
| Key | Function |
|--------------------------------------------- | ------------------------------|
| W | forward acceleration or break if driving backwards |
| A | left steering or turning back to neutral if steering right |
| S | backward acceleration or break if driving forwards |
| D | right steering or turning back to neutral if steering left |
| Q | stops the motor / engine |
| E | turn the steering to neutral |
| CTRL + C | Quits the program |
## Publisher Informations
The Controller is publishing to the Control Node of the [RobotCar](https://github.com/Michdo93/robotcar). It uses the [pynput library](https://pynput.readthedocs.io/en/latest/) for key down and key up. So if a key is pressed the RobotCar will active change its behavious as the driver wants. If not key is pressed the Controller will slow down the speed and the steer turns slowly back to neutral. Means it will permanently published to Control Node.
| Topic Address | Message Type |
|--------------------------------------------- | ------------------------------|
|robot_host + /control/speed | [std_msgs/Float64](http://docs.ros.org/en/melodic/api/std_msgs/html/msg/Float64.html) |
|robot_host + /control/steer | [std_msgs/Float64](http://docs.ros.org/en/melodic/api/std_msgs/html/msg/Float64.html) |
An ADAS would intervene similarly in the driving process.