I’m trying to use VScode (on a Macbook pro) to program my CORE2+ROS (Tinkerboard) by following this tutorial:
I chose “hRosBasicExample.cpp”
#include “hFramework.h”
#include <stdio.h>
#include <ros.h>
#include “std_msgs/String.h”
using namespace hFramework;
ros::NodeHandle nh;
std_msgs::String str_msg;
ros::Publisher chatter(“chatter”, &str_msg);
char hello[13] = “hello world!”;
void hMain()
{
Serial.init(57600);
nh.getHardware()->initWithDevice(&Serial);
// Or:
// platform.begin(&Serial);
// nh.getHardware()->initWithDevice(&platform.LocalSerial);
nh.initNode();
nh.advertise(chatter);
while (true) {
str_msg.data = hello;
chatter.publish(&str_msg);
nh.spinOnce();
sys.delay(1000);
}
}
F5 to flash.
Term window opens saying:
Last login: Tue Apr 10 12:11:36 on ttys004
~$ cat /Users/thealy/husarion/.term
st-flash failed
~$
Pop-ip error in Vscode says:
Debugger executable ‘/Users/thealy/husarion/.vscode/debugger.bat’ is not signed. As a result, debugging may not work properly.
On Vscode “Debug Console” tab:
Starting: “/Users/thealy/husarion/.vscode/debugger.bat” --interpreter=mi
“/Users/thealy/husarion/.vscode/debugger.bat” exited with code 1 (0x1).
ERROR: Unable to start debugging. Unable to establish a connection to GDB. Debug output may contain more information.
On Vscode “Problesm” tab:
{} launch.json .vscode 1
Property env is not allowed. (1,196)
launch,json
{“version”:“0.2.0”,“configurations”:[{“name”:“Flash to CORE2”,“type”:“cppdbg”,“request”:“launch”,“program”:"${workspaceRoot}/myproject.elf",“args”:[],“stopAtEntry”:false,“cwd”:"${workspaceRoot}",“env”:{“GDBWRAPPER_FLASH”:“true”},“miDebuggerPath”:"/Users/thealy/husarion/.vscode/debugger.bat",“miDebuggerServerAddress”:“localhost:4242”,“externalConsole”:true,“linux”:{“MIMode”:“gdb”},“windows”:{“MIMode”:“gdb”}}]}