Set up a development environment
OriginBot supports ssh remote login for development, if you are not used to remote command line development, you can also build a visual development environment on the PC side, here we introduce how to use VSCode for remote development.
Hint
The operating environment and software and hardware configurations are as follows:
- OriginBot Bot (Visual Version/Navigation Version)
- PC:Ubuntu (≥20.04) + ROS2 (≥Foxy) + VSCode
Install VSCode
VSCode officially provides installation packages under a variety of operating systems, you can choose to download according to the operating system you use.
After the download is complete, double-click the installation package and follow the steps prompted to complete the installation.
Hint
If you are running in Ubuntu, download the .deb installation package, and run the following command to install it:
$ sudo dpkg -i filename .deb
Install the SSH plugin
Open the installed VSCode, select the "Extensions" extension on the right, type "ssh" in the search bar to search, find the "Remote - SSH" plugin, and click Install.
Once installed, a "Remote Explorer" will appear on the left side of VSCode.
Configure a remote connection
Click on the new "Remote Explorer" on the left side of VSCode and click on the "+" Add button.
In the pop-up prompt, output the full command of ssh and press enter.
Then select the default configuration file of the first item and save the ssh command information you just entered.
After the saving is successful, you can also follow the prompts to open the configuration file, so that you don't need to fill in the information next time you log in remotely. And in the list on the left, the IP address of the remote target has also been added.
Connect to a remote server
Right-click on the IP address of the remote server and select Open in Current Window.
Soon a new window will open and let's select the target server system, we will select "Linux".
Next, enter the user password of the target server: root.
Wait a while and the login will be successful.
Select Open Folder.
Then we select the workspace of OriginBot, and the userdata is slightly lower, which can be seen by scrolling the mouse wheel.
In this way, we can remotely access the code on OriginBot, and we can modify it at any time, and it will be synchronized to the bot side in real time. In addition, we can also launch multiple terminals in VSCode after a successful connection, so that we can enter various commands to run on OriginBot.