Say "Hello Baxter!" with robonomics

Example of how it works:


  • ROS Melodic + Gazebo (installation manual here)
  • extra packages:
sudo apt-get install ros-melodic-qt-build ros-melodic-driver-common ros-melodic-gazebo-ros-control ros-melodic-gazebo-ros-pkgs ros-melodic-ros-control ros-melodic-control-toolbox ros-melodic-realtime-tools ros-melodic-ros-controllers ros-melodic-xacro python-wstool ros-melodic-tf-conversions ros-melodic-kdl-parser python-wstool python-catkin-tools qt4-default
  • IPFS up to 0.6.0 (download from here and install)
  • python packages:
sudo apt-get -y install python3-pip
pip3 install --upgrade pip

0. install CV Bridge extension for python3

  • Create catkin workspace
mkdir -p catkin_workspace/src
cd catkin_workspace
catkin init
  • Instruct catkin to set cmake variables. Use your current version of python. For me, it is python3.6:
catkin config -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_INCLUDE_DIR=/usr/include/python3.6m -DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/
catkin config --install
  • Clone cv_bridge src:
git clone src/vision_opencv
  • Find version of cv_bridge in your repository:
apt-cache show ros-melodic-cv-bridge | grep Version
    Version: 1.12.8-0xenial-20180416-143935-0800
  • Checkout right version in git repo. In our case it is 1.12.8:
cd src/vision_opencv/
git checkout 1.12.8
cd ../../
  • Build:
catkin build cv_bridge
  • Extend environment with new package:
source install/setup.bash --extend
  • Test:
$ python3
Python 3.6.9 (default, Jan 26 2021, 15:33:00) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from cv_bridge.boost.cv_bridge_boost import getCvType

1. Download simulation and controller packages

We will need to create 2 workspaces - one for main Baxter's packages and other for main control programme. First workspace. It's main control programme. It will run under python3.

cd ~
mkdir -p robonomics_ws/src
cd robonomics_ws/src/
git clone
cd Baxter_simulation_controller
pip3 install -r requirements.txt

Second workspace. There will be all Baxter's packages. Simulation is very old, so it could run only under python2.

cd ~
mkdir -p robot_ws/src
cd robot_ws/src/
wstool init .
wstool merge
wstool update

These packages were created for ROS indigo. We have to change some files to run them on ROS melodic. We will use patch files.

patch ./baxter_simulator/baxter_sim_io/include/baxter_sim_io/qnode.hpp ~/robonomics_ws/src/Baxter_simulation_controller/patch/qnode_patch
patch ./baxter_simulator/baxter_sim_kinematics/src/arm_kinematics.cpp ~/robonomics_ws/src/Baxter_simulation_controller/patch/arm_patch
patch ./baxter_interface/src/baxter_interface/ ~/robonomics_ws/src/Baxter_simulation_controller/patch/interface_patch

And let's build all our packages:
First build Baxter's packages

cd ../
catkin build

Then return to first workspace and build it too:

cd ~/Baxter_simulation_controller/
catkin build -DPYTHON_EXECUTABLE=/usr/bin/python3

Don't forget to add source command:

echo "source /home/$USER/robot_ws/devel/setup.bash" >> ~/.bashrc
echo "source /home/$USER/robonomics_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc

2. Start simulation

Let's start our simulation:

At first go to robot_ws and copy and edit

cd ~/robot_ws/
cp src/baxter/ .

Find your local ip address with command:

ip a


Edit the following values in :

  • your_ip - put your local ip address. See ip a
  • ros_version - for example "melodic"


Run the baxter shell script with sim specified:

./ sim
roslaunch baxter_gazebo baxter_world.launch

You can put some models in front of our baxter. It will be more interesting. baxter

3.Manage accounts in DAPP

Since we are testing, let us create a local robonomics network with robonomics binary file. Go to folder with robonomics file and run:

./robonomics --dev --tmp


Go to Robonomics Parachain portal and switch to local node local node

Go to Accounts and create Baxter and Employer accounts.

You can find The manual "Create an Account on Robonomics Portal" here

Important! Copy each account's Mnemonic and address (to copy address click on account's icon). Mnemonic is the private key for account.

Transfer some money (units) to these accounts:

create accountcreate account2accounts

Add Baxter's Mnemonic and address to config.yaml in robonomics_ws/src/Baxter_simulation_controller/config/

4.Start simulation

In new window run:

ifps init #you only need to do this once
ipfs daemon

Open separate terminal and start controller package:

rosrun robot_controller


Now you can send a transaction triggering the Baxter to start moving and collecting data. To do so, you can use the same portal Robonomics Parachain portal. Go to Developer->Extrinsics and select Baxter's employer account, launch extrinsic, Baxter's account as a target account and yes as a parameter. Submit the extrinsic.


The robot should start moving. It won't accept commands from other accounts neither commands with no parameter. You should see the following:


When the work is over go to the Robonomics Portal to Developer > Chain state. Choose datalog.datalogItem(AccountId,u64) in state query.If you want to show all datalog's, then turn off include option add view Baxter's datalog message using "+" button.


Now the IPFS hash of the telemetry and photos is saved in the blockchain. To see the data simply copy the hash and insert it in the search bar with URL:< put your hash here>

That's all!


previous ← Baxter simulation v1.0 next Connect Manipulator →