问:
Serial command receiving failure with Arduino and Adafruit shield from C# desktop application
For a long time I use Arduino Uno controller and Adafruit Servo Shield with 6.3V 1000 uF capacitor, powered with 6V 8Amp adapter to control 8 digital servo motors from C# desktop application.

Code was successfully working for a long time of using my project device, but today I've plugged controller, and something goes wrong way, when I've not damaged of changed anything in my project, as in code, also in device assembly. I found two different and absolutely not clear problems, which newer was before with completely same code, devices, computer and Windows 10 pro OS:

When I'm loading Adafruit control #include <Wire.h> #include <Adafruit_PWMServoDriver.h> sketch, I see TX, RX and L led indicates upload as usually, but motors does not moves with command from desktop via serial port, just does some short random movements with load of controller and then stops, at the same time RX led indicates receiving  of message from  C# desktop command with button or trackbar successfully

When I'm trying to load another sketch, which uses <Servo.h>, which should receive serial command from my C# desktop, with same shown initialization, to check if I am able to move motor from desktop this way, but C# application hangs and freezes with selecting of same "COM3" in combobox. Then after number of attempts, it was somehow loaded and selected without freezing with port selection, but did nothing with servo, just indication of message with RX, and same unexpected random movements.

Both of this problems was never appeared before.

To be sure, I've checked all motors separately only with Arduino (without shield) from basic servo control with direct connection minus to GND, 5V to V+, Signal to PWM by this example, which also uses <Servo.h>, and works fine, turns all motors from sketch successfully.

Also I've checked absolutely new Arduino Due, which uses COM4 and it is same behavior. So, seems like controller and motors are fine, it looks like my USB serial port works incorrectly, or it is something wrong with shield, what is more likely, even if serial port selection freezing looks really doubtful and does not shows any error if  I run application from VS debug, I almost sure that the problem comes from shield, because kind of proof is that I've checked same C# application from 2 different computers with Windows OS and with 2 different controllers Uno and Due, single or number of servos on board, and 3 different USB cables serial command received but motor does not moves by command, just does rare unexpected random movements.

Power to shield correct is a 6V, board and port selected in Arduino IDE tools by requirement.

It looks like something wrong with shield, even if freezing of serial port sounds like separate problem, but I don't have another shield to check, so I've to find out somehow with particular device

I'm not sure where to go next and what to check else.

Any advice, guide or example would be helpful

Edit 1:

I've follow @jsotola advice to locate the point of failure. I've tried this example, which works fine, blinks L led with my red led and 220 Ohm resistor on 13 pin and ground.

And I got same freezing with selection of serial COM3 in combobox, without any error report if I debug it from VS or will run .exe from desktop. This behavior looks incorrect, it is unclear where is a reason, because it does the same from another computer for both Uno and Due controllers, with same long time working code and devices, as I've said before nothing like this was happened before, I did not changed anything in code or assembly.

It seems like something goes wrong here, looks confusing, because when #include <Wire.h> #include <Adafruit_PWMServoDriver.h> control sketch uploaded to controller, it successfully selects COM3 from C# combobox, and failure comes with serial command receiving, which is indicated with RX each time I press button or scrolling trackbar, but does not turns motor.

Code with turning LED from C# or controlling motor, shown (number 2) in problem behavior description above, (both already checked long time before of successful working) does the same, failure appears with serial port selection, hanging and complete freezing, I can't say if it is initialization problem, because it does not reports about any bug there, and initializes same port with <Wire.h> #include <Adafruit_PWMServoDriver.h> sketch using.

Edit 2:

Now, I've checked this code, which runs servos without serial. I've reached completely unclear result, this way shield moves servo. I'm really confused, what I got here:

I have 3 years old desktop application code and controller sketch, device assembly, working everyday successfully till yesterday. Important to note, all given examples was used and checked by me before, all was successful

Shield without using of serial port runs servos successfully

Arduino Uno and Due both controllers runs motor sweep and blinks LED without serial successfully

I've checked two different USB cables for Uno and separate one for Due

Adafruit library PWM connects COM3 from C# desktop application successfully, but does not turns servo with serial command from desktop

<Servo.h> code or LED light to control from C# does not loads COM3 in 99% cases, and if does, then does not turns servo or LED

I have checked problem on two different computers with different version of Windows OS

All motors are working

Capacitor works

Voltage on shield power terminal  6V and same on GND and V+ pins

Adafruit example code turns servo without serial successfully

So what is the conclusion, if shield works, controller works, USB works, C# desktop reads COM3 with PWM library and RX led indicates receiving of serial command message, but not turns servo, and does not reads COM3 with <Servo.h>.

What to check, code is shown above completely, there is nothing else, and it was working, I'm not sure, what can be wrong there.

Or it is something wrong with serial on PC, but I have checked it on 2 computers, behavior is equal, then more explainable should be some Windows OS update, which was changed something with serial ports in OS.

Or it is some connection damage between Arduino and Shield on shield, because I've tried 2 different controllers, which also appears doubtful, because behaves differently in case of using <Wire.h> <Adafruit_PWMServoDriver.h>and <Servo.h> in first case sends and receives message from C#, and second hangs with serial COM3 selection, I'm not sure what such damage should be  for connection with serial, if PWM code uploading allows C# read COM3, and receive serial message, when  examples freezes with selection of initialized port.

Everything looks so that the reason can be anywhere, but looking on the results, at the same time everything excluded.

I have two versions of VS15 .NET Framework 4.5.2, which build is my C# application used for long time, and VS 17 .NET Framework 4.7.2 on same OS also installed and updated long time ago before failure. So, also I can try run same code from 4.7.2 version build, where target is W10, version 1803 (10.0; Build 17134), but I'm not sure if it can be reason.

Everything used to work fine as a system with the old code until recently, and code has not been changed, it is still same old code, there is nothing added or even edited. I use this program and device for 3 years everyday. Now, every part of the system works fine individually, but not with serial command using, I have described this in details in 5 and 3 paragraphs of edit above. I'm really stacked, not because I can get new devices only in few weeks, but because devices separately works, seems like it is different problem.

Edit 3:

I've tried disable Defender in Windows OS, but it does nothing with problem.

I still can't find solution for this problem. Here is my minimal WinForms desktop application repository Single servo control, which is VS 17 .NET Framework 4.7.2 build, as example of my C# control with simple and basic button and trackbar controls for single servo motor. I'm almost sure, if you will try it for your controller with given PWN or any given sketch from above with appropriate shield library, it will work.

If someone has ideas, I'm not sure what can I check else, would be very helpful to get your advice.


问:
How to obtain live vertical height values using LIDAR
I plan to control the flying height of my drone using a LIDAR (in real-time). Therefore, I would be attaching the LIDAR to my UAV, pointing vertically downwards. However, after looking at some of the LIDAR datasets, I see that there is a wreath of information. How do I extract the vertical height from here? </p>

ContentLicense: CC BY-SA 4.0


问:
G-code to cartesian co-ordinate converter
Hope you all are doing well.

So I built a 5 bar linkage mechanism using arduino and python.It uses 2 servos, an arduino mega, a 12v power supply,a dc-dc step down converter to power everything.
The arduino's job is to to take two angle input in a csv format via usb serial input and rotate the servos to that specific angle.
The python script's job is to take a xy input in csv format via terminal and calculate the two angles using inverse kinematics so that the end-effector reaches the desired xy position and send them to the arduino via serial.

I have been seeing a lot of pen plotter videos recently and saw almost all of them use grbl and universal g code sender.
What i want to do - use g codes to with my python script to plot figures.(I dont care about accuracy,i just want to see some plots :]).

So is there any scripts or something related which takes G-codes as input and outputs XYZ position of the toolpath in correect sequences so that
I can just input those sequences in my python code to get the plots hopefully?


问:
Checking for external compass in mission planner
How can I check whether the external compass is really selected for my APM 2.8 using mission planner.
The primary purpose of using the external compass is to have less electro magnetic interference and hence higher accuracy but I am really not sure which of the two is really providing the input to the system.</p>


问:
problem roomba 500 power saving scheduler
anybody experienced problem with power saving and scheduler command?

I have roomba 521 with last firmware updated via OSMO, so now it has also power saving feature.

I have problem with scheduler command: I send command using serial connector, roomba seem to accept my command and it beep to confirm it; but roomba don't start at defined time...

Could be some problem with power saving that prevent scheduler command?


问:
robot movement steps
What does term "number of movement steps" mean in multi-robot exploration?.

It is a performance metric for comparing results like exploration time and energy consumed by robots during exploration.

Title: robot movement steps


问:
Trajectory tolerance limits
I have a trajectory planner, which calculates the trajectory assuming that the robot is following the planned trajectory. From sensors I get the position of the robot, which has an offset from the planned trajectory. I would like to define some limits, and when the "error" is over these limits I would like to send a reset signal to the trajectory planner in order to replan from the actual position of the robot.

Measurements that I can use:

Position (x, y)

Orientation ( $\theta$)

Velocity longitudinal (v)

Acceleration longitudinal (a)

The robot is a car-like robot, so my thought goes like this:

Vertical distance $\Delta y$, has the highest priority, in order not to bump on obstacles.

Distance from the point on trajectory $\sqrt{\delta x + \delta y} $

$\Delta \theta$

Velocity and acceleration are not so important.

First of all I would like to know if I am in the correct way about this assumptions, and if there is some literature that I could read on this topic.

Second how can I determine the limits for this errors? I was thinking for y taking the half of the robots' width.

Thanks in advance

Title: Trajectory tolerance limits


问:
1 cm accuracy radio rangefinder?
I need to track a point in space. The point is less than 2 m away, it has to be passive, no batteries, and no charging.

I don't always have a line of sight. I need to pinpoint it to about a centimeter. I need to sample it at a frequency of 10 Hz or more.

Can it be done at all? Does such a solution exist?

ContentLicense: CC BY-SA 3.0

Title: 1 cm accuracy radio rangefinder?


问:
Can supervised learning be used to solve the inverted pendulum problem?
I know that reinforcement learning has been used to solve the inverted pendulum problem.

Can supervised learning be used to solve the inverted pendulum problem?

For example, there could be an interface (e.g. a joystick) with the cart-pole system, which the human can use to balance the pole and, at the same time, collect a dataset for supervised learning. Has this been done before?


问:
Corrupted Robot Model in Gazebo
I'm trying to run multiple instances (18 instances) of gazebo in parallel processes on my system to do reinforcement learning. However i'm running into an issue where the robot model in some of the instances becomes corrupted, as in, the wheels becomes detached from the robot body for some of the gazebo instances.

With some trouble shooting, I think the problem might due to high CPU load, as I launch the gazebo simulations simultaneously. The problem seemed to be alleviated when i added some sleep time between launching each gazebo instance and reduced the number of instances. However, I don't know if this was the actual cause of my issue, and if there is a proper fix that I could apply to this.

Video 1: https://youtu.be/p5kU0BICVRI

Video 2: https://youtu.be/47Sd_2S1-Ls

Title: Corrupted Robot Model in Gazebo


问:
How to make a diff robot (2 traction wheels front and 2 castor wheels back) to go straight?
I’m developing a differential robot. My wheeled robot has two castor wheels in the back and two driven wheels in the front. The motor controller I’m using can handle two motors each with 90 cpr. Each motor has a PI controller built-in in the motor controller to control how much current (torque) goes to the motors. I have a Python code that sends ticks/s to the motor controller for each motor. If I want the robot to go straight, I just send the same ticks for both of the motors. I know that is impossible to achieve perfect straight line. The problem is that I’m not able to maneuver the rover because whenever I want to go straight (sending same speed for both motors), it ends up rotating in place to the right. Therefore, the left side is moving way quicker than the right ride. Could it be and issue with the tuning? I have the same value of the PI constants (KP and KI) for both motors. I was thinking in implementing a PID controller in the Python side to have another closed loop system besides the one in the motor controller. Is it recommended this approach? What else I can try?

Best,


问:
Waking Up Roomba Over Serial
Sorry if this is a noobie question, it's my first time posting on this forum...

I've been trying to mod an old Roomba 400 series (model #4220) by adding a raspberry pi to it. (I know real original huh?) I have the raspberry pi communicating over serial with the EZSync018 cable. I have everything working, except that I can't seem to wake the roomba up after it goes to sleep. I try pulsing the DD (pin 5) with pyserial like so

import serial
import time

ser = serial.Serial("/dev/ttyUSB0",57600)

ser.setRTS(0)
time.sleep(0.1)
ser.setRTS(1)
time.sleep(2)
```

Even sending the START or CONTROL commands don't seem to do anything if the roomba is asleep. If I press the power button it turns on and accepts commands normally, but I want it to be able to wake up on it's own.

I have a suspicion that the cable might have a wire switched, but I wanted to post here to see if anyone else had any experience or ideas before I mutilate a perfectly good sync cable.

Any help / feedback is greatly appreciated! Thanks!

Title: Waking Up Roomba Over Serial


问:
Why do we connect pins 2 and 3 on APM to enable PPM
Why is it necessary to connect signal pins 2 and 3 via jumper on an APM2.8 board to enable PPM.
I am using flysky  fs-ia6b receiver with the APM mentioned above.
Pins 2 and 3 control pitch and throttle respectively so how does shorting these two pins helps with PPM and why not roll (pin1) and yaw (pin4) require such shorting. </p>


问:
How to obtain airspeed data
I want to measure the airspeed on a flying vehicle and get the data with a microcontroller. Note that, there will not be any control mechanism on the flying object, it will be flying mechanicaly/passively, I mean no flight controller or something like that will be present.

However, I could not understand whether there is a sensor to measure the airspeed directly or is airspeed something you analyze by using other datas(temperature, pressure etc.)

I saw there are sensors which are sold as "airspeed sensor" however it is not so common that I cannot find examples in which the incoming data is shown.

Anybody ever experienced with this issue may lighten me.

Thanks in advance.

Title: How to obtain airspeed data


问:
Why am I unable to tune the PID parameters on my quadcopter?
I am building a nano quadcopter in X-Configuration with coreless DC motors, 65mm 2 blade propellers and a 1S Lipo battery (860mAh, 25C). The weight of the assembly is around 70g in total.

I am writing code for the flight controller of the quadcopter from scratch. However, even after multiple attempts, I am just not able to get the quadcopter PID controller to be stable. Currently, I am trying to tune just the controller for the pitch value. But even after trying lots of values and methods like the Zeigler-Nichols method the controller does not become stable. It always ends up unstable and oscillating about the setpoint.

Could any of the following reasons be responsible for this:

Some quick measurements and tests on the motors indicated that each motor could generate a maximum of 25g thrust at max voltage(of the battery) 4.2V. So four motors would generate a max total of 100g. Could it be that the quadcopter is too heavy at 70g for these motor-prop pairs?

I am tuning the output of the PID controller is in terms of voltage in the range of 0 - battery_voltage and this is then converted to PWM values. Could this be leading to problems?

If not these then what else could be leading to an unstable controller? I am stuck on this for a long time now. I would greatly appreciate any help.


问:
DH parameters to compute the transformation matrix
Below is my code. All values of theta, d, a and alpha are known.
How should I define T00, T01, and so on?

function [T] = dhtransform(theta, d, a, alpha)

T = [cosd(theta) -sind(theta) * cosd(alpha) sind(theta) * sind(alpha) a * cosd(theta);
     sind(theta) cosd(theta) * cosd(alpha)  -cosd(theta) * sind(alpha) a * sind(theta);
     0,sind(alpha),cosd(alpha),d;
     0,0,0,1];

end

T00 = [1 0 0 0; 0 1 0 0; 0 0 1 0; 0 0 0 1];
T01 = dhtransform(30, 10.25, 0, 90 );
T12 = dhtransform(45, 0, 9, 0);
T23 = dhtransform(-90,0, 9, 0);
T34 = dhtransform(45,0, 0, 90);
T45 = dhtransform(60, 6.25, 0, 0);

Endeffector = T00 * T01 * T12 * T23 * T34 * T45;

end


问:
Choosing right motors for self-balancing robot
I’m looking for right motors for my first self-balancing robot.

Design assumptions:

robot height: around 120-200 mm

robot weight: around 600-800 grams

wheels: 80x10 mm or 90x10 mm

battery voltage: not sure yet, but something between 7,2 - 12 V (depending on
the motors)

So as I know, I should looking for DC motors with encoders, right? I also thought about stepper motors.

My little calculations:

Required torque = robot height * robot weight * gravity * maximum tilt angle

$Rt_{min} = 0,12 m * 0,6 kg * 9,81 \frac{m}{s^2} * sin(40^\circ) = 0,454 Nm$
$Rt_{max} = 0,20 m * 0,8 kg * 9,81 \frac{m}{s^2} * sin(40^\circ) = 1 Nm$

So, in best scenario I will need 0,454 Nm and in worst 1 Nm. So, if I have two motors then I can divide this required torque by 2, right?

Can you advise me on the right motors for my project? I’m not sure about motor speed, gear ratio and how much torque do I need to get good balancing without damaging/overloading motors.

Thank you,
Adam.


问:
Looking for aid in a project
I'm starting a project and it's my hardest yet I'm dipping my toe in to robotics by creating a odradek from the game  death stranding I've laid out what the plans should look like and now I'm trying to see what I'm actually supposed to do now. I know I need a Arduino , a LED and a few dc motors but the kind of motors I need I can't seem to find any like it. Reminder I've never done something like this before and having a helping hand would be great just some one who can point me in the right direction.
I can send a concept Sketch</p>

Title: Looking for aid in a project


问:
What is the corrispettive motion convention for robotic systems with X,Y,Z axis?
We built several systems coupling multiple linear micrometric stages. I can't find a standard defining the axis convention of these kinds of systems, it there are any.

Regarding the system on the left, I would say that is an XZ system while I would define the system on the right XY system. However, I can't find any standard where this convention is explicitly stated.
For us, this is very important because we want to define univocally the various categories that we developed.
Is there any ISO standard? Or best practice I can use as reference this convention?


问:
How to create a 4 sensor PID wall follower
I need help creating a 4 sensor PID wall follower, which has two walls either side of the robot and the goal is to keep the robot central and not crash into the walls, the sensors are positioned in the following photo:

So far I have successfully created a right side PID wall follower using sensors 1 and 3 but I am not sure how I should combine the right and left side, I am not sure if I should work out the total error rate for the right and left side then take it away, or work out the total PID by taking the PID from the right and left values.

Any help would be greatly appreciated : )


问:
Gyroscope signal when mounted on a deflated tire
Before I do the experiment, I am a bit confused about the expected signals provided by a 3-axis gyroscope (angular velocities vs. time) mounted on the edge of a (slightly) deflated car tire when the car is moving.


问:
Moment of Inertia of a planar rotation link with a 6-DOF base
I'm interested in analytic calculation of a moment of inertia of a robot's arm in the following situation.

Let us assume the following:

Stationary reference frame $ \{b\} =  \{X_B, Y_B, Z_B\}$ and body-attached reference frame $\{s\} = \{X_1,Y_1,Z_1\}$

A robot with four 3-DOF legs consisting of a 3 revolute joints (2 of which have parallel rotation axis)

Rigid body (with 6-DOF relative to $\{b\}$ frame) that connects all legs via a revolute joints

A leg of interest is constantly bent in a way that $\alpha = \frac{\pi}{2}$ and can rotate only along $Z_1$ axis about angle $\theta$

Moment of inertia $I_{1z}$ of a leg of interest along $Z_1$ axis

Given that the leg can only rotate along the $Z_1$ axis how does one calculate the matrix of inertia of said leg for reference frame $\{b\}$?


问:
Flysky I6 transmitter not responsive on betaflightl
I am building a fpv quadcopter and I encountered the following problem:

I soldered all points correctly into their allocated pads and ensured there were no shorts. I use a racerstarf4s flight controller and esc combo which is in relatively good condition.

I used a flysky ia6b receiver which is bound to the transmitter as indicated on both devices.

When I start betaflight and continue to the transmitter section when I move the sticks around on the transmitter no input is detected.

How do I make this detectable, how can I make it control the drone?

Thanks


问:
EKF linearization using Taylor expansion and absence of operating point
If we consider the first-order Taylor expansion of a general nonlinear function at the operating point $x=x_0$, then we have the following,

$$f(x) \approx f(x_0) + \frac{\partial{f}}{\partial{x}}|_{x=x_0} (x - x_0)$$

If we now consider the linearization process of the EKF motion model equations with general nonlinear dynamics given by

$$\dot{x} = f(x,u)$$

then we find,

$$f(x,u) \approx f(x_0,u_0) + \frac{\partial{f}}{\partial{x}}|_{x=x_0,u=u_0} (x - x_0) + \frac{\partial{f}}{\partial{u}}|_{x=x_0,u=u_0} (u - u_0)$$

$$\dot{x} \approx f(x_0,u_0) + \frac{\partial{f}}{\partial{x}}|_{x=x_0,u=u_0} (x - x_0) + \frac{\partial{f}}{\partial{u}}|_{x=x_0,u=u_0} (u - u_0)$$
And in discrete form using Euler integration,
$$x_{k+1} = x_{k} + f(x_0,u_0)\Delta t + \frac{\partial{f}}{\partial{x}}|_{x=x_0,u=u_0} (x - x_0) \Delta t + \frac{\partial{f}}{\partial{u}}|_{x=x_0,u=u_0} (u - u_0) \Delta t$$

However, whenever I see the EKF linearization process explained, the evaluation of the original function at the operating point, $f(x_0,u_0)$, and the differences from the operating point, $(x-x_0)$ and $(u-u_0)$, seem to be ignored. As such, we instead get,

$$x_{k+1} = x_{k} + \frac{\partial{f}}{\partial{x}}|_{x=x_0,u=u_0} x\Delta t + \frac{\partial{f}}{\partial{u}}|_{x=x_0,u=u_0} u \Delta t$$
$$x_{k+1} = x_{k} + A_k x_k \Delta t + B_k u_k \Delta t$$
where $A_k = \frac{\partial{f}}{\partial{x}}|_{x=x_0,u=u_0}$ and $B_k = \frac{\partial{f}}{\partial{u}}|_{x=x_0,u=u_0}$
which is equivalent to
$$x_{k+1} =  A_{d,k}x_k + B_{d,k} u_k$$
where $A_{d,k} = I+A_k\Delta t$ and $B_{d,k} = B_k\Delta t$ are the discrete-time state transition matrix and control input matrix, respectively.

I'm sure it has been well documented somewhere, by why are we allowed to only consider the operating point $(x_0, u_0)$ in the $A$ and $B$ Jacobians (and by extension the observation/measurement Jacobian used in the EKF's update step), and ignore $f(x_0,u_0)$ as well as replace $(x-x_0)$ with $x$ and $(u-u_0)$ with $u$?


问:
How to prevent loss of mavros msg packets?
I am working with Pixhawk 2.1 cube, using telemetry module and mavros to establish communication between vehicle and companion computer. I am using rostopic echo to save /mavros/local_position/pose msg to a csv file. While working in sitl there is loss-less transmission of data. But when I connect to real vehicle there is huge loss of data and very few data points gets stored in csv file.

What is the reason behind this?


问:
6 DOF Spherical Wrist IK Calculation (Unity)
So i solved the first 3 Joints of this 6DOF but i dont know how to deal with the Rotation Matrix at Joint 4,5 and 6. I know that i need a XYX Rotation Matrix but I dont know how to affect the TCP with it.

This is my current State:
https://www.youtube.com/watch?v=YVI0FZqCo1g

If there are Questions about smth let me know


问:
When do I do motion planning?
I am studying mobile robots, and I am focusing my attention to the unycicle. I have a doubt concerning the motion planning part. In particular I don't understand when the motion planning is done and where to put a motion planning module in a block scheme.

Suppose I want to build an artificial potential field to drive the robot to an initial position to a final position. I don't understand if I have to do first the localization, for example using an Extended Kalman Filter, or the localization comes after.

For what I have undeerstood, I first need to stabilize the system, for example using feedback linearization, and then pass the velocity inputs to the robot. Then I have seen that we do localization, which if we look at a block scheme will be in the feedback part.

But, in this block scheme I don't undesrtand where to do motion planning.

Can somebody please help me?

[EDIT] I have to fill my block scheme with three elemnts:

-A robot-independent module that uses the environment geometry and the assigned goal to build an artificial force field $f(p)$.

-A module that transforms the artificial command f(p) into actual velocity inputs $v$,$ ω$.

-. A module that computes the robot state needed by the first two.

the robot I am considering is a unycicle were $q = (p, θ)$ is the robot configuration, with $p = (x, y)$, and by $v$,$ ω$ its velocity inputs. An idea that came into my mind is to wrrite a block scheme where I perform input-output linearization, so I have to add a decoupling matrix $T(x)$, which will work as module that transforms the artificial command f(p) into the velocities, but the rest I don't know much how to do. For example what I tried is:

but for sure it is not correct, since I am not considering $f(q)$ and I don't know how to place the motion planning part.

I am considering artificial potential field.

Can somebody help me?

[EDIT] ingnore the arrow going a little bit out in the feedback, it is a mistake I did when using the software. Sorry it is the first time I do i blck diagram on a software.

Title: When do I do motion planning?


问:
How do I say if a system is differentially flat?
I am studying mobile robots, and I have encoutered the concept of differentially flat systems. I have seen that if a system is differentially flat, we can identify flat outputs, thanks to which we can reconstruct for example the inputs and the orientation.

For example, for a unycicle, the flat outputs are $x$ and $y$, and with them we can reconstruct the inputs  $v ,w$ , which are respectively the driving velocity and the steering velocity, and we can reconstruct the orientation $\theta $.

But, how do we know if a system is differentially flat? And basing on what do we identify the flat outputs?

I have understand what is a differentially flat system, but I don't know how to say if a given system is differentially flat or not, and if yes, I don't know how to identify the flat outputs.

Can somebody please help me?


问:
How to make small quantities of gears
For a hobby project, I'm designing a clock with a single hand that makes one revolution per year.  Using really helpful sites like https://geargenerator.com/, I have the gear ratios and dimensions worked out, and now I'd like to start prototyping.

What's a reasonable way to get some gears made for that?  I don't want to spend a lot of money (this is just something to hang on my own wall, probably) but I do want the gears to function correctly.

Is 3d printing a good option for gears, or will they need to be machined?  For scale, I think the largest gears will be about 2-3 inches in diameter with around 80 teeth.  If machining is necessary, are there different quality options that affect price?

For the curious: my gear ratios are 8:83, 8:59, 8:47, and 8:13.  That comes out to 4096:2992067, i.e. 0.5:365.2426 - so a motor designed to go around twice per day (a clock hour hand) should slow down to once per year (including leap years!).

Obviously there's probably some pretty basic stuff I don't know, like whether people usually work with gears in standard tooth numbers or whether weird numbers like the ones I have are accessible.

Thanks for any insight.

Title: How to make small quantities of gears


问:
MPU6050 Gyro rotaion always around Y axis
I am using an MPU6050 IMU. I did a small experiment having Z-axis pointing upwards.
1. Rotate 90deg around Z-axis (yaw) and back to the original position
2. Rotate 90deg around X-axis (roll) and back to the original position

The issue is that accel data is perfect and I could see data as expected. But, the gyro data shows rotation only around Y-axis. I am a bit confused. Is this expected and need some post-processing to get the Euler angles. OR is there an issue, Please explain.

Accel Data


问:
Yaw, Pitch, Roll rate concepts and how to calculate them with an IMU
I need help understanding the difference from Y/P/R rate and the data that I can get from a gyroscope. I am using the raw readings of my IMU (MPU9250) and the Madwick Filter to calculate a quaternion that represents the orientation of my device, then I can get the Y/P/R angles from it, also I need to get the Y/P/R RATES and this is where my mind gets confused. If my understanding is correct, these are the rate of change of the corresponding angles. A gyroscope can measure rotation around three axes: x, y, and z, right? And they are not the same as the Y/P/R angles. How should I be getting the data I need with using only an IMU?

I'm am really sorry for my badly written explanation, English is not my first language and  I'm a software engineer not specialized in this field so it gets even harder to communicate my doubts. Thanks!


问:
Interpreting results from Camera Calibration?
I used OpenCV's findChessboardCorners on a few checkerboard images (40~) and about 27 seemed to find the corners accurately. How does one proceed from here? Do I calculate the reprojection error over just the correctly identified images? Is this normal to expect?

Some of the correctly identified images -

Some of the incorrectly identified images -

How I'm calibrating my images -

def calibrate():

    criteria = (cv.TERM_CRITERIA_EPS + cv.TERM_CRITERIA_MAX_ITER, 30, 0.001)

    objp = np.zeros((6*9,3),np.float32)
    objp[:,:2] = np.mgrid[0:9, 0:6].T.reshape(-1,2)

    objpoints = []
    imgpoints = []

    images = glob.glob('*.png')

    for fname in images:
        img = cv.imread(fname)
        gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)

        ret, corners = cv.findChessboardCorners(gray, (9,6), None)

        if ret == True:
            print('Hello')

            objpoints.append(objp)

            corners2 = cv.cornerSubPix(gray, corners, (11,11), (-1,-1), criteria)
            cv.drawChessboardCorners(img, (9,6), corners, ret)
            imgpoints.append(corners2)

            cv.imshow('img',img)
            cv.waitKey(500)
    cv.destroyAllWindows()

    ret, mtx, dist, rvecs, tvecs = cv.calibrateCamera(objpoints, imgpoints, gray.shape[::-1],None,None)

    return objpoints, imgpoints, ret, mtx, dist, rvecs, tvecs
```


问:
Using gyroscope to calculate forward kinematics
I want to measure the end-effector position of the robot that I attached. I'm using both gy-25 and gy-521 for calculation of the angle. As shown in the picture, joint 1 has 2 DOF, one for spatial movements, and the second one for planar rotation. The angles of the planar movement of joint 1, measures by an encoder. Each of joint 2 and 3 has 1 planar DOF, and the angles are measured by gy-521 and gy-25. I want to measure the angular rotation around the first joint's spatial axis and planar rotation of joint 2 with gy-25. The planar rotation of joint 3 measures by gy-521.
If I rotate the first joint around its spatial axis or rotate the joint 2 in the plane, the values of the roll, pitch, and yaw of both gyroscopes change which means that the rotation is a combination rotation around multiple axes because the gyroscope reference frame is global, but the rotation isn't around one of that reference frame's axes. So I want to transform the angles which are in the global frame to be measured in the local frame of the sensor, but I don't know. Can anybody help me with that?

Thanks in advance

Edit:

I attached the new figure below. Z1, Z2, Z3, Z4 are the rotation axes. Joint 1 is for spatial rotation, and on the links 2 and 3, I attached two gyroscopes (gy-25 and gy-521) to measure the theta1 in joint 1, theta 3 in joint 3 and theta 4 in joint 4.  Theta 2 is being measured with an encoder.

Forward kinematic:

X = bcos(theta1) + cos(theta1)(L1*cos(theta2) +L2*cos(theta3)+L3*cos(theta4))

In my real system, you should rotate the figure 90 degree CCW and with this configuration, if you fix joint 2, joint 3, and joint 4 and just rotate around joint 1 (theta1), then all the values of both gyroscopes change. So I need to transform the gyroscope values from their frame into the global frame so that I can measure theta 3, 4, and 1. I know I should use the transformation matrix, but I know how to calculate that based on the gyroscopes values.


问:
implement torque control on a robot with some joints supporting torque control while others only supporting velocity control
I have a robot, some joints of which supports torque control,while the rest only supports velocity control. What should I do to implement torque control on the whole system?</p>


问:
Removing the motor from a 2.5" HDD for controls project
I have a project that requires an extremely high rotation rate motor, and I have a 2.5" HDD that I'd like to take the motor out of. I chose a 2.5" HDD for lightweighting reasons and for the drive platter size.

Upon disassembly, I discovered that the motor was mounted with a press fit or epoxy. The method of mounting was something I had neglected to consider, but fortunately I didn't purchase a new HDD for this experiment.

I have access to a milling machine and can cut the motor out, along with a built-in mounting bracket, but this would be tedious and I don't really want to do this. Does anyone know whether it is possible to extract a usable motor of this type from the HDD casing? If it is possible, how?

Alternatively, if anyone knows where I can find pre-balanced motor/disk combinations that can hit 10+ kRPM without breaking the bank, I'd be extremely interested in learning where such things exist.


问:
What sort of robot would one use to tie precise knots in a string?
I need many knots tied repetitively and consistently in a string. I have been trying to make something which ties knots for me in a consistent manner. I've got a project which requires a few hundred strings, each with knots tied at regular intervals. I'm designing my own mechanism, but if another mechanism of the same sort already exists, I can draw a lot of inspiration from it.

The most important parameters are:.

The knots must not vary in size/line use by more than a millimeter.

The knots must be square knots, or they can be simply looped to melt the line back on itself.

What kind of robots or mechanisms currently exist that can tie knots according to the parameters above? Do any such mechanisms exist?

Here are some examples of what I'm looking for the mechanism to do.


问:
Are rotary encoders necessary for holonomic mecanum drive?
I'm making a robot which is going to have a holonomic mecanum drive. The doubt that I'm having is that should I use rotary encoders for doing so.

The bot will be manually controlled so would it be possible for me to ignore the rotary encoders?

Clarification

The thing is that I need to decide whether or not I'll be using motors with rotary encoders in my robot.

What I'm thinking:

  Is it really necessary for me to use rotary encoders for implementing holonomic drive? I know that holonomic motion is attained through the appropriate vector sum of velocities generated by the motors. But since the bot is going to be manually controlled, can't I ignore the accuracy of the motion(by not using rotary encoders) as the controlling human might himself be managing those errors simply by seeing the bot's motion.


问:
Do I need Fantom Tether Interface for ROV
I try to make a ROV for some undergraduate science project.I planing to use  raspberrypi for control and image processing but ı will use ethernet cable for cominication. But every source ı look they say I need to use a tether interface board(fathom series mostly) my question is do I really need a tether interface cause I dont actually know why ı need a tether interface while ı can simply connect my raspberrypi to my computer with a ethernet cable.</p>

OwnerDisplayName: Umut


问:
Motor driver PWM frequency
What can happen to the motor driver if I give input PWM frequency more than the rated(capacity)?

I'm using Maxon motor with specifications:
Operating on 24V
Speed: 600 RPM
Nominal Torque: 21 Kg-cm

Title: Motor driver PWM frequency


问:
Increasing suction force
I'm trying to increase the suction force of the end effector in a pick and place system. Is it a good idea to add an extra vacuum pump and put it in parallel? AFAIK, having an extra pump in parallel increases airflow whilst an extra pump in series decreases pressure. However, this paper I'm reading claims to have two pumps in parallel: https://arxiv.org/pdf/1710.01439.pdf

To achieve this result the suction is driven by two vacuum pumps in
  parallel, each rated with a free air flow rate of 10CFM and an
  ultimate vacuum pressure of 0.3Pa.

In fact, would adding an extra pump render no effect as the pumps may leak due to such low pressure? The pump I've got is a rather weak one: 12V, vacuum range: 0 - 0.082Mpa, pressure range: -0.12Mpa - 0, flow: 400L/H. It's one of those with a rotating cam inside.

Title: Increasing suction force


问:
Find the kinematic parameters using DH by Craig convention
I am trying to find the kinametic parameters using the J. Craig of the DH parameters for the following 2-DOF robotic manipulator.

where $\ x,y $ are the axes of the reference frame and $\ q_1 , q_2 $ are the parameters of the revolute and prosmatic joint correspondingly. Until now, I have come up with the following solution:

My problem is that I am not at all sure if the term $\ θ_1 - 90 $ is correct and if I have correctly placed the frames for the joints and the end effector. Axes $\ x_0 , y_0 , z_0 $ are the axes of the reference frame, axes $\ x_1 , z_1 $ are for the revolute joint, axes $\ x_2,z_2 $ are for the prismatic joint and axes $\ x_e,z_e $ are for the end effector. I have intentionally left out the $\ y $ axes of the joints and the end effector since they are derived from the right hand rule.


问:
How To Run the kuka_experimental program on github In RViz?
I have installed Ubuntu 14.04 and installed ROS Indigo in order to run the kuka_experimental source code which can be found on github. I have built the catkin workspace and compiled the kuka_experimental source without errors. How do I run or launch the various KUKA robot models in RViz simulation environment? Do I ROSLaunch kuka_eki_hw_interface or kuka_rsi_hw_interface or kuka_rsi_simulator and how do I view it in RViz? Also how to use MoveIt with this kuka_experimental package as there is no Indigo version of MoveIt and Kinetic version has compile errors and requires Ubuntu 18.04?</p>


问:
Constructing control system
The problem i have is more or less is biology related, but I can simplify the problem as such. I have a tank of water. I try to increase the concentration level of this tank of a certain substance (X) at a fixed rate. Too fast or slow of change of concentration X is undesirable. I have infusion of concentrated X solution to the tank, with known concentration but adjustable rate. And there is a unknown leak of fluid in the tank. Every fixed amount of time, I measure the concentration of the tank, and need to change the infusion rate such that the desired rate of change is achieved.

The only mathematical relationship is as follows
Concentration = solute / volume of solvent

New concentration = (tank volume x tank solute concentration + infusion rate x infusion solute concentration - loss volume x loss solute concentration ) / (tank volume + infusion rate - loss volume)

How would I design such control system?

Title: Constructing control system


问:
What do I need to know about the dynamics of an industrial robot?
Apart from kinematics, what do i need to know about the dynamics and other things of a robot in order to calculate the angles of the joints for positions of the end effector exactly? that means: if i have a working model of a robot in matlab without considering masses and friction, will the end effector move according to the simulations in matlab?</p>


问:
Use Realsense camera to get the camera image
I have to use LIDAR in my project. I was searching for some LIDARs with a camera and came across the Intel RealSense d400 series. I know it has a camera but please suggest a way to use that camera along with getting the distance from the sensor in python.</p>


问:
Algorithms for controlling low-speed movement of gearless robots
Collegues, i am a little discouraged by the lack of a clearly formed section in the literature on which algorithms are used to control the low-speed movement of gearless robots.

In my opinion, it is extremely important to take into account friction, disturbances in the measurement of controlled parameters, etc.

In this case, conventional PI, PID controllers are not suitable.

It seems to me that you need to start by studying specific examples of such systems. For example, I noticed the book Hard Disk Drive Servo Systems. Robust control is commonly used here.

What pushes me away is that the system can be unsteady and indefinite, and robust synthesis requires an accurate mathematical model.

Perhaps special adaptive algorithms are needed?

Are my arguments true, or is it worth going the other way?
Can anyone advise several sources from which you can begin to study the issue?


问:
Problem with solution (equation) for wrist singularity
In my textbook about industrial robots it says that if the angle q5 in this robot is equal to 0, there are infinite solutions for the angles q4 and q6. I understand this part, but I have a problem with the equation below.

As a solution for this the book says f(q4,q6) = c1*(q4A - q4)^2 + c2*(q6A-q6)^2 = MIN

q4A and q6A are the joint angles calculated from the previous backward transformation when driving a robot path.

By the above equation, a solution for q4 and q6 is taken which is closest to the previous solution.

Between two IK solutions (intermediate points) on a line that the TCP must travel, Q4 must rotate from -pi/2 to -3/2*pi, and Q6 must rotate from pi/2 to -pi/2. Both joints must therefore cover a rotation of -pi.

So the formula would be: c1*(-pi/2 - (-3/2*pi))^2 + c2*(pi/2-(-pi/2))^2

Since I do not know c1 and c2 and the book does not tell me how to determine them, I cannot calculate a solution. How do I calculate the angles for Q4 and Q6?


问:
Singular Configuration - Balanced Wrench F?
I've been asked to show that if a manipular is at a singular configuration, then the End Effector wrench can be balanced without any joint torques.

I know that t = J*F where (t = torques, F= end effector forces, J is the Jacobian). Hence F = (pinv(J))*t. Hence, if J is singular, then we cannot invert it and find F, as the inverse of J is effectively infinity.

Here however, I basically have been asked to show that there is 0 torque for any end effector wrench F. Which is similar to Ax=0

How would I proceed?


问:
Constraining Field of view in visual servoing
I am using image based visual servoing using an eye-in-hand camera. However the camera's motion sometimes servos such that the image features are out of the field of view,and servoing stops. Is there any way to constrain the camera motion such that the image features always remain within the camera field of view ?</p>


问:
Increase frequency of status messages from UR5
I know the UR5 is sending me messages with its status (I can't yet understand them though, but I'm already working on that).  However, they are too far apart to be useful: It sends them every 0.1 s.  I would like that to be at least every 0.01 s.  How can I change that configuration?</p>


问:
Single Camera + Laser Projector Triangulation
I want to combine a laser line projector (projects a laser plane) and a single web camera to determine the X, Y, Z position of the laser point. I am slightly confused as to how to use the fact that we know the plane of the laser to advantage. </p>

<p>I have the camera intrinsics, and I know that the the laser projector is at an offset of some distance from the camera (no rotation.) </p>


问:
Intel RealSense Depth Camera D435i Wide Imager questions?
I have just ordered my d435i and while it was not intended to do NDVI I read the data sheet and noticed it had seperate image sensors, it is possible to read the IR image from either left, right or both wide imagers? if so, would this image only contain reflectance values from NIR spectrum ie. 650um above?  </p>


问:
Intel Realsense Cameras for Object Avoidance and SLAM to go to destination
My goal is to make a UAV which can search an area while avoiding obstacles. I figured I would navigate using the SLAM and Intel Realsense D435i (a stereoscopic camera with an IMU built in), but all of Intel's examples seem to use D435i for object avoidance, but another camera, the T265 for navigation. Am I missing something about these cameras that would make this application necessary to contain both cameras? And if not, are there any suggestions for resources to look at to achieve this goal?</p>


问:
Roll, pitch and yaw in a quadcopter
The axis definition affect the roll, pitch and yaw definition in a quadcopter?

Image I have the axis defined this way:

then to roll I have to put a higher velocity in (1) than in (3) (turn around the $x$ axis), and to pitch I have to put a higher velocity in (2) than in (4) (turn around the $y$ axis), for example. But what if I have the axis defined like this:

the turn around the $x$ axis will happen when 1 and 4 have one velocity and 2 and 3 another one, and the turn around the $y$ axis will occur when the velocity in 1 and 2 is $v_1$ and the velocity in 3 and 4 is $v_2$, for example.

Is that correct? How are the kinematics equations in this case?

Title: Roll, pitch and yaw in a quadcopter


问:
EKF landmark-based help needed
I am new in localization algorithms and EKF is new for me as well. I think that I implemented EKF (the whole code of class is here. I have problems in updating bearing angle of the robot. Basically I have to subtract expected measurement from real measurement. Or $$ [range_{measured}, bearing_{measured}] - [range_{expected}, bearing_{expected}]$$. I am stuck a bit with that stuff. Please give me some advice on how to get correct bearing for innovation step.

Here is my measurement model function:

```<code>def measurement_model(self,state):
        x = state[0]
        y = state[1]
        theta = state[2]
        px = self.cur_id[0] # x coordinate of current beacon
        py = self.cur_id[1] # y coordinate of current beacon

        r = np.sqrt((px-x)**2 + (py-y)**2)      #Distance
        phi = np.arctan2(py-y, px-x) - theta    #Bearing

        self.Z[0] = r
        self.Z[1] = phi
        return self.Z
</code>```

Update function:

```<code>def update(self, msg): #
        self.cur_id = self.beacons[msg.ids[0]] # coordinates of current transmitter

        # landmark position in robot frame
        pos_x = msg.pose.position.x
        pos_y = msg.pose.position.y
        rng = np.sqrt(pos_x**2 + pos_y**2)
        #bearing
        theta = self.wrap_to_pi(euler_from_quaternion([msg.pose.orientation.x, msg.pose.orientation.y, msg.pose.orientation.z, msg.pose.orientation.w])[2])
        self.observation_jacobian_state_vector()
        new_theta_meas = np.arctan2(self.cur_id[1] - pos_y, self.cur_id[0] - pos_x) - theta # HOW DO I GET THIS CORRECTLY

        #nominator
        floor = self.cov_matrix.dot(self.obs_j_state.transpose()).astype(np.float32)

        #denominator
        bottom = (self.obs_j_state.dot(self.cov_matrix).dot(self.obs_j_state.transpose()) + np.eye(2)*0.01).astype(np.float32)

        self.K = floor.dot(np.linalg.inv(bottom))

        expected_meas = self.measurement_model(self.state_vector)
        tempterm = np.array(([rng - expected_meas[0],new_theta_meas - expected_meas[1]]))

        self.state_vector = self.state_vector + self.K.dot(tempterm)
        self.cov_matrix = (np.eye(3) - self.K.dot(self.obs_j_state)).dot(self.cov_matrix)
        print(self.state_vector)
</code>```

Title: EKF landmark-based help needed


问:
Hint regarding Localization & Map Scaling
I just started with mobile robotics. I'm trying to do a collaborative system between a mobile robot and a ceiling camera (Raspberry). They should do all tasks as a "team". Means Calibration, Pathcreation/planning (just based on camera created map), Localization, Map Updating.

Now I want to implement a localization with a given map based on the camera image and a robot with odometry and sonar sensing.

So far I implemented a Odometry Model and I have the projection matrix of my camera based on Calibration I did. It is from Vision Data (Template Matching) und Pose Data (Odometry). Algorithm was based on DLT.

And I created a binary map from the camera image which is a first Map for the Robot but the robot will Update it later based on sonar sensing (lines/marks on the ground are objects for the camera but no threat for the robot) This binary map should be like a grid map.

I am stumbling on 2 questions:

What is the best way to implement localization here? Do I need to do it with a particle filter? What It be good to have camera data (Reconstruct Imagedata to world coordinates) and sonar data as measurement model? Another roboter will later be in the same playfield, which leads to bad vision data bc my template Matching will not guess the right robot I guess?
(Robot + Camera should work together in localization)

How can I scale my so far created map after calibration? The binary image is 76x120 pixels and I have the camera projection matrix.
Do I just reconstruct the world points based on the image size?

Thanks!
Cheers.


问:
How to calculate what motor I need to move weight
I'm working on a project trying to make some electric roller curtains.
I can use 2 motors on this curtain, on each side to lift and pull down the curtain. Pulling down the curtain requires not as much power to pull it back up since pulling it up is bringing the weight of the curtain back up against gravity.

So if this curtain weighs in total, lets say 2 kgs. Once the curtain is all the way down, it's on a stall and I have to get it out of stall and roll it back up.

If I have for example a motor with the following data:

Specifications:

Rated Voltage: DC 12V

Reduction Ratio: 1: 31.6

No-Load Speed: 100RPM

Rated Torque: 4.5Kg.cm

Rated Current: 1.1Amp

Gearbox Size: 37 x 24.5mm (1.46" x 0.96") (D*L)

Motor Size: 36.2 x 33.3mm (1.43" x 1.31") (D*L)

There's the rated torque of 4.5 kg.cm which means I can move 4.5kg with an "arm" of 1 cm. Here's my first doubt, what exactly does it mean 4.5kg with an arm of 1 cm. Does it mean that if I attach a 1 cm arm, perpendicular to the motor shaft, and then at the other end of that arm I have a weight of < 4.5 kg, it will move?

Will this motor have the power to lift the 2 kg curtain based on the data? What other variables should I analyze?


问:
Formulas for calculating the passive joints angular velocities
We have the following parallel robot architecture:

Positions of the vectors $u_i, v_i, w_i$, the angles $\theta_i$, angular velocity $\dot{\theta_i}$ and the Jacobian $J$, that mapping vector of angular velocities $[\dot{\theta_1},\dot{\theta_2},\dot{\theta_3}]$ into the angular velocity $[\omega_x,\omega_y,\omega_z]$ of the platform are known.
Is it possible, using these parameters, to calculate the angular velocities of passive joints $\dot{\psi_i}$ and $\dot{\xi_i}$?


问:
What is canonical grasp?
What is a canonical grasp and how is it different from normal/other grasp? I've searched through internet and forums but haven't found any answers. </p>

Title: What is canonical grasp?


问:
SCARA Robot sending strange ASCII Characters
I am trying to send commands via a Serial COM Port (RS 232) to a TMB200 SCARA Robot's controller and when I connect it to my laptop and open hyperterminal the following random characters start showing up on the screen repetitively.

I have tried adjusting the baud rate and number of bits to all available options and while the type of characters being displayed changes, they do not become understandable. Does anyone know what the problem could be and how to fix it?


问:
Determining Orientation of a Robot Relative to a Line on Table
I am currently busy with a robot that needs to obtain it's orientation relative to a line seen by a camera. At the moment, I am using Hough lines to obtain a gradient for the line, but the gradient obtained is not the same as the orientation of the robot relative to the line. In other words, if I place the line 45 degrees Infront of the robot, the returned gradient of the line is not 1 (for a 45 degree line). I'm guessing this is due to the line being in a different plane to that of the camera image. The camera is tilted 15 degrees down, but can be made to be exactly vertical.

How would I calculate the orientation of the robot relative to the line from the lines obtained in the camera? I have attached an image to help aid in my explanation.

I would like to know if using the rotation and translation matrix of cameras would help solve this problem too.


问:
What type of camera parameters are ideal for image processing on a moving platform?
What type of camera or camera properties should I look for that would be ideal for performing image processing in a moving environment?

I'm researching the sensor requirements for processing video in real time on a mobile robot. In a past experiment, I used a simple Raspberry Pi 3 with the standard Picamera on a two-wheeled robot with the goal of navigating using visual cues. Although this was cheap and easy to setup, I found it to be nearly useless at processing video while the robot was moving because the Picamera's rolling shutter was so slow, any amount of movement would blur the image capture, making image processing nearly impossible. To implement any kind of image based navigation, I found I had to stop the robot, capture images, process, calculate the next step, then blindly move a small amount, and then repeat until the destination was reached.

This is obviously a very slow and tedious approach and far from ideal. The goal of most mobile robots should be to continuously move while simultaneously processing video.

Researching this problem more, I found that the film industry has largely already solved this problem, albeit for high speed motion capture and not robotics, by using cameras with a global shutter. This type of shutter records each pixel simultaneously instead of scanning columns of pixels, resulting in much less blur. Unfortunately, these cameras tend to be enormously expensive and more difficult to source.

However, there are some cheap cameras with rolling shutters that advertise an ability to capture motion without much blur. I believe the GoPro brand of cameras tout this ability without using a global shutter, but I've not confirmed it.

When choosing a camera for high speed video processing applications, what should I be looking for that minimizes cost while maximizing the ability to capture clear images? Most USB cameras I see, even ones like GoPros design for motion, don't usually advertise explicit metrics that I can use to gauge performance vs cost. Do I have to use an expensive camera with a global shutter or is there a low cost alternative that should be "good enough" for most robotics experiments?


问:
Question on Replacement for NEMA34 Step Motor
I have access to an old CNC router that uses HY200 3424 stepper motors (NEMA 34, pdf). They are rated 4.7 A, 90 Volt and 150/193 Nm. I would like to run them with a CNC xPro, or similar. I would like to understand how to decide on a possible replacement and what specifications that I need to look for.

Will either of the steppers below work if I can get the shaft to fit?

Dual Shaft Nema 34 Stepper Motor Unipolar 1.8 deg 2.2Nm (312oz.in) 2A 86x86x66mm 6 Wires

Nema 34 Bipolar 1.8deg 4.5 Nm(637.38oz.in) 6.0A 86x86x74mm 4 Wires

If not, what parameters do I need to be looking at to decide which motor I should buy?


问:
What is the definition of the phrase "ego robot"?
What does the phrase "ego robot" mean? I see it used in the context of multi robot systems like in the paper Game Theoretic Motion Planning for Multi-robot Racing by Zijian Wang, Riccardo Spica & Mac Schwager, and also in visual odometry. </p>


问:
PD controller tuning for flexible joint robotic arm
I am trying to tune the gains of my PD controller for a single axis flexible joint robot. The controller output is the motor torque. My question is: how can i tune the PD gains if the output (torque) is limited (i.e. the controller output is followed with saturation in Simulink).</p>


问:
two wheel mobile robot odometry
I am using an encoder to calculate the position and orientation of a mobile robot. The robot has two-wheel and each wheel is attached with an encoder, the result I am getting for my position x,y and theta is confusing. please I need help</p>

```<code>// Pin definitions.
// - enc_a is ENC Signal A line (Arduino digital pin 2)
// - enc_b is ENC Signal B line (Arduino digital pin 3)
#define ENC_A1  2
#define ENC_B1  3

#define ENC_A2  18
#define ENC_B2  19

// Main loop refresh period.
#define REFRESH_MS  50

// Main serial data connection to computer.
#define BAUD_RATE   115200

// Encoder signal line states
volatile boolean state_a1 = 0;
volatile boolean state_b1 = 0;

// Encoder signal line states
volatile boolean state_a2 = 0;
volatile boolean state_b2 = 0;

// Encoder position
volatile int enc_pos_1 = 0;
int enc_pos_prev_1 = 0;
int enc_pos_change_1 = 0;

volatile int enc_pos_2 = 0;
int enc_pos_prev_2 = 0;
int enc_pos_change_2 = 0;

// normally on a differential drive system to when moving
// forwards the wheels are rotating in opposite directions
int encoder_direction_left = 1;
int encoder_direction_right = 1;

// Timing
unsigned long micros_current = 0;
unsigned long micros_prev = 0;
long micros_change = 0;

int dleft = 0;
int dright = 0;

float pi = 3.14;

float diameter = 42;                                    //(mm)

int count_per_revolution = 12;                          //(mm)

int Lwheel_c = 140;                                      //(mm)
int Rwheel_c = 139.9;                                       //(mm)

float Rright = 0.00;                                       // radius of curvature of right wheel

float Rleft = 0.00;                                      //Radius of curvature of left wheel

float Rc = 0.00 ;                                     //Radius of curvature

double theta = 0.00;

float phi = 0.00;

float RADS =  57.2958 ;

float dtheta = 0.00;

float beta = 0.00;                                     // orientatiom

double  x= 0.00;

int y = 0.00;

float dx = 0.00;

float dy = 0.00;

//float d_ori = 0.00;

int wheelbase = 91;                                   // wheelbase

void setup() {
    pinMode(ENC_A1, INPUT);
    pinMode(ENC_B1, INPUT);

    pinMode(ENC_A2, INPUT);
    pinMode(ENC_B2, INPUT);

    state_a1 = (boolean) digitalRead(ENC_A1);
    state_b1 = (boolean) digitalRead(ENC_B1);

    state_a2 = (boolean) digitalRead(ENC_A2);
    state_b2 = (boolean) digitalRead(ENC_B2);

    attachInterrupt(0, interrupt_enc_a1, CHANGE);
    attachInterrupt(1, interrupt_enc_b1, CHANGE);

    attachInterrupt(5, interrupt_enc_a2, CHANGE);
    attachInterrupt(4, interrupt_enc_b2, CHANGE);

    micros_prev = micros();

    Serial.begin(BAUD_RATE);
}

void loop() {
    // Calculate elapsed time
    micros_current = micros();
    if (micros_current < micros_prev) {
        micros_change = micros_current + (4294967295 - micros_prev);
    } else {
        micros_change = micros_current - micros_prev;
    }

    // Calculate change in encoder1 position.
    enc_pos_change_1 = enc_pos_1 - enc_pos_prev_1;
    // enc_pos_change_1 = abs(enc_pos_change_1);

    // Calculate change in encoder1 position.
    enc_pos_change_2 = enc_pos_2 - enc_pos_prev_2;
    // enc_pos_change_2 = abs(enc_pos_change_2);

    // Emit data
    Serial.print(enc_pos_1);
    Serial.print("\t");
    Serial.print(enc_pos_2);
    Serial.print("\t");
    Serial.print(dright);
    Serial.print("\t");
    Serial.print(dleft);
    Serial.print("\t");
    Serial.print(x);
    Serial.print("\t");
    Serial.print(y);
    Serial.print("\t");
    Serial.print(theta);
    Serial.print("\t");
    //Serial.print(enc_pos_change_2);
    Serial.print("\t");
    //Serial.print(micros_current);
    Serial.print("\t");
    //Serial.print(micros_change);
    Serial.print("\t");
    //Serial.print(enc_pos_change_1 / (micros_change / 1e6));
    Serial.print("\t");
    //Serial.print(enc_pos_change_2 / (micros_change / 1e6));
    Serial.print("\n");

    enc_pos_prev_1 = enc_pos_1;

    enc_pos_prev_2 = enc_pos_2;

    micros_prev = micros_current;

    //dleft = (enc_pos_1 * Lwheel_c)/count_per_revolution;

    //dright = (enc_pos_2 * Lwheel_c)/count_per_revolution;

    dleft = (enc_pos_change_1 * encoder_direction_left) * Lwheel_c/count_per_revolution;

    dright = (enc_pos_change_2 * encoder_direction_right)* Rwheel_c/count_per_revolution;

    // add the change in angle to the previous angle

    // constrain _theta to the range 0 to 2 pi

    if (theta > 2.0 * pi)
    theta -= 2.0 * pi;
    else if (theta < -2.0*pi)
    theta += 2.0 * pi;

    Rc = (dleft + dright)/2;

    theta = (dleft - dright)/wheelbase;

    x = x + Rc * cos(theta);

    y = y + Rc * sin(theta);

    delay(REFRESH_MS);
}

// Detect pulses from depth encoder.

void interrupt_enc_a1() {
    if (!state_a1) {
        state_b1 ? enc_pos_1++: enc_pos_1--;
    }
    state_a1 = !state_a1;
}

void interrupt_enc_b1() {
    state_b1 = !state_b1;
}

// Detect pulses from depth encoder.

void interrupt_enc_a2() {
    if (!state_a2) {
        state_b2 ? enc_pos_2++: enc_pos_2--;
    }
    state_a2 = !state_a2;
}

void interrupt_enc_b2() {
    state_b2 = !state_b2;
}
</code>```

Title: two wheel mobile robot odometry


问:
Need help regarding electromagnetic suspension implementation
I an trying to implement an electromagnetic suspension system on model/small scale (like the bose suspension system in this video: https://youtu.be/3KPYIaks1UY). Upon doing some research on this topic, I found out that linear electromagnetic motors are used for this system. But I am unable to find any actuators for small scale usage. Does anyone know which components I can use for this project? Or can I just use normal electromagnets and control them with a microcontroller (Is this possible ?) If not, what alternatives do you suggest for this project ? Before implementing a full 4 wheel car model, I just want to make a single wheel model first before moving ahead. Please help !</p>


问:
Avoiding obstacle of a car robot using IR
I am using an IR sensor which detects the obstacle. My question is how does 2 robots stops on a finish line which is an object higher that the height of the car robot if i am using IR, comparator(LM741),Relay, bjt, diode And Hbridge (L293d) ?
How to detect the egde? If detected what it does ?
How to detect obstacle ? And how to detect the finish line which is  the an object higher in height?</p>


问:
What's the result of multiplying a rotation matrix having only ψ components by another which has (−φ,θ,−ψ) components?
Given the following rotation matrix:

$
     R(φ, θ, ψ) =   \left( \begin{smallmatrix}
        cos(θ)*cos(ψ) &  -sin(φ)*sin(θ)*cos(ψ)-cos(φ)*sin(ψ) &  -cos(φ)*sin(θ)*cos(ψ)+sin(φ)*sin(ψ) \\
        cos(θ)*sin(ψ) &  -sin(φ)*sin(θ)*sin(ψ)+cos(φ)*cos(ψ) &  -cos(φ)*sin(θ)*sin(ψ)-sin(φ)*cos(ψ) \\
               sin(θ) &                        sin(φ)*cos(θ) &                        cos(φ)*cos(θ)
    \end{smallmatrix}  \right)
$

The multiplication $ R(0, 0, ψ)^T * \begin{pmatrix}ẋ& ẏ& ż\end{pmatrix}^T $ returns new linear velocities:
\begin{pmatrix}ẋ_n& ẏ_n& ż\end{pmatrix}
Which account for the effect of yaw on $ ẋ $ and $ ẏ $, because only the components of $ ψ $ remain in $ R $ and since $ ψ $ is around $ Z $, its components are in $ X $ and $ Y $.

Now my question is, what does the following multiplication return: $ R(0, 0, ψ)^T * R(-φ, θ, -ψ)^T $ ? and what does it account for?


问:
How to loop various conditions multiple times
I have 2 arrays (s_left and s_right) a length (dis), the arrays in reality are produced from sensor values.

The first situation entails looping the condition (s_left < dis) twice and at the same time looping (s_right < dis) once.

Is there a method to specify the number of times a individual condition can be looped through whilst preforming various conditions? The coding is in Java and I am not convinced the method attempted below is correct

```<code>public class test {
    public void test() {
        double s_right[] = new double[]{10, 13, 14, 15};
        double s_left[] = new double[]{12.6, 14, 18, 18};

        double dis = 12.5;

        for (int i = 0; i < s_left.length; i++) {
            if (s_left[i] < dis) {
                for (int j = 0; j < s_left.length; j++) {
                    if ((s_left[j] < dis) && (s_right[i] < dis)) {
                        System.out.println("working!!!");
                    }

                }
            }
        }
    }
}
</code>```


问:
Can someone help me understanding reference frames in OxTS data in KITTI Vision Benchmark dataset?
If anyone has worked with KITTI dataset, can you explain the reference frame used in roll pitch yaw values?

I downloaded the raw data from this link:
http://www.cvlibs.net/datasets/kitti/raw_data.php

The KITTI data states the following:

roll:  roll angle (rad),    0 = level, positive = left side up,      range: -pi   .. +pi

pitch: pitch angle (rad),   0 = level, positive = front down,        range: -pi/2 .. +pi/2

yaw:   heading (rad),       0 = east,  positive = counter clockwise, range: -pi   .. +pi

By counter clockwise do they mean car turning left is positive yaw?

Also what is the convention for positive and negative for the angular rates?

wx:    angular rate around x (rad/s)

wy:    angular rate around y (rad/s)

wz:    angular rate around z (rad/s)

I would assume that x y and z are forward leftward and upward as mentioned in the text.


问:
Fitting propeller to shaft
Hey I'm building an underwater robot(ROV) for a school project and I recently bought plastic propellers 55mm but sadly they came without prop adapters. Is there any easy alternative such as using epoxy glue to fit the prop on the shaft? The shaft is 3.5mm and slightly smaller than the diameter of propeller. Please help me out. </p>

Title: Fitting propeller to shaft


问:
I want to Calculate the Joint Velocities and Angular Accelerations of 5 DOF Youbot kuka robotic arm
I'm working on an assignment where I need to derive Velocity Kinematics for 5 DOF Youbot kuka robotic arm manipulator. I want to Calculate the Joint Velocities and Angular Accelerations of 5 DOF Youbot kuka robotic arm. I'm working on Matlab code:

clear all
close all
clc
syms q1 q2 q3 q4 q5 fx fy fz real

% length and offset of each link [x,y,z] (m)
l = [[0.046, 0, 0.147];
[0.155, 0, 0];
[0.135, 0, 0];
[0, 0, 0];
[0, 0, 0.218]];

% mass of each link (kg)
m = [0.961, 1.39, 1.318, 0.821, 0.769, 0.687, 0.199];

% Compute symbolic homogenous transform matrices based on KUKA YouBot
q = [q1, q2, q3, q4, q5];
[H, Hs] = CompH(q, l);
o = H(1:3,4);
% Compute symbolic Jacobian (velocity Jacobian only)
J = jacobian(o,q);

% Test jacobian by applying an angular velocity and computing linear
% velocity of end effector
cur_q = [0, 0, 0, pi/2, 0];
q_dot = [0, 0, 0, 0, 0]';

% Compute point of center of gravity for each link
cHs = CompCOGH(q, l);
o_cg_01 = cHs{1}(1:3,4);
o_cg_02 = cHs{2}(1:3,4);
o_cg_03 = cHs{3}(1:3,4);
o_cg_04 = cHs{4}(1:3,4);
o_cg_05 = cHs{5}(1:3,4);

% Gravity vector
gc = [0, 0, 9.82]';

% Compute Jacobians for each center of gravity
J1 = jacobian(o_cg_01, q);
J2 = jacobian(o_cg_02, q);
J3 = jacobian(o_cg_03, q);
J4 = jacobian(o_cg_04, q);
J5 = jacobian(o_cg_05, q);

% Compute torque needed based on each link's center of graivity and mass
t_cg = J1' * m(2) * gc;
t_cg = t_cg + J2' * m(3) * gc;
t_cg = t_cg + J3' * m(4) * gc;
t_cg = t_cg + J5' * (m(5)+m(6)+m(7)) * gc;

% Test jacobian by adding our advanced torque computation above to our
% original computation of the torque based on the end effector jacobian.
F = [fx;fy;fz];

torque = t_cg + J'*F;

and the function code:

function cHs = cHs(q, l)
[H, Hs] = CompH(q, l);

T01c = ScrewZ(q(1),l(1,3)/2)*ScrewX(-pi/2, l(1, 1)/2);
T02c = Hs{1}*ScrewZ(q(2) - pi/2,l(2,3)/2)*ScrewX(0, l(2, 1)/2);
T03c = Hs{2}*ScrewZ(q(3),l(3,3)/2)*ScrewX(0, l(3, 1)/2);
T04c = Hs{3}*ScrewZ(q(4) + pi/2,l(4,3)/2)*ScrewX(pi/2, l(4, 1)/2);
T05c = Hs{4}*ScrewZ(q(5),l(5,3)/2);

cHs = {T01c, T02c, T03c, T04c, T05c};

end

I don't know where I made a mistake in the Matlab code.


问:
How to create a jumping mechanism for a small robotic car?
I have to create a jumping mechanism for a small robotic car and was thinking about using a spring mechanism to do so. However, due to dimensions (16cmx8cm) and mass constraints (below 200g) I cannot figure out what would be an optimal spring release mechanism for a small jump. My initial idea was to use a motor to wind a spring attached to a platform at the bottom of the car which would be released to make whole structure jump. Moreover, I am unsure on how to chose the right spring (equations of force and energy seem to be insufficient to find both k and x).</p>


问:
What happens when I send the land command to my quadcopter?
My first question is: imagine I have a self-made quadcopter and I want it to land. How can I achieve that? Do I have to stop the 4 motors at the same time?

Second question: I use an AR.Drone 2.0. When I send an empty message to the land topic, it lands (measuring the altitude and doing it in a smooth way). What happens when I send the land command? I don't care if you have the documentation about the AR.Drone or another drone. I just want to know how can I achieve the same result. If you have any article or paper or thesis, it will be very welcomed.

Thanks


问:
Proper Joystick Inputs for UAV Quadrotor Control
I am working on the adaptive control of quadrotor UAV in MATLAB/Simulink environment. I prepared some trajectories for the UAV to follow in $x$, $y$ and $z$ directions. I would like to implement these trajectories by using a commercial pilot joystick whose blocks are available on Simulink. What I am quite unclear is the selection of these inputs through the joystick.

In flight control systems, one can give roll, pitch and yaw rates ($p$, $q$ and $r$) as inputs to be followed by the UAV. In a conference paper I came across an example where the roll angle ($\phi$), the pitch angle ($\theta$) and the yaw rate ($\dot{\psi}$) are given from the joystick.

My question is the following: What is the general selection for the UAV inputs through a joystick? I watched some videos on Youtube, where some people are controlling the UAVs with joysticks. Do they directly provide the desired $p$, $q$ and $r$ ?


问:
Does GY-271 (HMC5583L) or any 3-axis magnetometer suitable to detect orientation?
Based on the datasheet, HMC5583L has 160Hz output rate and produce three axis direction angle data, X, Y, and Z. It can measure diversion from Earth magnet field with 1° to 2° accuracy. Does that means that the "heading" direction always point to the North perpendicular to vertical orientation or it is slightly point downward? Does it also has measurement drift overtime? Is it reasonable to use it alone as orientation detector or it needs to be orchestrated with other sensors?

I understand that gyro + accelerometer module is more suitable than this, but there is also the tricky drift to deal with if we want to detect the orientation overtime. I'm merely considering alternatives.


问:
quadrotor experimental identification
i want to model the quadrotor using experimental method "i have not built it yet" what i want to do is: turn only one motor at a specific speed ,then plot the x,y,z and the angles then identify the transfert functions from the plots,x/w1,y/w1,... and so on, but i don't know if it's possible or what graphs i will have,so if you know about the subject or maybe tried something like that, and feel free to add anything you think might be helpfull</p>

Title: quadrotor experimental identification


问:
Use polynomials to detach number of MPC controls from size of time-horizon?
Model Predictive Control (MPC) works by finding a set of controls $u_0, \dots, u_n$ that minimize a cost function $J$ over a time-horizon $[t, t + T]$. Typically when MPC is used on mobile robots, each control $u_k$ is a vector of velocity commands that are applied for the duration $\delta$ of a slice $[t + \delta k, t + \delta (k + 1))$ of the time-horizon. The consequence is that for a given time-horizon size $T$, we need to optimize over $\lceil \frac{T}{\delta} \rceil$ controls.

I'm looking into using MPC for path-following, and I had the idea of using $n$-degree polynomials to generate the components of $u_k$, then redefine $J$ in terms of the polynomial coefficients. For example, in the case of a differential platform, use one polynomial $v(k) = v_t + a_1 k + a_2 k^2 \dots a_n k^n$ to generate linear velocities, $w(k) = w_t + b_1 k + b_2 k^2 \dots b_n k^n$ to generate angular velocities, and have the MPC optimize over $a_1, \dots, a_n, b_1, \dots, b_n$. That way we have $2n$ independent variables regardless the values of $\delta$ and $T$; additionally, $v(k)$ and $w(k)$ could easily be differentiated to provide optimization constraints over acceleration, jerk etc.

This seemed like a reasonable idea to me, so I was certain I would find it already covered in the literature. However almost all articles I've seen so far stick to the approach of defining one independent control set per time slice; the only exception is this one, which instead optimizes over the space of targets for a pure-pursuit-like control law.

Am I missing something? Is there an obvious reason this approach wouldn't work (or at least not be worth the trouble) that I'm overlooking? Is it documented somewhere and I just wasn't able to find any references?


问:
How does inverse compositional Lucas–Kanade algorithm work?
I am trying to understand the Lucas–Kanade algorithm since I am reading a paper in which is applied the inverse compositional Lucas–Kanade algorithm, but in order to understand the latter I have to understand the first one before.

Thw paper I am reading is SVO: Fast Semi-Direct Monocular Visual Odometry
, which is really interesting, but before proceeding understand it well I have to understand how inverse compositional Lucas–Kanade algorithm works.

In the paper theer is a short explanation on how this algorithm works at pag.4, but I don't understand it. So I started searching online for more. A paper that I have been suggested to read from an answer to a question I made on Stack Exchange Robotics is The Quantity Approximated, the Warp Update Rule,
and the Gradient Descent Approximation, which is really good, but still I am confused about this topic. I have searched more an found some videos, such as video_1 and video_2, which explain it, but still can't grasp the concept and it is getting frustrating.

I think it is useful that I give an explanation of what I have understand about this concept, even if my ideas are confused, so sorry if it does not make a lot of sense.

I am tryng to apply this concept to semi direct visual odometry, so I will try to consider this context.

What I have understood is that if I consider two consecutive frames, the objective of the Lucas–Kanade algorithm is to minimize the photometric error between the two images. So, since to solve this problem we have to deal with a non linear problem, it is computed a Taylor expansion to linearize the problem, and that it is solved iteratevely by updating the position of the 2D patch of the image (but it is the old frame, so at time k-1, or of the current frame, so at time k?). After some iterations, I shild obtain the photomeric error equa to zero.

But I don't understand what is the difference between this and the inverse compositional Lucas–Kanade algorithm. Moreover in the paper it talks about template image and warping which I don't undestand what it means.

Another interesting paper in which this is applied is SVO: Semi-Direct Visual Odometry for Monocular and Multi-Camera
Systems , at pag.4

Can somebody help me understand how inverse compositional Lucas–Kanade algorithm and Lucas–Kanade algorithm work?


问:
NodeMCU ESP-12E Wont Print to Serial in Arduino IDE
So, im using a ESP-12E nothing special about it, to try and run this code i found from a custom library example.

```<code>/* ============================================
I2Cdev device library code is placed under the MIT license
Copyright (c) 2012 Jeff Rowberg

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
===============================================
*/

/* This driver reads quaternion data from the MPU6060 and sends
   Open Sound Control messages.

  GY-521  NodeMCU
  MPU6050 devkit 1.0
  board   Lolin         Description
  ======= ==========    ====================================================
  VCC     VU (5V USB)   Not available on all boards so use 3.3V if needed.
  GND     G             Ground
  SCL     D1 (GPIO05)   I2C clock
  SDA     D2 (GPIO04)   I2C data
  XDA     not connected
  XCL     not connected
  AD0     not connected
  INT     D8 (GPIO15)   Interrupt pin

*/

#if defined(ESP8266)
#include <ESP8266WiFi.h>
#else
#include <WiFi.h>
#endif
#include <DNSServer.h>
#include <WiFiClient.h>
#include <WiFiUdp.h>
#include <OSCMessage.h>
#include <WiFiManager.h>         //https://github.com/tzapu/WiFiManager

// I2Cdev and MPU6050 must be installed as libraries, or else the .cpp/.h files
// for both classes must be in the include path of your project
#include "I2Cdev.h"

#include "MPU6050_6Axis_MotionApps20.h"
//#include "MPU6050.h" // not necessary if using MotionApps include file

// Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation
// is used in I2Cdev.h
#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
    #include "Wire.h"
#endif

// class default I2C address is 0x68
// specific I2C addresses may be passed as a parameter here
// AD0 low = 0x68 (default for SparkFun breakout and InvenSense evaluation board)
// AD0 high = 0x69
MPU6050 mpu;
//MPU6050 mpu(0x69); // <-- use for AD0 high

/* =========================================================================
   NOTE: In addition to connection 5/3.3v, GND, SDA, and SCL, this sketch
   depends on the MPU-6050's INT pin being connected to the ESP8266 GPIO15
   pin.
 * ========================================================================= */

// MPU control/status vars
bool dmpReady = false;  // set true if DMP init was successful
uint8_t mpuIntStatus;   // holds actual interrupt status byte from MPU
uint8_t devStatus;      // return status after each device operation (0 = success, !0 = error)
uint16_t packetSize;    // expected DMP packet size (default is 42 bytes)
uint16_t fifoCount;     // count of all bytes currently in FIFO
uint8_t fifoBuffer[64]; // FIFO storage buffer

// orientation/motion vars
Quaternion q;           // [w, x, y, z]         quaternion container
VectorInt16 aa;         // [x, y, z]            accel sensor measurements
VectorInt16 aaReal;     // [x, y, z]            gravity-free accel sensor measurements
VectorInt16 aaWorld;    // [x, y, z]            world-frame accel sensor measurements
VectorFloat gravity;    // [x, y, z]            gravity vector

// uncomment "OUTPUT_READABLE_QUATERNION" if you want to see the actual
// quaternion components in a [w, x, y, z] format (not best for parsing
// on a remote host such as Processing or something though)
#define OUTPUT_READABLE_QUATERNION

// uncomment "OUTPUT_READABLE_EULER" if you want to see Euler angles
// (in degrees) calculated from the quaternions coming from the FIFO.
// Note that Euler angles suffer from gimbal lock (for more info, see
// http://en.wikipedia.org/wiki/Gimbal_lock)
//#define OUTPUT_READABLE_EULER

// uncomment "OUTPUT_READABLE_YAWPITCHROLL" if you want to see the yaw/
// pitch/roll angles (in degrees) calculated from the quaternions coming
// from the FIFO. Note this also requires gravity vector calculations.
// Also note that yaw/pitch/roll angles suffer from gimbal lock (for
// more info, see: http://en.wikipedia.org/wiki/Gimbal_lock)
//#define OUTPUT_READABLE_YAWPITCHROLL

// uncomment "OUTPUT_READABLE_REALACCEL" if you want to see acceleration
// components with gravity removed. This acceleration reference frame is
// not compensated for orientation, so +X is always +X according to the
// sensor, just without the effects of gravity. If you want acceleration
// compensated for orientation, us OUTPUT_READABLE_WORLDACCEL instead.
//#define OUTPUT_READABLE_REALACCEL

// uncomment "OUTPUT_READABLE_WORLDACCEL" if you want to see acceleration
// components with gravity removed and adjusted for the world frame of
// reference (yaw is relative to initial orientation, since no magnetometer
// is present in this case). Could be quite handy in some cases.
#define OUTPUT_READABLE_WORLDACCEL

// uncomment "OUTPUT_TEAPOT_OSC" if you want output that matches the
// format used for the InvenSense teapot demo
//#define OUTPUT_TEAPOT_OSC

#ifdef OUTPUT_READABLE_EULER
float euler[3];         // [psi, theta, phi]    Euler angle container
#endif
#ifdef OUTPUT_READABLE_YAWPITCHROLL
float ypr[3];           // [yaw, pitch, roll]   yaw/pitch/roll container and gravity vector
#endif

#define INTERRUPT_PIN 15 // use pin 15 on ESP8266

const char DEVICE_NAME[] = "mpu6050";

WiFiUDP Udp;                                // A UDP instance to let us send and receive packets over UDP
const IPAddress outIp(192, 168, 1, 11);     // remote IP to receive OSC
const unsigned int outPort = 9999;          // remote port to receive OSC

// ================================================================
// ===               INTERRUPT DETECTION ROUTINE                ===
// ================================================================

volatile bool mpuInterrupt = false;     // indicates whether MPU interrupt pin has gone high
void dmpDataReady() {
    mpuInterrupt = true;
}

void mpu_setup()
{
  // join I2C bus (I2Cdev library doesn't do this automatically)
#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
  Wire.begin();
  Wire.setClock(400000); // 400kHz I2C clock. Comment this line if having compilation difficulties
#elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE
  Fastwire::setup(400, true);
#endif

  // initialize device
  Serial.println(F("Initializing I2C devices..."));
  mpu.initialize();
  pinMode(INTERRUPT_PIN, INPUT);

  // verify connection
  Serial.println(F("Testing device connections..."));
  Serial.println(mpu.testConnection() ? F("MPU6050 connection successful") : F("MPU6050 connection failed"));

  // load and configure the DMP
  Serial.println(F("Initializing DMP..."));
  devStatus = mpu.dmpInitialize();

  // supply your own gyro offsets here, scaled for min sensitivity
  mpu.setXGyroOffset(220);
  mpu.setYGyroOffset(76);
  mpu.setZGyroOffset(-85);
  mpu.setZAccelOffset(1788); // 1688 factory default for my test chip

  // make sure it worked (returns 0 if so)
  if (devStatus == 0) {
    // turn on the DMP, now that it's ready
    Serial.println(F("Enabling DMP..."));
    mpu.setDMPEnabled(true);

    // enable Arduino interrupt detection
    Serial.println(F("Enabling interrupt detection (Arduino external interrupt 0)..."));
    attachInterrupt(digitalPinToInterrupt(INTERRUPT_PIN), dmpDataReady, RISING);
    mpuIntStatus = mpu.getIntStatus();

    // set our DMP Ready flag so the main loop() function knows it's okay to use it
    Serial.println(F("DMP ready! Waiting for first interrupt..."));
    dmpReady = true;

    // get expected DMP packet size for later comparison
    packetSize = mpu.dmpGetFIFOPacketSize();
  } else {
    // ERROR!
    // 1 = initial memory load failed
    // 2 = DMP configuration updates failed
    // (if it's going to break, usually the code will be 1)
    Serial.print(F("DMP Initialization failed (code "));
    Serial.print(devStatus);
    Serial.println(F(")"));
  }
}

void setup(void)
{
  Serial.begin(9600);
  Serial.println(F("\nOrientation Sensor OSC output")); Serial.println();

  //WiFiManager
  //Local intialization. Once its business is done, there is no need to keep it around
  WiFiManager wifiManager;
  //reset saved settings
  //wifiManager.resetSettings();

  //fetches ssid and pass from eeprom and tries to connect
  //if it does not connect it starts an access point with the specified name
  //and goes into a blocking loop awaiting configuration
  wifiManager.autoConnect(DEVICE_NAME);

  Serial.print(F("WiFi connected! IP address: "));
  Serial.println(WiFi.localIP());

  mpu_setup();
}

void mpu_loop()
{
  // if programming failed, don't try to do anything
  if (!dmpReady) return;

  // wait for MPU interrupt or extra packet(s) available
  if (!mpuInterrupt && fifoCount < packetSize) return;

  // reset interrupt flag and get INT_STATUS byte
  mpuInterrupt = false;
  mpuIntStatus = mpu.getIntStatus();

  // get current FIFO count
  fifoCount = mpu.getFIFOCount();

  // check for overflow (this should never happen unless our code is too inefficient)
  if ((mpuIntStatus & 0x10) || fifoCount == 1024) {
    // reset so we can continue cleanly
    mpu.resetFIFO();
    Serial.println(F("FIFO overflow!"));

    // otherwise, check for DMP data ready interrupt (this should happen frequently)
  } else if (mpuIntStatus & 0x02) {
    // wait for correct available data length, should be a VERY short wait
    while (fifoCount < packetSize) fifoCount = mpu.getFIFOCount();

    // read a packet from FIFO
    mpu.getFIFOBytes(fifoBuffer, packetSize);

    // track FIFO count here in case there is > 1 packet available
    // (this lets us immediately read more without waiting for an interrupt)
    fifoCount -= packetSize;

#ifdef OUTPUT_READABLE_QUATERNION
    // display quaternion values in easy matrix form: w x y z
    mpu.dmpGetQuaternion(&q, fifoBuffer);
    Serial.print("quat\t");
    Serial.print(q.w);
    Serial.print("\t");
    Serial.print(q.x);
    Serial.print("\t");
    Serial.print(q.y);
    Serial.print("\t");
    Serial.println(q.z);
#endif

#ifdef OUTPUT_TEAPOT_OSC
#ifndef OUTPUT_READABLE_QUATERNION
    // display quaternion values in easy matrix form: w x y z
    mpu.dmpGetQuaternion(&q, fifoBuffer);
#endif
    // Send OSC message
    OSCMessage msg("/imuquat");
    msg.add((float)q.w);
    msg.add((float)q.x);
    msg.add((float)q.y);
    msg.add((float)q.z);

    Udp.beginPacket(outIp, outPort);
    msg.send(Udp);
    Udp.endPacket();

    msg.empty();
#endif

#ifdef OUTPUT_READABLE_EULER
    // display Euler angles in degrees
    mpu.dmpGetQuaternion(&q, fifoBuffer);
    mpu.dmpGetEuler(euler, &q);
    Serial.print("euler\t");
    Serial.print(euler[0] * 180/M_PI);
    Serial.print("\t");
    Serial.print(euler[1] * 180/M_PI);
    Serial.print("\t");
    Serial.println(euler[2] * 180/M_PI);
#endif

#ifdef OUTPUT_READABLE_YAWPITCHROLL
    // display Euler angles in degrees
    mpu.dmpGetQuaternion(&q, fifoBuffer);
    mpu.dmpGetGravity(&gravity, &q);
    mpu.dmpGetYawPitchRoll(ypr, &q, &gravity);
    Serial.print("ypr\t");
    Serial.print(ypr[0] * 180/M_PI);
    Serial.print("\t");
    Serial.print(ypr[1] * 180/M_PI);
    Serial.print("\t");
    Serial.println(ypr[2] * 180/M_PI);
#endif

#ifdef OUTPUT_READABLE_REALACCEL
    // display real acceleration, adjusted to remove gravity
    mpu.dmpGetQuaternion(&q, fifoBuffer);
    mpu.dmpGetAccel(&aa, fifoBuffer);
    mpu.dmpGetGravity(&gravity, &q);
    mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);
    Serial.print("areal\t");
    Serial.print(aaReal.x);
    Serial.print("\t");
    Serial.print(aaReal.y);
    Serial.print("\t");
    Serial.println(aaReal.z);
#endif

#ifdef OUTPUT_READABLE_WORLDACCEL
    // display initial world-frame acceleration, adjusted to remove gravity
    // and rotated based on known orientation from quaternion
    mpu.dmpGetQuaternion(&q, fifoBuffer);
    mpu.dmpGetAccel(&aa, fifoBuffer);
    mpu.dmpGetGravity(&gravity, &q);
    mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);
    mpu.dmpGetLinearAccelInWorld(&aaWorld, &aaReal, &q);
    Serial.print("aworld\t");
    Serial.print(aaWorld.x);
    Serial.print("\t");
    Serial.print(aaWorld.y);
    Serial.print("\t");
    Serial.println(aaWorld.z);
#endif
  }
}

/**************************************************************************/
/*
    Arduino loop function, called once 'setup' is complete (your own code
    should go here)
*/
/**************************************************************************/
void loop(void)
{
  if (WiFi.status() != WL_CONNECTED) {
    Serial.println();
    Serial.println("*** Disconnected from AP so rebooting ***");
    Serial.println();
    ESP.reset();
  }

  mpu_loop();
}
</code>```

Heres a picture of my basic setup as code asks

but when i log onto the Serial, nothing shows up, even though ive installed the drivers, wiped the flash, added extra boards library, and everything else. Im super confused and google bears no help either, that's why im here. I can give more if specifically asked for, but other than that, heres a snippit of the log i get in arduino.

```<code>Executable segment sizes:

IROM   : 284944          - code in flash         (default or ICACHE_FLASH_ATTR)

IRAM   : 28080   / 32768 - code in IRAM          (ICACHE_RAM_ATTR, ISRs...)

DATA   : 1264  )         - initialized variables (global, static) in RAM/HEAP

RODATA : 3664  ) / 81920 - constants             (global, static) in RAM/HEAP

BSS    : 30240 )         - zeroed variables      (global, static) in RAM/HEAP

Sketch uses 317952 bytes (30%) of program storage space. Maximum is 1044464 bytes.
Global variables use 35168 bytes (42%) of dynamic memory, leaving 46752 bytes for local variables. Maximum is 81920 bytes.
esptool.py v2.8
Serial port COM3
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 2c:f4:32:3c:71:07
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 322112 bytes to 230789...

Writing at 0x00000000... (6 %)
Writing at 0x00004000... (13 %)
Writing at 0x00008000... (20 %)
Writing at 0x0000c000... (26 %)
Writing at 0x00010000... (33 %)
Writing at 0x00014000... (40 %)
Writing at 0x00018000... (46 %)
Writing at 0x0001c000... (53 %)
Writing at 0x00020000... (60 %)
Writing at 0x00024000... (66 %)
Writing at 0x00028000... (73 %)
Writing at 0x0002c000... (80 %)
Writing at 0x00030000... (86 %)
Writing at 0x00034000... (93 %)
Writing at 0x00038000... (100 %)
Wrote 322112 bytes (230789 compressed) at 0x00000000 in 20.5 seconds (effective 125.8 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
</code>```

Any help is appreciated! =)


问:
Applying initial guessing to LiDAR point cloud for ICP processing in Graph SLAM
I am currently in the process of implementing Graph SLAM using ICP and g2o in python 2.7

The data I have are pose data (4 x 4 transformation matrix) and lidar data ( in the format of [x y z 1] with dimension of 4 x n)

As long as I am aware, for icp to work, you need to apply initial guessing (pose difference between the source and the destination node) before executing the ICP algorithm, which I am using later for adding more edges.

What I have done so far is to initially add the nodes and the respective edges of each node that is larger than a certain threshold, and I'm currently struggling through to apply ICP to fine tune my graph SLAM map.

Currently, I have been able to derive the transformation matrix of the source node and the destination node (the two nodes that I think are matching pairs for closing the loop), and trying to process the point clouds for each sourceLidar and DestinationLidar which both have dimensions of 4 x n (4  = [x y z 1).

I have set the sourcePoint cloud as source Lidar, but I need to transform the DestinationPointCloud with initial guessing.

What I have right now is: DestinationLidar values (4 x number of nodes) and transformation matrix of each source and destination node that I have derived from g2o and optimizer function.

I know I am meant to apply rotation and translation to these, but I am not sure how to execute these....

After this is executed, I will apply the icp and add any additional edges that lie below a set threshold, then regraph SLAM.

Please help me on how I can apply the transformation (both Rotation and Translation) to DestinationLidar to apply initial guessing.

Thanks alot


问:
Maximizing the Coefficient of Friction Between Two Surfaces
I am new to this site so please let me know if I can improve my question. A component of a robot I am designing includes a four-wheeled carriage that travels linearly on an aluminum surface. The wheels must be 3.5 inches in diameter, 0.5 inches thick and be able to bear 130 lbs of load together. Beyond that, I have complete freedom to select the wheel material and can surface the sheet aluminum however I want. I can replace the wheels every 10000 rotations and they need to be water resistant. Cost is pretty irrelevant.

How do you recommend maximizing the coefficient of friction between the wheel and surface? Is there a database which shows different wheels on different materials? Are there resources which outline the affects of different surfacing techniques on friction?

I am considering a pretty simple approach using 'off-the shelf' directional tread tires and aluminum oxide anti slip tape like what you see on some commercial stairs. Other ideas include using studded tires and roughing the aluminum surface. The overall goal is to make sure that the carriage does not slide when the wheels are not spinning using mechanical, not electronic/motorized means.


问:
FABRIK inverse kinematic
I was reading the FABRIK inverse kinematic that You can find more information here:  http://www.andreasaristidou.com/publications/papers/FABRIK.pdf

This paper suggests for each joint there is 4 value which constraint the rotational motion of that joint and constitutes a cone then Shows the composite ellipsoidal shape created by the distances q_j mapped from 3D to 2D.
My question is how to determine the x,y coordinate of the 2D plane? I mean there is infinite coordinate system that passes from point "o" in the mentioned plane. How can I fix this coordinate system?

Title: FABRIK inverse kinematic