Testbot MicroROS - VTAstrobotics/Documentation GitHub Wiki
Remember that everyone owns this documentation and if you find any errors or out of date information you should fix it.
Contents
Prerequisites
To understand the content on this page, you should know how to
- Program in c++ in regular ros2. MicroROS gets a little strange bc its designed for embedded systems.
You luckily have already cloned the git repo you'll need in the previous Doc.
You'll need to open the micro_ros_working folder on the features/teaching branch as the top level in VS Code. This means you go to file>open folder and then open it. Open the docker container when prompted and let it build.
configure enviroment
The first thing you now should do is click on the little pico board on the left pane if the project folder doesn't automatically let you compile all you need to do is clock the import project button and import the micro_ros_working folder. NOTE: only import if you need to.
after that we're ready ready to actually write code.
Code
you are editing this (file)[https://github.com/VTAstrobotics/TestBotTeaching/blob/features/teaching/micro_ros_working/pico2subDriving.c]
one helpful resource is this (vulcanNexus)[https://docs.vulcanexus.org/en/iron/rst/microros_documentation/getting_started/getting_started.html] page. note they've added some check macros called
#define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){ printf("Failed status on line %d: %d. Aborting.\n", __LINE__, (int) temp_rc); return 1; }}
#define RCSOFTCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){ printf("Failed status on line %d: %d. Continuing.\n", __LINE__, (int) temp_rc); }}
I reccomend removing all references to them as you progress. you will need to make a left and right subscriber to get the data being published from your other node.