Coder Social home page Coder Social logo

baxter_simulation_controller's Introduction

Control Baxter robot with robonomics

Example of how it works is available on YouTube.

Requirements:

  • ROS Melodic + Gazebo (installation manual here)
  • extra packages:
sudo apt-get install ros-melodic-gazebo-ros-control ros-melodic-effort-controllers ros-melodic-joint-state-controller
  • IPFS 0.4.22 (download from here and install)
  • ipfshttpclient:
pip install ipfshttpclient
  • Robonomics node (binary file) (download latest release here)
  • IPFS browser extension (not necessary)

1. Download simulation and controller packages

Download packages:

mkdir -p robot_ws/src
cd robot_ws/src
git clone https://github.com/tubleronchik/Baxter_simulation_controller
mv Baxter_simulation_controller/* ./
rm -rf Baxter_simulation_controller/
cd ..
catkin build

Dont forget to add source command:

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

2. Start simulation

Let's start gazebo world and put our baxter in it:

roslaunch gazebo_ros empty_world.launch

empty world

Open one more window in terminal:

rosrun gazebo_ros spawn_model -file `rospack find baxter_description`/urdf/baxter.urdf -urdf -z 1 -model baxter

You can put some models in front of our baxter. It will be more intresting. 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 --rpc-cors all

robonomics

Don't forget to remove db folder after every launch:

rm -rf /home/$USER/.local/share/robonomics/chains/dev/db

Go to https://parachain.robonomics.network and switch to local node local node

Go to Accounts and create Baxter and Employer accounts (Robot is not necessary)

Important! Copy each account's key and address (to copy address click on account's icon). Transfer some money (units) to these accounts:

create account accounts

Add Baxter's secret key and adress to configuration.txt in robot_ws/src/robot_controller/src/

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 robot_control.py

waiting

Return to the first terminal, open new window and send command to robonomics io. This command will turn ON your robot:

echo "ON" | ./robonomics io write launch -r <CURIOSITY ADDRESS> -s <EMPLOYER’S KEY>

Where and <EMPLOYER’S KEY> are replaced with previously saved strings accordingly

rob_message

You should see the following:

working

when the work is over go to the Robonomics Portal to Developer > Chain state. Choose datalog in state query and add Baxter datalog message using "+" button.

datalog

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 IPFS Companion:

ipfs

Click View on Gateway and that's all!

result1 result2

baxter_simulation_controller's People

Contributors

nakata5321 avatar tubleronchik avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.