CLion IDE configuration
We recommend using CLion IDE as the development IDE for electric and vision, see the official tutorial Installing CLion for the installation method.
ROS configuration
Refer to the ROS setup tutorial In addition, for compatibility with catkin build
and catkin_make
the following settings should be made
- open File | Settings | Build, Execution, Deployment | CMake
- Change the value of CMake options to
-DCATKIN_DEVEL_PREFIX=. /devel
- Change the value of Build directory to
... /build
Auto-format on save
Turn on clang-format
Open File | Settings | Editor | Code Style and check Enable ClangFormat(only for C/C++/Objective-C) under ClangFormat
Turn on Save Actions
- Open File | Settings | Plugins, search and install Save Actions in Marketplace.
- Restart the IDE, go to File | Settings | Save Actions, and check the following options.
Code synchronization
When debugging a robot, sometimes for quick parameter changes and testing, you don't build and release via CI before installing to the robot. We will transfer the single package that needs to be debugged to the workspace on the robot, compile and run it on top of the robot via scp or the code synchronization provided by CLion.
About Clion's remote transfer configuration
- First, add a file to the deployment, choose SFTP as the file type, and name it (the name depends on the robot, e.g. standard4 for Infantry IV.
- Configure ssh by clicking the ellipsis in SSH configuration.
- Configure Connection and click Autodetect to get the root directory under the ssh account after the configuration is done.
- Configure Mapping.
Remote transfer process
In the workspace in CLion, select the feature package for remote transfer, right mouse click, select deployment in the menu bar , upload to "target host".
Remote Development
It is less common to compile, run development and debug on a remote robot using a local IDE, generally refer to Full remote mode.