Giter Club home page Giter Club logo

newio's Introduction

NewIO

New developing version of IO for ZJUDancer

Pre-Requirement

  • ROS is a must for IOManager and the other part.BUT ist not necessary ServoIO.

How to build

  • This is a ROS workspace use the following code to build
 catkin_make
 source devel/setup.zsh

Serial ports config

We use udev rules to change the access permissions to devices, set port corresponded to our port names used in code.

Generally, the serial port mapping are listed below:

  • ttyUSB0---> Servo
  • ttyUSB1---> IMU

For instant setup for usage, you can put the 99-dancer-serial.rules to /etc/udev/rules.d, and put the change_timer.sh to etc/zjudancer/hardware, then give executive permission to this file: sudo chmod +x change_timer.sh .

If one day the hardware is changed, you should learn to change the rules according to new features, hope you can get some suggestion from the below figure.

udev_rules

Tips

  1. All IO is finished
  2. Read the description function of the code in
  • src/dmotion/include/dmotion/IO/SeroIO.h
  • src/dmotion/include/dmotion/IO/IOManager.h
  • src/dmotion/include/dmotion/IO/FeetSensorIO.h
  • src/dmotion/include/dmotion/IO/IMUReader.h
  1. example show how to use servo and iomanager and the sensors to read and write Servo
  2. if it's the first time that you used this code, make sure you have checked the Macro definition in the following files is correct(especially the port and baud rate)
  • src/dmotion/src/IO/SeroIO.cpp
  • src/dmotion/src/IO/IOManager.cpp
  • src/dmotion/src/IO/FeetSensorIO.cpp
  • src/dmotion/src/IO/IMUReader.cpp
  1. In the issue some solutions of some tricky bugs is recorded.

What's new

  • you can find it yourself

Run a test

  • There are some examples that you can use roslaunch to test
 roslaunch dmotion ...    #servo_read.launch or servo_write.launch or IOManager_read_write.launch
  • make sure you have the authority of the USB port,use the following code in terminal to get authority
 sudo chmod 666 /dev/ttyUSB0     #sometimes it's not USB0

newio's People

Contributors

hannbusann avatar hoempire avatar

Stargazers

 avatar

Watchers

 avatar  avatar

newio's Issues

The read packet latency and packet loss of Dynamixel Servo

Describtion

  • Use the old original way of Servo read read4ByteTxRx it takes 70ms to read 12 Servos and with Packet loss problem
  • Use the syncread it takes 18ms to read 12 Servos and also with Packet loss problem

Solution

  • It‘s a problem of some kinds of authority of Ubuntu16.04
  • The following command before running the programm can solve the problem
echo 1 | sudo tee /sys/bus/usb-serial/devices/ttyUSB0/latency_timer

Perfomance after solving the problem

  • Now we can read the 12 Servo in 3ms without packet loss

Too fast initiation OF

Describtion

  • After replace oldIO with newIO, the initiation of Servo is too fast

Solution

  • It's the problem of Setting in Servo.cpp
  • CHANGE THE FOLLOWING TO 100 (BEFORE IS 10)
    image

Perfomance after solving the problem

  • The power reopen initiation works well

Frequency difference of host computer and slave computer

Problem description

  • The frequency of imu part in host computer and slave computer is not the same.
  • One cycle of host reading imu is set 10ms
  • One cycle of slave computer is >10ms (This can explain why when the frequency of host is set higher than 10Hz,the ticks overflow problem will not exist)

Solution

  • Still need to work with circuit group to solve the problem

invalid use of non-static member function

Problem description

I used thread to separate reading imu from spinOnce, but i met the compilation that

invalid use of non-static member function

Solution

write the code like this to initiate thread and it will work

std::thread t(&IOManager3::readIMU,this);//this line is in the IOManager3.cpp, readIMU is a member function of IOManager3

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.