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

How to use CORE2-ROS local serial offline

Local serial is an UART communication between CORE2 and SBC in CORE2-ROS. By default, this serial interface is used for communication with Husarion Cloud and allows you to use all functionalities of Cloud. If you don't want the connection with cloud, or just need this serial interface for another purposes, you can change its behavior. In this short tutorial we will show you how to disable the communication with Cloud.

First we will show how to run communication normaly and point all needed changes.

Default communication

Few lines that should including your code flashed on CORE2:

void hMain()
{
    //RPi.init(230400); // uncomment if UpBoard
    platform.begin(&RPi);
    nh.getHardware()->initWithDevice(&platform.LocalSerial);
    nh.initNode();
    nh.subscribe(sub);
// ...
}

or if you using UpBoard:

void hMain()
{
    RPi.init(230400); // uncomment if using UpBoard
    //platform.begin(&RPi); // comment this line
    nh.getHardware()->initWithDevice(&RPi); // change here
    nh.initNode();
    nh.subscribe(sub);
// ...

After flashing your code you just have to connect with your SBC (ssh, remote desktop client) and run in first terminal window:

roscore

and in another window run:

/opt/husarion/tools/rpi-linux/ros-core2-client /dev/ttyCORE2

Now all of included topics are avaleiable in ROS. You can check a list od them by taping:

rostopic list

Offline communication

For start you have to open a console and disable Husarion service:

systemctl disable husarnet-configurator

and reboot device (you can reenable it later with systemctl enable husarnet-configurator).

We also have to change few lines in CORE2 code:

void hMain()
{
    //platform.begin(&RPi); // comment this line
    nh.getHardware()->initWithDevice(&RPi); // change here
    nh.initNode();
    nh.subscribe(sub);
// ...

Next as always we have to open a terminal and run:

roscore

and in second terminal we run depending on the model of our SBC.

On Asus Tinker Board:

/opt/husarion/tools/rpi-linux/ros-core2-client /dev/ttyS1

On Raspberry Pi:

/opt/husarion/tools/rpi-linux/ros-core2-client /dev/serial0

On UpBoard:

/opt/husarion/tools/rpi-linux/ros-core2-client /dev/ttyS4 _baud:=230400
← 2. Offline development tools4. Using CORE2 to publish ROS topics through USB →
  • Default communication
  • Offline communication
Company
About UsContactBlogTerms of service
Developers
DocumentationCommunity forumDownloadsHome Page
Social
FacebookTwitterGitHub
Copyright © 2021 Husarion sp. z o.o.