[Solved] VSC hframework compilation

Hi,
I want to program my CORE2 offline, with a Windows 10 laptop and VS code.
I’ve follow this tutorial :

The result of the hFramework sourcecode compilation is:
[95/95] Linking CXX static library libhFramework.a

I can finish correctly this tutorial with the “Using the library compiled by yourself” chapter. I’m able to make blink the led, all seems ok …

Now I try to import my cloud firmware into VSC. I made a copy/paste of the main.cpp from the cloud
(it’s the ROSBOT 2.0 default firmware) into the main.cpp generated in VSC just before.
The only difference between both codes is this line commented :
//#include “hCloudClient.h”

When I build this code, there is this error message:

C:\mydirectory\main.cpp:5:17: fatal error: ros.h: No such file or directory
compilation terminated.
ninja: build stopped: subcommand failed.
The terminal process terminated with exit code: 1

In fact, all includes are non availabled. Can you please explaine to me what is the problem ?

I’ve tried also on Ubuntu 16.04 and I’ve got exactly the same problem.

I’m a bit lost with all these tutorials. I’ve got a custom hFramework that is used from the Cloud, now I need to remove the thinkerboard, so I need to flash directly the Core2 (offline) what is the best way to do it ? Because when someone will help me (I hope !) to buid the “standard” ROSBOT firmeware, I will need to modify some files (rosbot.cpp; rosbot.h …). I’m not sure that the described way into the tutorial is the best for me because I will need to compile 2 times to test changes (hFramework) and main.cpp.

Please, is there someone for helping me ?

Thanks,
Baptiste

Am I the only guy with this problem ? Nobody have an idea to how solve it ?

Hello Baptiste,

If you are planning to create a new project, I would strongly suggest to use MBED firmware, it was introduced in August last year, currently all ROSbots are produced with this firmware.

Also, if you are planning to modify ROSbot firmware, the MBED version will be easier to develop.

The hFramework is still maintaned and you can use it in your projects, but it will not be developed nor get any new features.
To solve the include error, please compare your project with the ROSbot_examples repository, as the complete project also needs a CMakeLists.txt file to build properly.

Regards,
Łukasz

I have already tested the MBED firmware, it is great but there are some fundamental changes with the hFramework (and my customisations) that are not easy to to apply. And I need only some minor changes for my robot so it seems realy more simple for me to apply these changes to the hFramework (if I’m abble to build it…)

This is my CMakelist.txt file:

cmake_minimum_required(VERSION 2.6)

project(Main NONE)

set(BOARD_TYPE “core2”)
set(PORT “stm32”)
set(BOARD_VERSION “1.0.0”)
include(${HFRAMEWORK_PATH}/hFramework.cmake)

#enable_module(“hCloudClient” “”)
enable_module(“hSensors” “”)
enable_module(“hModules” “”)
enable_module(“hROS” “”)

add_hexecutable(main “main.cpp”)

it’s the same as https://github.com/husarion/ROSbot_examples/blob/master/ROSbot_2.0_default_firmware/CMakeLists.txt

when I set the HFRAMEWORK_PATH it seems to be ok:

– Using hFramework from workspace
– Using module from workspace:
– Using module from workspace:
– Using module from workspace:
– Configuring done
– Generating done
– Build files have been written to: C:/myDirectory/

Any other idea ?

It’s for now 6 days that I’m blocked because I can’t reflash my CORE2. I’m a bit disapointed !

There is no support for help me, so this morning I’ve unmount my robot to plug in internet access to the raspberry Pi to flash the CORE2 with the cloud like I was doing previously. But the new surprise is that it’s not possible to register the CORE2 into the husarion cloud… On the RaspberryPi I enter these 2 commands but on the Cloud the CORE2 still not detected.

sudo husarion-register --code “prod|xxxxxxxxxxxxxxxxxxxxxx”
sudo systemctl restart husarnet-configurator

I tried to reinstall the CORE2 bootloader , https://husarion.com/manuals/core2/ “Updating CORE2 bootloader”

My Husarion Cloud still empty, without any CORE2 to flash…
Please please please give me some support, you are professionals and sales some easy to use robotic equipments, for me it’s really not easy to use !

Hello Baptiste,

To alter the functionality of ROSbot class, there is no need to rebuild hFramework.

You can copy ROSbot.h and ROSbot.cpp files from hFramework to your project.

Also, in CMakeLists.txt change line:

add_hexecutable(main “main.cpp”)

to:

add_hexecutable(main “main.cpp” "ROSbot.cpp")

This way your files will be used while build instead of the ones from hFramework.
Prior to building the project, make sure that you are using default hFramework path.

Regards,
Łukasz

Ok, it works thanks a lot.
The “hFramework library development” tutorial is very confusing.

Regards,
Baptiste