# webots-USB-com-cpp-vscode-cmake **Repository Path**: hallo_frank/webots-USB-com-cpp-vscode-cmake ## Basic Information - **Project Name**: webots-USB-com-cpp-vscode-cmake - **Description**: 在vscode+cmake环境下, 完成了usb通信cpp版本的代码, 通过usb发出指令对仿真小车进行简单控制 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: win - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-01-17 - **Last Updated**: 2024-01-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # **Webots Template Project** ## **Introduction** - Project to simulate Robot with C++ edited in Vscode. - If you are interseted in this project and need more information, please contact Jae Frank(thissfk@qq.com) to get an access. ## **How to run this program**? - **Start your Simulation:** 1. Add the variable`WEBOTS_HOME`in the system with the path `${webots_installed_place}`. - `${webots_installed_place}` is the place where webots is installed, for example `D:\webots`. 2. Open the directory `./controllers/cmake_controller/` with Vscode. 3. Compile the program(2 ways) - use CMake tools. - use command line: `mkdir build && cd build ` and ` cmake .. && mingw32-make.exe`. 4. Open scence file `./worlds/car.wbt` with Webots. 5. Start simulation using the start button in Webots. ## How to control the car by sending commands 1. Use function `ceSerial::genComNumber(int)` in **main.cpp** to set the port number you want to open 2. Connect serial debugger to the opened port above, start the webots simulation, if it is OK, the serial debugger will receive `Hello!` 3. Send commands to the opened port through the serial debugger, the command: `w` is forward, `a` is for left turn, `d` is for left turn, `s` is for backward 4. The car run as your command in webots. ## **Dependencies** ### **Running Enviroment :** **Platform: refer to the Webots version** - CMake (version 3.10+) ### **Simulation Enviroment :** - Webots (Recommended newer than(also include) version: R2020b)