Giter VIP home page Giter VIP logo

aruduino_motorcontrol's Introduction

Aruduino_MotorControl

Requirement & Setup

  • Hardware

PC with ROS and Aruduino IDE.

The japanese document for installing Arduino IDE, check and follow this page.

  • ROS package for arduino
sudo apt-get install ros-<distro>-rosserial-arduino  ros-<distro>-rosserial
rosrun rosserial_arduino make_libraries.py <your arduino libraries path>
  • Arduino PID package

Confirm you have ros-lib in your arduino libraries path.

  • Arduino Encoder package by Paul Stoffregen

Files

PublishPose

Include following package.

How to run

Setup ros and arduino serial communication

Check your arduino device in Ubuntu/Windows. For my environment, it looks like:

% Assume you already has started roscore
rosrun rosserial_python serial_node.py _port:=/dev/ttyACM0 _baud:=115200

My program defines baudrate to be 115200 with the following code. (Normally it should be 57600.)

nh.getHardware()->setBaud(115200);

teleop_twist_keyboard

Use this package.

rosrun teleop_twist_keyboard teleop_twist_keyboard.py 

Robotic Navigation step

Odometry from LIDAR

1. not succeed

use this package

Before install this, install MRPT libary for robotic calculations.

sudo add-apt-repository ppa:joseluisblancoc/mrpt
sudo apt-get update
sudo apt-get install libmrpt-dev mrpt-apps

?? Some fatal error happened.

2. under test

Clone this package

%in the ~/catkin_ws/src$
git clone https://github.com/ccny-ros-pkg/scan_tools 
sudo apt-get install ros-kinetic-csm

Put this file to the /src folder and /include. Just follow this guy.

Original comment is here.

???

running gmapping

Set the odom publisher to publish the odometry.

See the tf tree.

rosrun tf view_frames
evince frames.pdf

memo

Arduino Connecting issue

With 5ms roop and baudrate 57600 it communication frequency is almost 100Hz.

rostopic hz /current_vel 
subscribed to [/current_vel]
average rate: 104.742
        min: 0.004s max: 0.013s std dev: 0.00206s window: 101

If you use baudrate 115200, it become 200Hz.

rostopic hz /current_vel 
subscribed to [/current_vel]
average rate: 209.468
        min: 0.001s max: 0.022s std dev: 0.00203s window: 201

Problem

rosserial python stops with errors.

[WARN] [1523175088.478695]: Serial Port read failure: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

Higher baudrate could cause the communication error.

Share the data with multiple ROS hardware

First, open hosts file to recognize the host and client ROS computer each other.

sudo gedit /etc/hosts
<host ip address> host
<client ip address> client

Then, for the host computer,

export ROS_MASTER_URI=http://host:11311
export ROS_HOSTNAME=host

after that for the client computer,

export ROS_MASTER_URI=http://host:11311
export ROS_HOSTNAME=client

aruduino_motorcontrol's People

Contributors

yoshiri avatar

Watchers

 avatar

Forkers

soblin

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.