Coder Social home page Coder Social logo

2788west / cerusbot Goto Github PK

View Code? Open in Web Editor NEW
12.0 1.0 7.0 6.35 MB

Home Page: http://www.johanschwind.xyz

License: The Unlicense

C++ 12.08% Jupyter Notebook 78.31% CMake 9.62%
robot xbox-controller teleop arduino jetson-nano wheels encoders

cerusbot's Introduction

Cerusbot

Cerusbot

Cerus is a four-wheeled mobile robot platform. It operates based on an Arduino Mega 2560 and NVIDIA Jetson Nano. The code in this repo enables both teleoperation via an Xbox controller as well as a simple go-to-goal behaviour with encoder feedback. Even though Cerus features mecanum wheels, thes basic Arduino and Jetson Nano code treats the robot's base as a differential drive system, pairing left and right wheels together. This simplification is intended to keep the code more beginner-friendly.

Hardware Overview

Block Diagram

arduino

move.cpp enables low-level control of four motors using Cytron motor drivers and reads two quadrature motor encoders (left side and right side). The Arduino will accept linear and angular speed in the format <float, float> and continuously return the left and right wheel position as a pair of integer values int, int. This code is intended to be used with the standard Teleop and Go-To-Goal notebooks. To use this code with a Cytron motor driver, please add their driver library in the Arduino IDE under Tools > Manage Libraries > Search for: "Cytron Motor Drivers Library".

jetson

Enables two behaviors: Teleop and Go-To-Goal.

Teleop

To teleoperate Cerus via an XBox controller or similar gamepad, simply run gamepad_control.ipynb in Jupyter. The left and right analog stick will control the wheels on either side of the robot.

Go-To-Goal

Go-To-Goal Behavior

Make your own

With the parts in the bill of materials (BOM.csv) and the 3D print files (STL.zip) you can build your own version of Cerus!

Cerusbot with ROS

The ROS directory contains more advanced code for teleoperation that takes full advantage of Cerus' mecanum wheels and enables movement in the X and Y direction as well as around the Z axis.

cerusbot's People

Contributors

2788west avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

cerusbot's Issues

Issue with Twist msg and rosserial

Hi,
I fail to set up a subscriber on my Arduino that listens to Twist commands from /cmd_vel.
Other messages and topics work.
I took your arduino code and boiled it down to a minimum. Every time my arduino gets a Twist command, the LED should blink.
But nothing happens.
Du you have any idea, what Im doing wrong? I use ubuntu 20 and ROS noetic on my laptop.
Here is my code:

#include <ros.h>
#include <geometry_msgs/Twist.h>

//Configure ROS
ros::NodeHandle nh;
geometry_msgs::Twist msg;

//Create a message callback that updates the motor speeds
void messageCb(const geometry_msgs::Twist& cmd_vel)
{
    digitalWrite(5, HIGH-digitalRead(5)); 
}

//Subscribe to the Twist message
ros::Subscriber <geometry_msgs::Twist> sub("/cmd_vel", &messageCb);

//Setup the node and subscriber once
void setup()
{
    nh.initNode();
    nh.subscribe(sub);
    pinMode(5, OUTPUT);
    digitalWrite(5, HIGH);
    Serial.begin(9600); // needs to be at end of setup loop
}

//Loop forever
void loop()
{
  while (!nh.connected())
  {
    nh.spinOnce();
  }
    nh.spinOnce();
    delay(1);
}

Im really glad for any hint!
Regards!

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.