Install platformio for any IDE/non-IDE.
VSCODE: The following extensions will also be helpful:
PLEASE INSTALL clang-format if you're making any changes to the code
sudo apt install clang-format
Windows:
Open your terminal and follow the steps below
# cd to your workspace, in my case it's home
# I'll use my own workspace, but you can replace the directory
cd ~/
git clone https://github.com/DhruvKoolRajamani/Talaria.git
cd ~/Talaria # cd to your controllers workspace.
pio init --ide vscode # Change vscode to whatever ide you use eg. atom
pio run -e Talaria-main
First Time
Follow the steps in this link to set your udev rules for the first time.
udev rules
cd ~/Talaria
pio run -e <env_name> -t upload
# Give rosserial access to your monitor
sudo chmod a+rw /dev/ttyACM0
# Open a new terminal
roscore
# Open a new terminal
rosrun rosserial_python serial_node.py _port:=/dev/ttyACM0
# Open a new terminal
rostopic echo /network_strings
In order to test the latest code, the use of environment bash files can help in cleaner development.
Eg. To run the code for the Hope hand check the help:
cd Talaria
source envs/hand/setup.sh
run_setup --help
To run on an mbed device:
run_setup mbed #This will run with ROS
or
run_setup mbed serial #without ROS
Make sure to source the envs/bash file everytime a new terminal is used