Husarion Docs
  • Tutorials
  • Manuals
  • Software
  • Downloads
  • Community

›Tutorials

Tutorials

  • About tutorials
  • How to start

    • 1. CORE2 - quick start
    • 2. ROSbot - quick start

    Mbed framework

    • 1. Enviroment configuration

    ROS tutorials

    • 1. ROS introduction
    • 2. Creating nodes
    • 3. Simple kinematics for mobile robot
    • 4. Visual object recognition
    • 5. Running ROS on multiple machines
    • 6. SLAM navigation
    • 7. Path planning
    • 8. Unknown environment exploration
    • 9. Map navigation

    ROS Projects

    • 1. Security guard robot
    • 2. Control virtual robot from your PC
    • 3. Using frontier exploration
    • 4. Object search
    • 5. Control robot by voice commands

    ROSbot 2.0 + ROSDS LIVE-Class

    • 1. Make Your Robot Patrol An Area

    AWS RoboMaker + ROSbot 2.0

    • 1. ROSbot + AWS Robomaker - Quick start tutorial
    • 2. Run ROS tutorials using AWS RoboMaker
    • 3. Run ROS on multiple machines with AWS RoboMaker
    • 4. ROSbot + AWS Robomaker - ROS2 Example Applications

    ROS components

    • 1. Setting up RICOH THETA Z1

    Other tutorials

    • 1. ROSbot + ROSDS Quick Start
    • 2. Using Cyclone DDS with Husarnet on ROS2
    • 3. ROSbot with WS2812B LEDs signalization

    Deprecated

    • 1. hFramework library development
    • 2. Offline development tools
    • 3. How to use CORE2-ROS local serial offline
    • 4. Using CORE2 to publish ROS topics through USB

hFramework library development

If you like to develop hFramework together with our Community, or to adapt it to your purposes, this is a way how to do it.

Preparation

You need to collect all required software.

If you using Windows:

Install Chocolatey following this guide: https://chocolatey.org/install

After Chocolatey installation, in the same terminal type: choco install git and follow the instructions. It will automatically install Git for Windows.

For all operating systems:

Open Visual Studio Code and install "Husarion" extension in VSC ([Ctrl]+[Shift]+[X] and find "Husarion") if you have not done this before.

Cloning hFramework repository

Press [Ctrl]+[Shift]+[P] and type Git: Clone, then type https://github.com/husarion/hFramework.git, then specify the destination folder, e.g. C:\Husarion.

Next you have to open this repository by clicking File -> Open Folder... and chose for example C:\Husarion\hFramework.

Then press [Ctrl]+[Shift]+[P] and type Git: Checkout to..., choose origin/master. The access to master branch is limited but you can work with devel branch.

hFramework sourcecode compilation

  1. Open a terminal in VSCode and enter following commands:

    if you use cmd.exe:

    del CMakeCache.txt
    del build.ninja
    mkdir build\stm32_core2_1.0.0
    cd build\stm32_core2_1.0.0
    set PATH=%PATH%;%HOMEPATH%\.vscode\HusarionTools\bin
    cmake ../.. -DBOARD_TYPE=core2 -DPORT=stm32 -DHFRAMEWORK_PATH=. -GNinja
    ninja
    

    if you use bash (Windows & mingw - eg. gitforwindows.org):

    rm CMakeCache.txt
    rm build.ninja
    mkdir build
    cd build
    mkdir stm32_core2_1.0.0
    cd stm32_core2_1.0.0
    export PATH="$PATH:$HOMEPATH/.vscode/HusarionTools/bin"
    cmake ../.. -DBOARD_TYPE=core2 -DPORT=stm32 -DHFRAMEWORK_PATH=. -GNinja
    ninja
    

    if you use bash (Linux):

    rm CMakeCache.txt
    rm build.ninja
    mkdir build
    mkdir build/stm32_core2_1.0.0
    cd build/stm32_core2_1.0.0
    export PATH="$PATH:$HOMEPATH/.vscode/HusarionTools/bin"
    cmake ../.. -DBOARD_TYPE=core2 -DPORT=stm32 -DHFRAMEWORK_PATH=. -GNinja
    ninja
    

    Compiler should run and create static library for hFramework. After a while, you shall see the following output on the terminal:

    image

Using the library compiled by yourself

  1. Create a new folder for your project.

  2. In VSCode File -> Open Folder

    image

  3. In the opened window find the directory you just created. Project tree should be empty.

  4. Press [Ctrl]+[Shift]+[P]. Small console will open on the top.

  5. Type “Create Husarion project” and press Enter to accept.

  6. In the project tree you should find files like on this screenshot:

    image

  7. Before the first build you have to comment some modules (remember to save "ctrl + s"). Open CMakeLists.txt and comment the lines:

#enable_module(hCloudClient)
#enable_module(hSensors)
#enable_module(hModules)
#enable_module(hROS)`
  1. Press [Ctrl]+[Shift]+[P], type “Change Husarion project variable” and press [Enter].
  2. Type “HFRAMEWORK_PATH” and press [Enter].
  3. Type or copy the path to hFramework directory. Remember to use "/", not "". Example:
C:/Husarion/hFramework
  1. Press [Ctrl]+[Shift]+[B] to build your project. If everything goes well, no message should pop up and in project tree you should find tree new output files:
myproject.bin
myproject.elf
myproject.hex
**That means you have successfully built your first project, together with hFramework sources.**
  1. In next step find folder tools in your .vscode\extensions\husarion.husarion-1.5.6\sdk directory, and copy this folder to hFramework repository that you cloned from git, e.g. C:/Husarion/hFramework.
  2. To program CORE2 via USB, click [Ctrl]+[Shift]+[P] and select "Flash project to CORE2".

If you are using Windows:

Make sure that you replaced USB driver for your CORE2 to the "WinUSB (v6.1.7600.16385)" using Zadig.

P.S. To get back to the previous version of the USB driver you need to open "device manager" in Windows and uninstall USB connection associated with FTDI/CORE2, together with the driver for this device (tick the checkbox). In uninstallation confirmation windows select a checkbox to uninstall the driver and click OK.

← 3. ROSbot with WS2812B LEDs signalization2. Offline development tools →
  • Preparation
  • Cloning hFramework repository
  • hFramework sourcecode compilation
  • Using the library compiled by yourself
Company
About UsContactBlogTerms of service
Developers
DocumentationCommunity forumDownloadsHome Page
Social
FacebookTwitterGitHub
Copyright © 2021 Husarion sp. z o.o.