It will work offline, you only need internet access for first setup. If you want to avoid internet access at all, you can disable it and connect ROS directly to CORE2 serial port.
First disable Husarion service (systemctl disable husarion-shield
) and reboot (you can reenable it later with systemctl enable husarion-shield
). Then change the program to connect directly to the serial port:
void hMain()
{
//platform.begin(&RPi); // comment this line
nh.getHardware()->initWithDevice(&RPi); // change here
nh.initNode();
nh.subscribe(sub);
// ...
Later, use /opt/husarion/tools/rpi-linux/ros-core2-client /dev/ttyS1
to connect CORE2 to ROS network.