- Install ROS Kinetic:
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
sudo apt update
sudo apt install ros-kinetic-desktop-full
sudo rosdep init
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential
- Install mavros:
sudo apt install ros-kinetic-mavros
- Clone Px4 firmware:
git clone -b stable https://github.com/PX4/Firmware.git (v.1.6.5)
sudo apt-get install python-jinja2 python-pip numpy toml openjdk-8-jre openjdk-8-jdk ant
Usage:
make posix_sitl_default jmavsim
- Download QGroundcontrol:
wget https://s3-us-west-2.amazonaws.com/qgroundcontrol/latest/QGroundControl.tar.bz2
tar jxf QGroundControl.tar.bz2
sudo apt install libsdl2-*
Usage:
./qgroundcontrol-start.sh
- Install Parity or Ganache:
wget http://d1h4xl4cr1h0mo.cloudfront.net/v1.8.10/x86_64-unknown-linux-gnu/parity_1.8.10_ubuntu_amd64.deb
npm install -g ganache-cli
Usage:
parity --chain kovan --jsonrpc-cors all
npm install web3
node
Web3 = require("web3")
web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
- Clone DE ROS packages into Catkin workspace (install nosejs npm)
git clone https://github.com/tuuzdu/de_gps_destination.git
cd de_ros_bridge/
npm install
sudo apt install ros-kinetic-rosbridge-suite
catkin_make (for generating masseges)
- Compile and deploy DE contracts
npm install -g truffle
truffle compile
truffle migrate
Usage:
truffle console
gps = GPSDestination.at(GPSDestination.address)
gps.initROS.sendTransaction({from: web3.eth.accounts[0], gas: 3000000})
- Project launch. Prepare:
parity --chain kovan --jsonrpc-cors all
or
ganache-cli
export PX4_HOME_LAT=60.086033 && export PX4_HOME_LON=30.421657
make posix_sitl_default jmavsim
roslaunch de_ros_tutorial px4_sitl.launch
node start.js <GPSDestination contract address>
./qgroundcontrol
Init:
rostopic pub /de_employee/homebase de_ros_tutorial/SatPosition "latitude: 60.086033 longitude: 30.421657"
Usage:
truffle console
gps = GPSDestination.at(GPSDestination.address)
gps.setNewEstimate.sendTransaction('30427500', '60087925', {from:web3.eth.accounts[0], gas:5000000})
gps.takeFlight.sendTransaction({from: web3.eth.accounts[0], value: web3.toWei(0.001, "ether"), gas: 5000000})
Video: