GithubHelp home page GithubHelp logo

nengo-erle-copter's Introduction

nengo-erle-copter

Connecting Nengo to the Erle-Copter

Setup

Follow the steps here to configure your environment to be able to use both the real quadcopter and the gazebo simulation.

Start the Gazebo simulation

In one terminal run:

source ~/simulation/ros_catkin_ws/devel/setup.bash
cd ~/simulation/ardupilot/ArduCopter
../Tools/autotest/sim_vehicle.sh -j 4 -f Gazebo

In another terminal run:

source ~/simulation/ros_catkin_ws/devel/setup.bash
roslaunch ardupilot_sitl_gazebo_plugin erlecopter_spawn.launch

Configuring ROS

To use the simulator:

export ROS_MASTER_URI=http://localhost:11311
export ROS_IP=127.0.0.1

To use the real quadcopter:

export ROS_MASTER_URI=http://10.0.0.1:11311
export ROS_IP=10.0.0.2

You also need to add 10.0.0.1 erle-brain-3 to /etc/hosts

Using ROS

To arm and disarm motors:

rosservice call /mavros/cmd/arming True
rosservice call /mavros/cmd/arming False

To change the flight mode:

rosservice call /mavros/set_mode 0 ALT_HOLD
rosservice call /mavros/set_mode 0 GUIDED
etc...

To takeoff from the current location

rosrun mavros mavcmd takeoffcur 0 0 2

When overriding RC commands, you first need to run this command:

rosrun mavros mavparam set SYSID_MYGCS 1

You can then publish commands like this:

rostopic pub -1 /mavros/rc/override mavros_msgs/OverrideRCIn '[1500, 1500, 1500, 65535, 65535, 65535, 65535, 65535]'

Channel pwm values range between 1000 and 2000. Publishing 0 on a channel gives control back to the RC controller. Publishing 65535 on a channel ignores that channel (uses previous value).

Mavlink

simulator mavlink address: 127.0.0.1:14550 quadcopter mavlink address: 10.0.0.2:6000

Run mavproxy like this: mavproxy.py --master 10.0.0.2:6000

Misc

The four modes that do not require GPS lock to operate:

  • STABILIZE
  • ALT_HOLD
  • ACRO
  • LAND

nengo-erle-copter's People

Contributors

bjkomer avatar

Watchers

 avatar  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.