问:
Determing limits of rotation in a robot workspace
How to determine the limit range of end effector orientation (Roll-Pitch-Yaw) at one specific point(XYZ)?I had derived Forward/Inverse kinematic. I'm making a program for 6DOF articulated robot arm so that the user can know the limit of tool rotation in Global axis(Roll-Pitch-Yaw) at a certain point.</p>

答:
The kinematic answer to this question is pretty complex, but I'll answer it in the way in which I would attack this problem. If you're trying to understand the math behind what is going on, this might not be the answer you're looking for:

I don't know if you're familiar with OpenRAVE, but it is a really nice project that has a tool called IKFast. IKFast is a tool that [attempts to] provides automated analytical inverse kinematic solutions to any serial manipulator. OpenRAVE has built many very useful tools around their ability to create analytical solutions, one of which is the ability produce all the possible joint space solutions to a workspace pose. This example shows what I'm talking about.

All you have to do is create a model of your robot that is OpenRAVE friendly and run that example which spits out an array of joint value arrays that correspond to all the possible solutions to the pose. There is a tool that converts ROS's urdf models to openRAVE models in case you're already using ROS.

I realize there is a programming learning curve to learning OpenRAVE but I believe that curve is much easier to overcome than the curve associated with understanding the complexities of analyzing the inverse kinematics of a robot arm manually. Not to mention, when you solve the kinematics of an arm, its only good for that particular arm. But if you learn how to do this using OpenRAVE, you will be able to do it quickly with almost any arm in the future.


问:
Are stereo camera calibration data standardized?
Is there a standard format of how stereo calibration data (various matrices, usually saved in XML) are stored? Can I load calibration data generated say from a OpenCV script in C to another OpenCV script say in C++ or to completely different software where I create disparity image?</p>

答:
The short answer is no.

You can use the XML output file within OpenCV's ecosystem (and ROS), but there are no standard formats for calibration.

The issue is not coming up with a standard. Camera intrinsic calibration models differ in their modeling of lens distortion, due to different lenses and different application settings.

If you are using a calibration obtained from OpenCV, I'd highly recommend making sure you read calibration documentations before plugging in the values into another package.

ContentLicense: CC BY-SA 3.0


问:
PD controller in C#
I am currently building a line-following mobile robot. I've done all my image processing work in C#, and now I am in the control phase. I am looking for a PD controller program written in C# to start with. I've searched a lot but without success. My robot is not an Arduino based, it has a motherboard with a Core i3 CPU, and I am using a Camera not an LDR sensor.</p>

答:
You may take a look at this library running on Arduino in 'standard' C.  The author has a line by line explanation on his blog. Hence, easy to change to other system as needed.  See the blog for the autotune utility too.

PID
http://playground.arduino.cc/Code/PIDLibrary

Full description by author
http://brettbeauregard.com/blog/2011/04/improving-the-beginners-pid-introduction/

By the way, you need analogue reading (no just on and off) on the line. That is, analogue of 512 out of 1023 menas the sensor is at 50% edge of the line.

Advanced use can detect the analogue signal from the sensor diode,
giving an continuous reading on the "percentage of hitting the
white/black line".  (says, n% of voltage is, as tested by experiment,
is 60% on line and 40% outside the line).  This analogue input can use
PID control to provide smooth and continuous (no just on and off) and
provide best optimal drive speed as in the enclosed video.

This is 3PI, showing the analogue reading from 5 sensors, note the
initial spinning for the robot to calibrate through n% of crossing the
line and analogue reading from sensors.  If 2 sensors reading 50%, the
line is at the middle between the 2 sensors.
https://www.youtube.com/watch?v=ylyRi1Qlbl0&feature=player_embedded

See page 18 pf 3pi manual  http://www.pololu.com/docs/pdf/0J21/3pi.pdf  for a very clever use of IO pins.

The sensor can be read WITHOUT ADC converter.  This method is widely
used in mass produced consumer electronic, as i worked for factory,
where high resolution (16 bits) is needed and the reading speed is ms
range or slower (1 to 10ms or slower). MCU only has 10 to 12 bits high
speed ADC and this circuit give higher resolution.

Fast example

Product
https://www.youtube.com/watch?v=6ENIiMv7LvM

Hope this helps

Title: PD controller in C#


答:
Your problem is not the P[I]D controller, but extracting control parameters from your system. A PID controller by itself is something like this (assuming a periodic control task):

```<code>/* 1. get current position */
cur_position = get_current_position();

/* 2. calculate error */
err = goal_position - cur_position;

/* 3. calculate the output */
proportional = Kp * err;
derivative = Kd * (err - last_err);
integral = Ki * (last_sum + err);
output = proportional + derivative + integral;

/* 4. keep history */
last_sum += err;
last_err = err;

/* 5. apply control output */
apply_control_output(output);
</code>```

where last_sum and last_err are persistent (they are defined outside the scope of the control loop, e.g. they are global or are a class member or on stack of caller who's calling the control task in a loop). In a PD controller, Ki is zero.

Now steps 2 through 4 are very simple and probably that code runs on any C-derived language without modification. Needless to say, the control parameters Kp, Kd and Ki need to be tuned to your application (which is a problem of its own, but in this case you can just fiddle with it to get a good idea (hint: Ki is really small)). The problem is thus steps 1 and 5. Step 1 depends on your input and step 5 depends on your output.

In step 1, you need to get an image from your camera, process it and understand how far off you are from the line. That would be your position. Note that you may also like to extract the direction of the line, in which case steps 2 through 4 could be done on 2D data! But PID rather sucks anyway and a line-following robot is not a serious application either, so you may not want to bother with that.

Let's take an example.  Imagine you see the following image on your camera:

One simple way to calculate your position with respect to the line would be to take the distance d from the center of the image to the line that needs to be followed (or to its tangent if its curved):

In this case, your cur_position would be d (which would be negative if it's on the other side of the line) and your goal_position would be 0.

This is a very simplistic solution and likely the robot may move in a weird way, since it doesn't take direction into account. If you think of the robot position as the pair of data containing distance from line and direction of line (its angle with respect to a vertical line), your goal would also be to make that (0, 0). This still doesn't take non-smooth lines in consideration.

That done, step 5 remains. Step 5 takes the output of the controller and makes the robot follow it. This of course depends on how the robot acts. For example, if your robot has two speed-controllable wheels in the front and a passive omnidirectional one in the back for balance, then you need to tell the motors turning the wheels to maintain what speed.

For example, if the output parameter is positive, it may mean that you are on the right side of the line. What you need would be then to turn left. To do that, you can set a higher speed for the right wheel and a lower speed. The higher the output, the higher the ratio of speed between the two wheels.

Title: PD controller in C#

Body: I am currently building a line-following mobile robot. I've done all my image processing work in C#, and now I am in the control phase. I am looking for a PD controller program written in C# to start with. I've searched a lot but without success. My robot is not an Arduino based, it has a motherboard with a Core i3 CPU, and I am using a Camera not an LDR sensor.</p>

Body:
Your problem is not the P[I]D controller, but extracting control parameters from your system. A PID controller by itself is something like this (assuming a periodic control task):

/* 1. get current position */
cur_position = get_current_position();

/* 2. calculate error */
err = goal_position - cur_position;

/* 3. calculate the output */
proportional = Kp * err;
derivative = Kd * (err - last_err);
integral = Ki * (last_sum + err);
output = proportional + derivative + integral;

/* 4. keep history */
last_sum += err;
last_err = err;

/* 5. apply control output */
apply_control_output(output);

where last_sum and last_err are persistent (they are defined outside the scope of the control loop, e.g. they are global or are a class member or on stack of caller who's calling the control task in a loop). In a PD controller, Ki is zero.

Now steps 2 through 4 are very simple and probably that code runs on any C-derived language without modification. Needless to say, the control parameters Kp, Kd and Ki need to be tuned to your application (which is a problem of its own, but in this case you can just fiddle with it to get a good idea (hint: Ki is really small)). The problem is thus steps 1 and 5. Step 1 depends on your input and step 5 depends on your output.

In step 1, you need to get an image from your camera, process it and understand how far off you are from the line. That would be your position. Note that you may also like to extract the direction of the line, in which case steps 2 through 4 could be done on 2D data! But PID rather sucks anyway and a line-following robot is not a serious application either, so you may not want to bother with that.

Let's take an example.  Imagine you see the following image on your camera:

One simple way to calculate your position with respect to the line would be to take the distance d from the center of the image to the line that needs to be followed (or to its tangent if its curved):

In this case, your cur_position would be d (which would be negative if it's on the other side of the line) and your goal_position would be 0.

This is a very simplistic solution and likely the robot may move in a weird way, since it doesn't take direction into account. If you think of the robot position as the pair of data containing distance from line and direction of line (its angle with respect to a vertical line), your goal would also be to make that (0, 0). This still doesn't take non-smooth lines in consideration.

That done, step 5 remains. Step 5 takes the output of the controller and makes the robot follow it. This of course depends on how the robot acts. For example, if your robot has two speed-controllable wheels in the front and a passive omnidirectional one in the back for balance, then you need to tell the motors turning the wheels to maintain what speed.

For example, if the output parameter is positive, it may mean that you are on the right side of the line. What you need would be then to turn left. To do that, you can set a higher speed for the right wheel and a lower speed. The higher the output, the higher the ratio of speed between the two wheels.


问:
Solenoid to launch a ping pong ball
I've been looking for ideas on how to launch a ping pong ball a small distance (< 1 metre) for a game. Solenoids look like they might be useful but I'm not 100% on what force/type I need. I can mount it under a base and have the balls roll over it, with a pin pushing the ball up a ramp to it's target.

As it's only a ping pong ball, it should be light. I was considering something like this: http://www.adafruit.com/product/412

Am I along the right lines? Or should I go back to the drawing board.

答:
Solenoids comes at different size and power.  Big one are in home washing machine to control water drainage, so, can be very powerful.

This project bounces steel pin ball. More than likely, it can do ping pong, given choosing appropriate size/force model of solenoids (the seller you mentioned has 2 sizes, as a good start. May be, you can ask the seller to try out for you, before you buy).

video in
http://pinballchameleon.blogspot.hk/2013/04/the-modern-firepower-pinball-project_24.html#more

Enlarge 200% to see many solenoids of various sizes
http://pinballchameleon.blogspot.hk/2013_03_01_archive.html

Try Google Image search "pinball machine solenoid"
https://www.google.com/search?safe=off&hl=en&site=imghp&tbm=isch&source=hp&biw=1764&bih=795&q=pinball+machine&oq=pin+ball+&gs_l=img.1.0.0i10l4j0j0i10l2j0i5l3.1434.3287.0.8985.9.9.0.0.0.0.174.751.7j2.9.0....0...1ac.1.49.img..0.9.739.-wtYmiDZYSI#hl=en&q=pinball+machine+solenoid&safe=off&tbm=isch

Hope it helps

Title: Solenoid to launch a ping pong ball


问:
What is the difference between screw and wrench in rigid body motion?
A screw is defined by a six dimensional vector of forces and torques. It can represent any spatial movement of a rigid body (as written here). But I don't get the following distinction between screw and wrench:

The force and torque vectors that arise in applying Newton's laws to a rigid body can be assembled into a screw called a wrench.

It seems to be some kind of contextualisation but in what way?

答:
I will try to make it as simple as possible. Imagine you have a SCREW, when you WRENCH it, it TWIST forward or backward.

From your wiki link

The components of the screw define the Plücker coordinates of a line in space and the magnitudes of the vector along the line and moment about this line.

It means that any system can be described as those coordinate system is a screw. For example a normal screw has it axis and it pitch.

A WRENCH is one case of SCREW where the act (force or torque) have the axis and yield a movement (translation or rotation)

You can have a look at the slide of the Summer Screw Summer School for more detail.


答:
Summarizing from Murray, Li, and Sastry (chapters 3 and 5) there are 3 related things:

Twist: An element of se(3) (which is a bit like the derivative of an element of SE(3), which is the set of translations + rotations)

Screw: A translation+rotation (i.e. and element of SE(3))

Wrench: Generalized force (combination of linear force and torque)

Title: What is the difference between screw and wrench in rigid body motion?

Body:
A screw is defined by a six dimensional vector of forces and torques. It can represent any spatial movement of a rigid body (as written here). But I don't get the following distinction between screw and wrench:

The force and torque vectors that arise in applying Newton's laws to a rigid body can be assembled into a screw called a wrench.

It seems to be some kind of contextualisation but in what way?


问:
Questions about quadcopter and radio controller
I have not bought any parts yet, but I am making my own quadcopter. I have done the research and know all about the parts that I need, but many guides are sponsored and cost thousand(s) of euros/dollars while not explaining things entirely clearly.

Firstly, I have found this flight control board. Would I need another microcontroller (such as the Arduino nano) for it to work? (IF ANYONE has experience with this board, let me know!).

Secondly, would the above board work with this radio controller. Are controllers universal?

(Please tell me if I'm not in the right section here, or if this doesn't count as a relevant topic).

答:
specific answers;

yes that controller will work fine, and is pretty popular. No it does not need anything additional other than to be hooked up to the receiver. from it, you hook up four speed controllers, and to them 4 motors.

yes that transmitter receiver will work, but it is a little on the 'too inexpensive' side. You do realize it requires hooking it up to a computer to reverse a channel don't you? If you really can guarantee that will not be an inconvenience, then it will work, but usually people opt for the turnigy 9x (http://www.hobbyking.com/hobbyking/store/_8992_Turnigy_9X_9Ch_Transmitter_w_Module_8ch_Receiver_Mode_2_v2_Firmware_.html). The great thing about it is that it often flashed with an improved firmware; http://code.google.com/p/er9x/  It is only a few more dollars and will be a much better choice. If you are at a point where 30 dollars makes a difference, do NOT get involved in this hobby. Radio controllers are universal, and what you buy now should last you for many years, so spend the extra $30 and get something a little better quality and more popular.

Edit - update: I purchased both of these since writing this answer. The transmitter is still work in progress but will become a long range transmitter (10 or so miles). The KK board has been pretty impressive, I've been pleased with it so far. watch


答:
A solenoid would be similar to the spring mechanism that's used in pinball machines.  You may have some trouble actuating it to produce exactly the same amount of force every time, however.

You might consider using the solenoid to push the ping pong ball toward a wheel that is rotating at the desired speed, just like a pitching machine.

Title: Solenoid to launch a ping pong ball

Body:
I've been looking for ideas on how to launch a ping pong ball a small distance (< 1 metre) for a game. Solenoids look like they might be useful but I'm not 100% on what force/type I need. I can mount it under a base and have the balls roll over it, with a pin pushing the ball up a ramp to it's target.

As it's only a ping pong ball, it should be light. I was considering something like this: http://www.adafruit.com/product/412

Am I along the right lines? Or should I go back to the drawing board.


问:
IMU based acceleration parameters for differential drive robot
I have a differential drive robot whose motors are virtually quiet while driving on a completely flat surface, but the motors make a lot of noise when on a incline. This is likely due to the correction required to maintain speed with the high inertial load where the robot cannot accelerate fast enough for the PID to keep up.

But I noticed that some of the noise is related to acceleration, and the higher the acceleration, the smaller the amount of noise I hear, or the smaller the time the same level of noise lasts (up to a certain acceleration limit, otherwise the motors get really noisy again).

I am trying to find out of how to use an IMU that I have a available in order to change the acceleration based on how steep the path's incline is.

Any documentation (papers, tutorials, etc) about motion planning related to this topic that you can point me to?

答:
Normally, the integral term of a PID handles something like the incline.  This takes time to build up error, and as you noticed in your application it is taking some time for the PID to decide to output the proper amount of force when you first encounter the incline.

My guess is that the simplest way to fuse the IMU data would be to use it as a replacement for (or augmentation of) the integral term in your calculation.  Rather than accumulate error over time, the IMU could give you a more instantaneous value.


问:
What type of mechanism is this?

Held and rotated by the knurled ends, one in each hand, the silver spokes rise and fall in order for the assembly to rotate. What is it, some companies' salesmen show tool? Found in an old building, unit has no markings.

答:
Totally off topic and not really robotics related but that's an old gearless angle drive.
Kind of like this...

http://www.cal-vantools.com/p-5-90-degree-gearless-angle-drive38.aspx

Title: What type of mechanism is this?


问:
sparse matrix in EKF SLAM
I've successfully done with EKF Localization Algorithm with known and unknown correspondences that are stated in "Probabilistic Robotics". The results make perfect sense,so I can estimate the position of a robot without using GPS or odometry. Now I've moved to EKF-SLAM with known correspondences in the same book. I don't understand this matrix </p>

<p>$$
F_{x,j} =
\begin{bmatrix}
1  & 0  & 0 & 0  \cdots  0 & 0 & 0 & 0 & 0 \cdots 0 \\
0  & 1  & 0 & 0  \cdots  0 & 0 & 0 & 0 & 0 \cdots 0 \\
0  & 0  & 1 & 0  \cdots  0 & 0 & 0 & 0 & 0 \cdots 0 \\
0  & 0  & 0 & 0  \cdots  0 & 1 & 0 & 0 & 0 \cdots 0 \\
0  & 0  & 0 & 0  \cdots  0 & 0 & 1 & 0 & 0 \cdots 0 \\
0  & 0  & 0 & \underbrace{0  \cdots  0}_{3j-3} & 0 & 0 & 1 &  \underbrace{0 \cdots 0}_{3N-3j} \\
\end{bmatrix}
$$
What is exactly the bottom of this matrix? The following
$$
F_{x,j} =
\begin{bmatrix}
0  \cdots  0 & 1 & 0 & 0 & 0 \cdots 0 \\
0  \cdots  0 & 0 & 1 & 0 & 0 \cdots 0 \\
\underbrace{0  \cdots  0}_{3j-3} & 0 & 0 & 1 &  \underbrace{0 \cdots 0}_{3N-3j} \\
\end{bmatrix}
$$
Is it as following (assuming N = 3)
$$
F_{x,j} =
\begin{bmatrix}
1 & 0 & 0 & 1 & 0 & 0 & 1 & 0 & 0 \\
0 & 1 & 0 & 0 & 1 & 0 & 0 & 1 & 0 \\
0 & 0 & 1 & 0 & 0 & 1 & 0 & 0 & 1\\
\end{bmatrix}
$$
Or
$$
F_{x,j} =
\begin{bmatrix}
0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0\\
\end{bmatrix}
$$
where ones' represent a specific landmark. </p>

答:
It is certainly your second guess, i.e.:

$$
F_{x,j} =
\begin{bmatrix}
0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0\\
\end{bmatrix}
$$

If you pay attention, the columns that are repeated (with ...) contain all zeros, both the first column and the last.

If they wanted to show your first guess, they would have written something like this:

$$
F_{x,j} =
\begin{bmatrix}
1  \cdots  0 & 1 & 0 & 0 & 1 \cdots 0 \\
0  \cdots  0 & 0 & 1 & 0 & 0 \cdots 0 \\
\underbrace{0  \cdots  1}_{N} & 0 & 0 & 1 &  \underbrace{0 \cdots 1}_{N} \\
\end{bmatrix}
$$

Note that now the first element of the first column is 1 and the last element of the last column is also 1, showing that the 1 moves from top to bottom on each column. Note also that the number of columns (previously 3j-3 and 3N-3j) are now changed to N (the number of rows, let's assume) because otherwise the pattern and the number of columns would be inconsistent.

Title: sparse matrix in EKF SLAM


问:
Quadrocopter build - Do these parts look fine?
I am completely brand new to quadrocopter building. I am currently about to start building a Quad. I have done a little bit of research and was thinking of buying the following parts:

KK2.1 Hobbyking Flight Controller

Turnigy H.A.L Quadcopter Frame

4 x NTM Prop Drive    35-30 1100kv / 380w

Turnigy 9X 9CH

Turnigy Plush 40A ESC

Slow Fly Prop Left

Slow Fly Prop Right

Quad Power Dist Board

Turnigy 5Ah 3S25C LiPo

What do you think of these parts/Do you have any complete builds with instructions that you would recommend instead?

Thanks

答:
EDIT: Sorry, didn't see that this was such an old question, I'm used to Stack Overflow where the first page of questions spans several minutes instead of several months!

The DJI Naza Flamewheel F450 is a popular kit, I am building one. You can get it at a bunch of different places online, such as here. It includes the airframe, motors, ESCs, and props, and because they are from the same kit they are pretty much guaranteed to be compatible.

You will have to source the remaining parts yourself, i.e. the battery, Tx/Rx, and flight controller. Your battery and Tx look fine for the Flamewheel F450 kit, and I can't comment on the Hobbyking FC unit because I have no experience with it (I use the DJI Naza-M Lite).

Also, don't forget the LiPo battery charger!

Hope this helps, good luck with your build!


问:
Tilt-compensated compass - at my wits' end
I'm a bit at my wits' end here - I'm trying to build a tilt compensated compass for my autonomous sailboat (ardusailor!). I'm using an InvenSense MPU9150. Originally, I used the built-in fusion support on the sensor to get a quaternion, pull the yaw/pitch/roll angles from that, and then use this formula to do the tilt compensation:

```<code>float heading = atan2(-(mz * s_phi - my * c_phi), mx * c_theta + my * s_theta * s_phi + mz * s_theta * c_phi);
</code>```

where the various s_angle is sin(angle) and c_angle is cos(angle). That didn't work. I tried using a vector-based approach stolen from here. That didn't work. Then, I took away the tilt compensation, and just did an uncompensated atan2(Yh,Xh), and that produced very strange result as well.

Basically, as I rotate the sensor about the z axis, the value rotates between 70 and -10 degrees, completing a full circle (i.e. as i make a 360 degree rotation, it starts at 70, gets to -10, and then back up to 70). 70 is at about 0* magnetic, 10 is at about 180, 0 is at about 70-80.

I see the same behavior from an HMC5883L magnetometer chip as well. The thing is, looking at raw values, I get magnetic values that seem fine, and hard and soft iron offsets are in place:

top row is corrected for offsets (using an ellipsoid fit method), bottom is raw. The numbers may look skewed, but they aren't - the scales aren't all the same. Graphs are, in order, x:y, y:z, x:z

What could this be?

答:
You may want to take a look at FreeIMU library that does 'data fusion' that combine raw data from multiple sensors and present user with a much reliable, stable and easy-to-use data in a roll, pitch and yaw (direction as you require) format.

FreeIMU http://www.varesano.net/projects/hardware/FreeIMU
This version from the original author use MPU60X0 chip.  It also has hard and soft iron offsets calibration. You may want to use this version by changing chip which is relatively low cost. Or, use below newer version by community authors uses the newer MPU9150.

(about 60% toward the end) Video showing roll, pitch and yaw as displayed on pc screen https://www.youtube.com/watch?v=4Dmbr4XDnSM

There are dozens of similar videos. like https://www.youtube.com/watch?v=jSUULyOchKY which explain a bit about the working principle, etc.

MPU9150
http://www.youtube.com/redirect?q=http%3A%2F%2Fyoutu.be%2FlwlOZzNJqJc&redir_token=lI8vw1yUDNFjftmQeXUUL33rabN8MTQwNjExNzk3M0AxNDA2MDMxNTcz

http://www.youtube.com/watch?v=kujLFiehwC4

You may want to consider using Arduino MCU board as it is low cost and has plenty examples. The library is in C and in-theory can be ported to other MCU.

Hope it helps


问:
Kalman filter Issue - GPS Odometry Fusion
I am working on estimating a robots pose using Odometry and GPS.

My first problem is that all kinematic model i have seen for a differential drive robot proposes using the displacement of the left and right wheels to evaluate the robots next pose. However, in my situation the robot i have only spits out current X and Y pose relative to the starting point of the movement. can i use this as my state estimate
P = [x,y]T

P = [x0,y0] + [dx,dy] where dx and dy are change in respective coordinates gotten from the robots odometry.

if the above is posible how do i calculate the state covariance Q of the filter.

For GPS, how do i evaluate the covariance R; i have tried to collect multiple reading of latitude and longitude from a fixed point but i dont know if this is righ and i just dont get evaluate the covariance from these data (feeling dumb).

Thank you in anticipation.

答:
In regards to your question about differential drive, it sounds as though your robot is using the kinematic model to estimate the position, but this is being done "internally" (i.e., in the embedded on-board software). Whether or not this is okay depends on whether the wheel radii and track width (distance between left and right wheels) it uses are correct. If they aren't (e.g., you changed the wheels), the values it is spitting out will be very inaccurate. Assuming these are approximately correct, instead of the displacement of the left and right wheels, first calculate the translation and rotation since the last measurement, i.e.,

```<code>translation = sqrt( (dx - dx_prev)^2 + (dy - dy_prev)^2 )
rotation = dtheta - dtheta_prev
</code>```

where dx, dy, and dtheta are your current measurements, and dx_prev, dy_prev, dtheta_prev are the previous measurements. Note that I assumed your robot is reporting the heading (theta) as well. If it doesn't, that means if the robot is turning on the spot, you won't be able to tell because no change in position is occurring.

Your new input u is now

```<code>u = [translation; rotation]
</code>```

Use an appropriate kinematic model where this is your input (e.g., change in x is translation * cos(theta), etc.). Setting an appropriate covariance matrix for u is tricky. I would recommend determining it empirically (i.e., do a series of experiments and decide how much uncertainty you should add to u based on the results). Start with a guess such as

```<code>Q = [0.005^2, 0; 0, 0.005^2]
</code>```

and check if the 3-sigma ellipse covers the actual position after the experiment. You can also get fancy and set Q at each time stamp, scaled according to the motion, i.e.,

```<code>Q = [(a*translation)^2 + (b*rotation)^2, 0; 0, (c*translation)^2 + (d*rotation)^2]
</code>```

where you tune for values of a, b, c, and d. This allows you (for example), to add more uncertainty if the robot is turning (larger values of c and d).

For your question about determining the R matrix, without getting into the details of how GPS works, your best bet is probably once again to do tests. One simple test would be to measure out some places on the ground (so you know their positions). Start by converting your initial latitude to (x, y) (see here). This will be your origin. Next drive to each of your known positions and calculate the (x, y) according to the GPS, and subtract off your initial position. Drive from known position to known position and so on (including revisiting positions) and record your (x, y) according to GPS. After this experiment you'll have a list of estimated positions and their corresponding true positions. From this you can use statistics to calculate the average uncertainty, and can set R appropriately.

Good luck!

Body:
In regards to your question about differential drive, it sounds as though your robot is using the kinematic model to estimate the position, but this is being done "internally" (i.e., in the embedded on-board software). Whether or not this is okay depends on whether the wheel radii and track width (distance between left and right wheels) it uses are correct. If they aren't (e.g., you changed the wheels), the values it is spitting out will be very inaccurate. Assuming these are approximately correct, instead of the displacement of the left and right wheels, first calculate the translation and rotation since the last measurement, i.e.,

translation = sqrt( (dx - dx_prev)^2 + (dy - dy_prev)^2 )
rotation = dtheta - dtheta_prev

where dx, dy, and dtheta are your current measurements, and dx_prev, dy_prev, dtheta_prev are the previous measurements. Note that I assumed your robot is reporting the heading (theta) as well. If it doesn't, that means if the robot is turning on the spot, you won't be able to tell because no change in position is occurring.

Your new input u is now

u = [translation; rotation]

Use an appropriate kinematic model where this is your input (e.g., change in x is translation * cos(theta), etc.). Setting an appropriate covariance matrix for u is tricky. I would recommend determining it empirically (i.e., do a series of experiments and decide how much uncertainty you should add to u based on the results). Start with a guess such as

Q = [0.005^2, 0; 0, 0.005^2]

and check if the 3-sigma ellipse covers the actual position after the experiment. You can also get fancy and set Q at each time stamp, scaled according to the motion, i.e.,

Q = [(a*translation)^2 + (b*rotation)^2, 0; 0, (c*translation)^2 + (d*rotation)^2]

where you tune for values of a, b, c, and d. This allows you (for example), to add more uncertainty if the robot is turning (larger values of c and d).

For your question about determining the R matrix, without getting into the details of how GPS works, your best bet is probably once again to do tests. One simple test would be to measure out some places on the ground (so you know their positions). Start by converting your initial latitude to (x, y) (see here). This will be your origin. Next drive to each of your known positions and calculate the (x, y) according to the GPS, and subtract off your initial position. Drive from known position to known position and so on (including revisiting positions) and record your (x, y) according to GPS. After this experiment you'll have a list of estimated positions and their corresponding true positions. From this you can use statistics to calculate the average uncertainty, and can set R appropriately.

Good luck!


问:
Mahalanobis distance between 2 line features
I am implementing the ATLAS SLAM framework for a ground robot, using EKF Slam for local maps and using line segment features. The line segment features can be abstracted to their respective lines [d,α] where d and α represent the distance and angle in the distance-angle representation of lines.

In the given framework, there is a local map matching step where lines of the local maps will be matched, and there is a need for a distance metric between 2 lines. The mahalanobis distance is suggested in the literature, however strictly a mahalanobis distance is between a single measurement and a distribution and not between 2 distributions.

How do I find the mahalanobis distance between line 1 [d1,α1] with covariance matrix S1 and line 2 [d2,α2] with covariance matrix S2?

In the EKF Algorithm from the book Probabilistic Robotics by Sebastian Thrun, there is a computation during the feature update step, where it looks like the covariances (of a new measurement and an existing measurement) are multiplied to give a resultant covariance matrix, and then the inverse is used in the Mahalanobis distance computation.

That would be similar to

```<code>Mahalanobis_Distance = [d2-d1,α2-α1] * Inverse(S1*S2) * [d2-d1,α2-α1]'
</code>```

Is that correct?

答:
There are many ways to measure the statistical difference between two distributions. For your case, you might consider the Bhattacharyya distance. From that page, the Bhattacharyya distance $D_B$ is

$$
D_B={1\over 8}(\boldsymbol\mu_1-\boldsymbol\mu_2)^T \boldsymbol\Sigma^{-1}(\boldsymbol\mu_1-\boldsymbol\mu_2)+{1\over 2}\ln \,\left({\det \boldsymbol\Sigma \over \sqrt{\det \boldsymbol\Sigma_1 \, \det \boldsymbol\Sigma_2} }\right),
$$

where $\boldsymbol\mu_i$ and $\boldsymbol\Sigma_i$ are the means and covariances of the distributions, and

$$
\boldsymbol\Sigma={\boldsymbol\Sigma_1+\boldsymbol\Sigma_2 \over 2}.
$$

I would also like to issue a warning. When calculating the difference between angles (e.g., $\alpha_1 - \alpha_2$ in your case), you have to take care of wrapping issues. For example, for $\alpha_1 = -179$ deg and $\alpha_2 = 179$ deg, their different is not $(-179) - (179) = -358$ deg, but rather it is $2$ deg. If you are only concerned about the relative values of statistical differences (e.g., "which is the smallest"), then consider using the circular distance ($c$) between the two angles, which is

$$
c = \frac{1 - \cos(\alpha_1 - \alpha_2)}{2}.
$$

This always returns a value $c\in[0,1]$, where $c=1$ is the result when the two angles 180 degrees apart. So if you use the Bhattacharyya distance, the angle part of $\boldsymbol{\mu}$ would be a circular distance. However, if you are looking at lines, rotating a line 180 degrees returns it to its original orientation! That's because the directions of lines are examples of axial data, and are invariant to rotations of +/- 180 degrees. In this case, just double the angle of the above circular distance; i.e.,

$$
c = \frac{1 - \cos[2(\alpha_1 - \alpha_2)]}{2}.
$$

Now $c=1$ when the lines are 90 degrees apart!

Good luck!


问:
innovation step ekf localization?
Let's say we have a bunch of observations $z^{i}$ from sensor and we have a map in which we can get the predicted measurements $\hat{z}^{i}$ for landmarks. In EKF localization in correction step, should we compare each observation $z^{i}$ with the entire predicted measurement $\hat{z}^{i}$?, so in this case we have two loops? Or we just compare each observation with each predicted measurement?, so in this case we have one loop. I assume the sensor can give all observations for all landmarks every scan.  The following picture depicts the scenario. Now every time I execute the EKF-Localization I get $z^{i} = \{ z^{1}, z^{2}, z^{3}, z^{4}\}$ and I have $m$, so I can get $\hat{z}^{i} = \{ \hat{z}^{1}, \hat{z}^{2}, \hat{z}^{3}, \hat{z}^{4}\}$. To get the innovation step, this is what I did
$$
Z^{1} = z^{1} - \hat{z}^{1} \\
Z^{2} = z^{2} - \hat{z}^{2} \\
Z^{3} = z^{3} - \hat{z}^{3} \\
Z^{4} = z^{4} - \hat{z}^{4} \\
$$
where $Z$ is the innovation. For each iteration I get four innovations. Is this correct? I'm using EKF-Localization  in this book Probabilistic Robotics page 204.

答:
Yes this is correct, given two assumptions:

Each measurement is independent (i.e., the (Gaussian) distribution of observation $z_i$ is uncorrelated with $z_j$). Usually this is a fair assumption (e.g., measuring the position of landmarks with a laser scanner).

Data association is known. In other words, you "just knew" that your first observation was in fact an observation of landmark 1. Therefore you can just compute the innovation with the predicted observation generated by landmark 1. Not knowing what landmark the observation belongs to is where the double loop comes in. In that case, you need to compare the observation with the predicted observations of all* the other landmarks, and choose the one that is most likely**, using a metric such as the Mahalanobis distance.

*You can probably speed this up by only comparing it to landmarks that are estimated to be in the field of view of the sensor.

**This is just one method of data association. Others (e.g., joint compatibility) exist.

Title: innovation step ekf localization?


问:
Calculate object distance with camera
Firstly I'm unsure whether this question belongs here or on another SE site (but I'll wing it for now).

I've recently been given the job of connecting up a 'smart camera' to a setup where a robotic arm will pick and place objects from point A to point B. The real application for the camera is to check if the objects are out of alignment to their supposed positions.

However I am curious to see if there is any way I can calculate the distance of an object given that I already know the objects actual size. Naturally the camera will see the object as bigger when closer and smaller when farther away but how can I turn this information into depth/distance from the camera?

I have not yet started using the camera. For now it is just an idea. I will assume that I can calculate what percentage of the view frame is taken up by the object.

For example if I have an object of uniform shape, I know that from dist1 it takes up 75% of the view frame and from dist2 it takes up 45% of the view frame.

Should this prove to be possible I imagine that it could have a number of different applications. /Anyway any feedback is appreciated. Thanks! ( :

答:
Think of it this way, cameras measure angles. Each pixel tells you the angle between the camera's central axis and the object/corner/etc shown at that pixel. So if you know real-world dimensions of the object, and are able to find the pixel locations for points on that object, then yes it is possible to extract the camera distance.

For example, suppose the camera (with focal length $f$) was looking at a ruler of length $l$ with the 0 end at pixel (0,0) and the other end at pixel ($u_x$,0). From trig you get
$$
\begin{align}
  tan(\theta) &= \frac{u_x}{f}
\\
  &= \frac{l}{d}
\\
  d &= \frac{l}{tan(\theta)}
\\
&= \frac{l f}{u_x}
\end{align}
$$

where $d$ is the distance from the camera to the ruler. (someone please double check my math)

Note that things start to get more complicated when you consider full 3D objects (not each point is the same distance to the camera) and camera rotation relative to the object. But the idea is the same: cameras measure angles.

Title: Calculate object distance with camera


问:
Which micro-controler/processor to be used for autonomous stereo vision robot system?
I am very new two robotics, however I have a working stereo algorithm which I want to combine with a SLAM algorithm. I am developing this system for an other application but I decided integrating it on a robot first and testing it might be a good way to get used to the system and test its behaviour in a realistic environment. (rather than testing it in some kind of software simulator only) However, I want the system to be autonomous and running on-board of the rover.

The system I am talking about will consist of:

a stereo camera
a rover with wheels with one motor each
possibly some kind of sensor that "measures" the movement, e.g. how much the wheels turned
maybe some distance sensor

Appart from this it's only software
the stereo software is already developed, the SLAM algorithm not. Therefore it is currently impossible to say how much RAM it needs. I am currently running the stereo-vision only on an i7 in approx. 1s.

Now my question:
as mentioned I have no idea about robotics, and also my electronics knowledge is limited, so I have no idea what I need for this robot when it comes to the processor and the electronics.

I read some stuff about the Raspberry Pi and Arduino boards but I have no idea what to make from this. I am afraid that a Arduino will not be able to handle the computational load of the stereo vision and the SLAM algorithm but I read that Raspberry Pis are not the first choice when interfacing with sensors is needed (in this case my stereo cameras). Also I found the Leika kit which is a robotics kit for the Raspberry Pi. Maybe this would be a good option for me?

Maybe an entirely different system would be even more advisable?

Possibly someone else build an equally complex system before and can give me some advise form his/her experience?

答:
Arduinos are slow. They run at 16mhz and don't normally have more than 10 kb of ram (the due has more, but still well under 1 mb. I personally would look into a beaglebone or udoo as they are both a lot faster than a raspberry pi. However, if you don't have much experiance with robotics and your project doesn't require it, I would avoid it

Also, your question isn't very directed. You might want to edit it to make it more so (it could be closed as not specific or the likes)


问:
autonomous obstacle detecting quadcopter
Is it possible to build a quadcopter which can detect obstacles and thereby avoiding them in order to reach its destination?
If so,how could it avoid the obstacles and how can the destination be set</p>

答:
This is quite a broad question. I will just skim the surface assuming you were interested in the software aspect, and will describe the software architecture. From the software perspective you need localization, navigation/planning, and control modules at minimum.

The localization determines where the quadcopter and the obstacle are. It reads the positional sensor information, i.e. visual, sonic, GPU. Localization synthesizes the sensor information to produce an internal state of the world - the location and speed of the UAV and its surroundings at any given moment.

Navigation/planning takes the internal state and decides what the UAV should do next. There are number of ways to do this, from good-old hard-coding, to motion planning, reinforcement learning, etc. For autonomous obstacle-avoidance, methods like Probabilistic Roadmaps (PRMa)[1] and Rapidly exploring Random Trees (RRTs)[2] are popular and there is tons of work that use these methods.

After you have a path or a trajectory a controller in a closed-feedback loop sends the torque inputs to the UAVs motors that moves the UAV. The localization observes the next state, planning/navigation optionally adjusts the trajectory, and the controller sends the input again. And this process repeats.

As far as specifying the goal, the easiest is to provide coordinates, but in general there is no consensus.

If you want to see a movie of quadcopter autonomously avoiding obstacles, check out:
https://www.youtube.com/user/sandraorionnm/ and take a look at [3].

[1] L. E. Kavraki, P. ˇSvestka, J. C. Latombe, and M. H. Overmars. Probabilistic roadmaps for path planning in high-dimensional configuration spaces. IEEE Trans. Robot. Automat., 12(4):566–580, August 1996.

[2] J.J. Kuffner and S.M. LaValle. RRT-connect: An efficient approach to singlequery
path planning. In IEEE International Conference on Robotics and Automation,
volume 2, pages 995 –1001 vol.2, 2000.

[3] Aleksandra Faust, Ivana Palunko, Patricio Cruz, Rafael Fierro, and Lydia
Tapia. Automated aerial suspended cargo delivery through reinforcement
learning. Technical Report TR13-001, Department of Computer Science, University of New Mexico, August 2013


问:
Need help calculating the thrust on quadcopter motors
I'm trying to calculate the lifting capability of my four quadcopter motors. I tried using eCalc but it doesn't have battery I'm using. Are there any equations to keep in mind for doing these calculations? Here are some relevant details:

Battery: 2200mAh 3S 25~50C LiPo

ESC: 25A

Motor: 1240kV Brushless

Propeller: 8x4

Any help would be much appreciated, thanks!

答:
Unfortunately, the basic equations for thrust aren't all that basic when you also want to look at things like motor efficiency, which is partly why all these quadcopter calculators are so popular.  The one at http://www.drivecalc.de/ is pretty handy, especially if you want to define things like custom motors or batteries.

I made some guesses about your setup and came up with:

About 0.053 N/W thrust efficiency for that prop

About 260 Watts at the shaft for that size motor

About 14 Newtons of thrust per motor

14 newtons will hold up about 1.4 kg

Max weight for a static hover with 4 motors is about 5.6 kg

You should probably be about half this for a quadcopter that flies well, so try to get its weight under 2.8 kg

If this is your first quad, I'd say that 2.8 kg (6.2 lb) is a little heavy. The bigger they are, the harder they fall.  This adage is definitely true for quadcopters.


问:
Quadcopter degrees of freedom
It might be kind of a stupid question but how many degrees of freedom are there in a typical quadcopter? I say some saying 4 and some saying 6. The difference stands in translation throughout the other 2 axis (horizontal ones). Being strict to what you can directly tell the quadcopter to do, only 4 movements are possible since you cannot apply a pure lateral force. But you can tilt to start a lateral movement and align the body right after and let it hover in a horizontal axis, theoretically. So, formally, how many degrees of freedom should I consider to exist?</p>

答: That depends on what you mean.  If your question is about output, then the answer is you have 4 degrees of freedom: thrust, pitch, yaw, and roll.  If you question is about the dynamics of the helicopter, then you have to make some assumptions.  Assuming the vehicle is a rigid body is usually a good assumption for answering basic questions about a system, in which case it would have 6 DOF, position in x, y, and z, plus rotation about x, y, and z.  If your question is about inputs, then the answer is also 6 DOF, because you have to measure all 6 DOF if you want to be able to control a quadcopter.  </p>

Title: Quadcopter degrees of freedom


答:
I think that it is important to recall that a rigid body in space has 6 Dof without considering quantum or relativistic effects ;). So if you use the newton equations, written in an inertial frame of reference, to describe the hole motion of a quadcopter you will get two set of
equations.
First the position $x \in \mathbb{R}^3$

$$
m\ddot{x}  = F
$$

where $F$ is the sum of all external forces, here will take place the action of the rotor's blades. Second, we have the equations for the orientation of the quadcopter and, in my opinion, they are a quite complex issue. If we write the moment of inertia $I$ w.r.t. the centre of mass of the quadcopter and in our inertial frame of reference, we can write
$$
I\dot{\omega} = \omega \times I \omega + M
$$
where $\omega \in \mathbb{R}^3$ is the angular velocity and $M$ is the sum of all external moments, all of them computed w.r.t. the centre of mass of the quadcopter. Note that in our second equation the euler angles $\psi$ does not apper. In fact, the dynamic equation for the orientation of a rigid body cannot be easily written in an explicit form w.r.t. the euler angles, because the appear in non linear form in $I$.

Now if we call $u\in \mathbb{R}^4$ our control imput, i.e., the velocity of the 4 blades, we have that the dynamic equations of our system is

$$
\left\{ \matrix{m \ddot{x} &=& F(u) \cr I \dot\omega &=& \omega \times I \omega +M(u)} \right.
$$
Where, F and M are in general non linear forms of the blade's angular velocities. I think that a this level it will be clear that our system is described by 6 parameters: the position that lives in $\mathbb R^3$ (but really the position bellows to the affine space constructed from $\mathbb R^3$ ) and the three euler angles that are a minimal representation of the rotation group $\mathcal S \mathcal O(3)$ that is a lie group with three degrees of freedom.

Until now we have a system completely described by 6 paramenters and 4 control inputs. So we have 6 DOF!. More over a physicist or mathematician could say that we have 6+4=10 DOF because the position of the motors are also parameter of our system, but engineers say that they are the control input so we manually set its values.

But what if I want to write my system in the more control-engineering shape  $\dot x = f(t,x,u)$?

Title: Quadcopter degrees of freedom

Body: It might be kind of a stupid question but how many degrees of freedom are there in a typical quadcopter? I say some saying 4 and some saying 6. The difference stands in translation throughout the other 2 axis (horizontal ones). Being strict to what you can directly tell the quadcopter to do, only 4 movements are possible since you cannot apply a pure lateral force. But you can tilt to start a lateral movement and align the body right after and let it hover in a horizontal axis, theoretically. So, formally, how many degrees of freedom should I consider to exist?</p>


答: I strongly recommend a patient lecture of the chapters related to rigid body kinematics and dynamics  of the book by Goldstein: classical mechanics. It will clear all our doubts.</p>


问:
Determing limits of rotation in a robot workspace
How to determine the limit range of end effector orientation (Roll-Pitch-Yaw) at one specific point(XYZ)?I had derived Forward/Inverse kinematic. I'm making a program for 6DOF articulated robot arm so that the user can know the limit of tool rotation in Global axis(Roll-Pitch-Yaw) at a certain point.</p>

答:
I will explain how to determinate the "normal" three dimensional workspace and then extrapolate to orientation. I hope to be useful.

Let $q$ the position of your robotic arm motors, so its value describe completely the position of your manipulator at each time. First we suppose that the motors of our robot have no limits so, abusing of the notation, we write $q \in \mathcal Q$, i.e., the configuration space and the joint's velocities $ \dot q \in \mathbb R^n$ for all $\mathcal Q$. Now we call $p = [\matrix{x^\top \psi^\top}]^\top$ the column vector with position and the euler's angles. Now, the differential direct kinematics reads

$$
\dot p = J(q) \;\dot q
$$

Where the jacobian $J$ has to parts
$$
J=\pmatrix{J_x \cr J_\psi}
$$

This equation can be readed as "for infinitesimal changes in the joint's positions, give me the infinitesimal changes in the end-effector's positions/orientation". In fact velocity deals with infinitesimal displacement in infinitesimal time.

The limits of the operations space $\Omega \in \mathbb R^3$ of a manipulator are the points where no infinitesimal changes of the joints positions gives infinitesimal changes in space positions. In other words, at these points it is not possible to achieve displacements in, at least, one direction.  This means that it the joint configurations $\bar{q}$ is in the limit of hte workspace if

$$
\mbox{Rank}\;( J_x(\bar{q})) < 3
$$

because there is at least one direction of the three dimensional space $\mathbb R^3$ that is outside the co-domain of the linear mapping given by the matrix $J_x(\bar q)$

The same reasoning can be applied to orientation. We looks for points in $\mathcal Q$ where infinitesimal changes in the joint's positions give no change in some orientation parameter, say an euler angle. The problem of using the previous formula as $\mbox{Rank}\; J_\psi$ is that the matrix $J_\psi$ could have a rank less than 3 because a representations singularity. That can be overrided using another  minimal orientation representation like quaternions, or simply changing the used euler angles in the singular points.

Now if each motor have its limit we write  $q_i \in [q_{i}^0, q_i^1]$. We call $\partial \mathcal Q $ the set of all configurations $q$ for which at least one component is in its limit.  We have that for $ q \in \partial \mathcal Q $ there is at least one $i$ for which $\dot q_i \in \mathbb R^+$ XOR $\dot q_i \in \mathbb R^-$, i.e., for the joint $q_i$, when it is at its upper limit, necessarily $\dot q \le 0$, and, when it is at its lower limit, necessarily $\dot q \ge 0$. For the limits of the workspace $\Omega \subset \mathbb R^3$ we have that the formula $\mbox{Rank}\;J_x < 3$ cannot be used in $\partial \Omega$, because at these points the domain of $J_x$ is not a vector space. At the points  $\bar q \in \partial \mathcal Q$  there is one direction that is forbidden for $\dot {\bar q}$, the mapping of that directions $J_x \dot{\bar q}$ is also a forbidden direction if and only if it is linearly independent of the mapping of all possible velocities $J_x \dot q_j$   in the three-dimensional space, then it is a limit of the workspace. In other words, a forbidden joint velocity maps into a forbidden end-effector displacement if and only if, there is not another allowed infinitesimal joint displacement that maps into a displacement in that direction. The same reasoning can be applied to orientation, taking into account the representations singularities.

So, your software shout do this:

in $\mathcal Q$ just seek for the values of $q$ where $\mbox{Rank}\;J_\psi < 3$ taking into account the representation singularities.

for each point in $\partial \mathcal Q$ you have to identify the forbidden velocity, say $\dot z$ and take its mapping $v = J_\psi \dot z$. Now construct the matrix $J'_\psi$ removing the $i$ column of each joint that lies in its limits. If $v^\top (J'_\psi) =0 $ then the direction is a limit in the orientation. Always taking into account the representations singularities!


问:
PID Integration over not constant dt (∆time)
Is integration over not constant dt (∆time) a possible thing? Let's say you have a PID loop with differentiating frequency, can the integral part of it still work? (Assuming you know the dt from the last iteration)

Could I just use a variable dt (∆time) in my calculation and the PID principle would still function correctly?

答:
Short answer: yes, as long as you adjust for the real dt you are fine

Longer answer: In reality, we are always using discrete time approximations of continuous time concepts of derivative and integral. So a varying dt just means the accuracy of your approximation is varying over time, but that's ok.  Examples of situations where you might run into problems are:

You are on the edge of stability and some of the slower timesteps
are too slow

You dt doesn't change randomly and happens to
interact with important system frequencies


答:
Normally, it would best to fix sampling time via hardware timer interrupt.

In case this cannot be done (like using software-only looping), it will work as long as you calculate,

normalized_error = (latest_reading - set_point) / (latest_time_stamp - previous_time_stamp)

Title: PID Integration over not constant dt (∆time)

Body:
Is integration over not constant dt (∆time) a possible thing? Let's say you have a PID loop with differentiating frequency, can the integral part of it still work? (Assuming you know the dt from the last iteration)

Could I just use a variable dt (∆time) in my calculation and the PID principle would still function correctly?


问:
Low-cost centimeter accurate satellite positioning (GNSS/GPS)
I am looking for a cheapest possible GPS setup with a centimeter precision without much HW hacking. I am not able to produce my PCB or do any soldering (though I would do that if there is no other way) so a kind of a easy-to-assemble setup would be welcome. I know about the $900 Piksi thing but that is still too expensive for me. It seems like cm precision should be possible for much less - like employing a 50 USD raw GPS sensor with an antenna and ordinary PC with RTKLIB software.

I am not sure if it is better to use two GPS sensor setup for RTK (one base station and one for rover) or whether I can get the corrective DGPS data elsewhere (my region is Czech Republic - there seems to be national grid here allowing to stream correction data for reasonable cost).

My application will be in a passenger car so I will not be limited with power source - no low power needed although that would be nice. I will be using the position readings within OpenCV - so I need to get the data into C/C++ code. The application is data collection so I can use raw GPS post-processing.

答: You are already mentioning that RTKLIB and a raw sensor would be the solution. Looking at the list of supported protocols in rtklib, there is a mention of the ublox modules. The LEA6T modules seem to fit and are not very expensive. There is also a simple break out board available which should fit your requirements of not creating hardware.</p>


问:
Can I use IMUs to improve the position/posture measurement of fingers in a "data glove"?
I have been using the Cyberglove to control a humanoid robot hand, but found it disappointing as it doesn't measure the posture of the human hand very accurately.

I have been wondering about the possibility of using Inertial Measurement Units (IMUs) mounted on the fingers to track position and measure posture. But I'm not sure how feasible it is.

Would an IMU return enough data to make tracking reliable in all circumstances?

Would it be possible to fool the system into incorrectly tracking the fingers?

Might it be possible to get away with using simple 3-axis accelerometers, or would it need 9-axis (accelerometer, gyro, and magnetometer)?

答:
The short answer is yes, this can work.  The long answer is "Yes, but you need to do a lot of sensor fusion".

The technology you're after was conceived about 5 years ago, the academic work is here:
https://people.csail.mit.edu/wojciech/MoCap/index.html

(source: mit.edu)

They combined the accelerometer data with ultrasonic ranges between the joints to improve the position estimation.  In this case, it was for full-body motion capture but doing it for just fingers should be a similar problem.

This project immediately became a company that began making motion capture devices (for 3D movies, video games, etc), but I can't remember the company name.  A google search led me to "animazoo", but I don't think that's what it was called before.  Maybe it's the same company with a new name.  In either case, those are the only relevant resources I know of but they seem to support your idea.

ContentLicense: CC BY-SA 4.0


问:
Stepper does not turn
I always wanted to have a CNC to make PCB quickly at home.

Finally, I got a 7x7 kit from zentools recently and put it together. I attached a battery powered screw driver to 2nd shaft of the stepper and moved the each axis all the way back and forward before wiring. All 3 axis moves smoothly, I can turn the steppers even by hand. Every piece works smoothly, no mechanical jam.

I decided to use GRBL as controller software. Tested the software without the shield or stepper (qv: Testing GRBL in Arduino Board without the steppers) I use Universal Gcode Sender to communicate with GRBL.

I got an Arduino CNC Shield for Arduino UNO, put it together, attached to Arduino UNO, re-tested GRBL, it worked.

I used Reprep's Stepper wiring article to connect stepper to the driver, wired 1 stepper to the stepper driver (X axis). Powered the shield with 20V 17.5Amp (350W) DC Regulated Power supply. (It was the power adaptor for an old 17" notebook. Notebook died, I kept the adaptor)

When the move 5 steps command (G1 X5) was sent, stepper makes a small move in the direction and then makes a grinding noise. (Can be seen on Youtube)

I tried switching 1st pair's cables, using another stepper driver (3 drivers), turning the potentiometer to increase the current, but still no luck.

I attached 2 photos of the cnc and the controller and controller unit.

I tried everything I can think of, any suggestions?

答:
After reviewing the Polulu Stepper Driver manual, I realized I was wiring stepper wires in wrong order.

The controller pin labels are: 1A, 1B, 2A, 2B. The controller card's manual was saying 'use letters as pair' but it suppose to say 'use numbers as pair'.

Everything works perfectly after correcting the wires.

Title: Stepper does not turn


问:
Cascading PID DC Motor Position & Velocity Controllers
I'm trying to build a robot with a differential drive powered by two DC Motors. First I implemented a PID Controller to control the velocity of each motor independently. Estimated the TF using the MATLAB's System Identification Toolbox, of the open loop system by the acquiring the velocity of each wheels encoder in function of the PWM signal applied by an Arduino microcontroller. All went well and i successfully dimensioned the PID gains for this controller.

What I'm trying to accomplish now is to control the exact (angular) position of the DC Motor. I thought in cascading a PID controller in the input of the other already implemented. So this way, I can give a position to the first controller, which will be capable of generate an output reference to the second (velocity) controller so it generates the appropriate PWM value signal to drive the DC Motor accordingly.

Will it work? Is that a good approach? Or should I try to implement a different controller which outputs the PWM signal in response to a position reference signal?

Many thanks for your attention and I hope somebody can help me with these doubts.

答:
I'm a little confused, are you trying to control each wheel's exact position or the overall position of the robot. For the former, a cascaded structure makes sense where the robot position control loop defines desired velocities for each motor.

For the latter (which sounds a little strange to me), you should just be able to treat the velocity as the 'D' part of your position controller, and not do a separate velocity controller.

$$
\begin{align}
  u = - k_p (p - p^d) - k_d (v - v^d) - k_i \int_0^t (p(t) - p^d(t)) dt
\end{align}
$$
where $p$ and $v$ are the measure position and velocity respectively, and $\cdot^d$ indicates the desired value.


问:
Exoskeleton Drive System Help
I am currently working on an exoskeleton.  The exoskeleton is going to help kids with cerebral palsy learn to walk 4 years sooner than traditional therapy.  Currently we are using 2 Ame 226-3003 with the roboclaw 2x60A motor controller controlled by an Arduino mega.  The Ame 226-3003 motors are not powerful enough.  In addition the Ame 226-3003 has a worm gear thus the motor cannot be moved when the motor is turned off.  Our position feedback system is a gear attached to the shaft of the motor which spins a gear on a potentiometer.  The two gears have a 1:1 ratio.

In order to better understand the project, please see the video:
https://www.youtube.com/watch?v=NL_aCwJSRiE&feature=youtu.be

The Ame 226-3003 catalog page:
http://www.amequipment.com/wp-content/uploads/2013/02/801-1071-web.pdf

We need a new drive system:

more powerful than the Ame 226-3003 motor.  We do not have an exact torque spec but we believe any drive system that is 70-100% more powerful than the Ame 226 - 3003.

We like the rpm range of the Ame 226-3003.

The drive system must be able to spin freely when the motor is not in use.

We need a way to get position feedback, the potentiometer system we are using seems to work, however it adds to much extra hardware(more stuff to break), (ie) the gear on the potentiometer and the gear on the shaft have to mesh constantly and we have to zero the potentiometer every time we put the leg together so the potentiometer doesn't over spin.  * We would prefer to have an optical encoder inside the motor.

We need to have the drive system be at a right angle.

I need help designing a drive system that will meet the requirements.

I think I might have found a motor that will work:

The amp flow G43-500

http://www.ampflow.com/standard_motors.htm

I like the G43-500 because it can run at 24 v, thus it will take less amps than 12v. Will that motor get the job done?

I need to gear this down to around 80rpm.  What type of gear box would work best?

答:
For your question on position feedback, this brand, among others, are used in actual commercial/industrial systems.

Has small and big size.

Absolute gives actual angle, says 256 steps per 360 degrees. This may best suits you.

Incremental is to give, says, 500 pulses per revolution. However, you need other sensor to sensor the 'starting angle'. May not suits you, in this case.

http://www.ia.omron.com/products/category/sensors/rotary-encoders/incremental/index.html

http://www.ia.omron.com/products/category/sensors/rotary-encoders/absolute/index.html

For man-rated system, safety is very important, especially when powerful motor is used.  You may want to use some sort of force sensor to ensure motor auto stop in case of hardware/software error/ equipment failure, etc. so as to protect the human.  Case noise etc. cause errors. Optical isolation may be more safe.

Hope it helps.

Title: Exoskeleton Drive System Help


问:
Is there an analytical solution for inverse kinematics of a 6 DOF serial chain?
Let's take a 6 DOF robotic structure. It's consisting of the 3 DOF global structure for the position - and the 3 DOF local structure for the orientation of the endeffector.

If the last 3 axis (of the local structure) are coincident in one point, the inverse kinematics can be solved analytically by decomposing it into a position- and orientation-problem.

But is it possible to solve the inverse kinematics analytically if the last 3 axis are NOT coincident in one point? I've read several papers that claim that due to high non-linearity of the trigonometric functions and motion complexity in 3D-space, a 6 DOF serial chain cannot be solved analytically.

Does anybody know if this is right?

答: This paper seems to agree with you on the fact that 6 DOF arms exist that are not analytically solvable using inverse kinematics, but it also implies there are arm structures that can be analytically solved for, so I would recommenced sticking to those. Most 6 DOF robot arms don't have their last 3 axes coincident in one point, but they are still incredibly precise. Analytical solutions must exist for standard 6 DOF robotic arms. </p>


问:
EKF Localization when robot is in parallel with a landmark.
I'm facing a real weird problem with EKF Localization. The filer gives me wrong error every time the robot is in parallel with a landmark. I've debugged the code many times but failed to solve the problem however I found out where is exactly the problem occurs. The following picture shows the scenario. The robot moves in a circular motion. There are four landmarks. I have indicted in the picture where the filer gives me wrong angle for the estimated state.  As you see, when the robot is in parallel with all landmarks, I got a wrong angle for the estimated robot's pose.

This is another picture shows how the estimated angle is wrong where the red circle is the estimated robot's pose and the blue one is the actual robot's pose.

I did also track the problem numerically. What I found out is that the estimated measurement of landmark # 4 is in the opposite direction of the actual measurement of landmark # 4.

```<code>i = 1 <---- landmark 1 <200,0>

est_robot =
    6.4545
   21.1119
    0.1246

Zobs =
  194.9271
   -0.2208
    1.0000

Zpre =
  194.6936
   -0.2333
    1.0000

real_robot =
    6.2069
   20.9946
    0.1188

Mubar =
    6.2844
   21.7029
    0.1201

i = 2 <---- landmark 2 <200,200>

est_robot =
    6.2844
   21.7029
    0.1201

Zobs =
  263.8102
    0.5982
    2.0000

Zpre =
  263.2785
    0.6239
    2.0000

real_robot =
    6.2069
   20.9946
    0.1188

est_robot =
    6.2901
   21.0100
    0.0155

i = 3 <---- landmark 3 <-200,200>
est_robot =
    6.2901
   21.0100
    0.0155

Zobs =
  273.0734
    2.2991
    3.0000

Zpre =
  273.1173
    2.4114
    3.0000

real_robot =
    6.2069
   20.9946
    0.1188

est_robot =
    6.2840
   21.0462
    0.0259

i = 4 <---- landmark 4 <-200,0>

est_robot =
    6.2840
   21.0462
    0.0259

Zobs =
  207.2696
    3.1272 <--- the actual measurement of landmark 4
    4.0000

Zpre =
  207.3548
   -3.0658  <--- this is the problem. (it should be 3.0658)
    4.0000

real_robot =
    6.2069
   20.9946
    0.1188

est_robot =
    6.0210
   20.8238
   -0.5621
</code>```

and this is how I computed the angles.

For the actual measurements,

```<code>Zobs = [          sqrt((map(i,1) - real_robot(1))^2 + (map(i,2) - real_robot(2))^2)        ;
            atan2(map(i,2) - real_robot(2), map(i,1) - real_robot(1)) - real_robot(3);
                                                                     i];

     % add Gaussian noise
     Zobs(1) = Zobs(1) + sigma_r*randn();
     Zobs(2) = Zobs(2) + sigma_phi*randn();
     Zobs(3) = i;
 Zobs(2) = mod(Zobs(2), 2*pi);

 if (Zobs(2) > pi) % was positive
    Zobs(2) = Zobs(2) - 2*pi;
 elseif (Zobs(2) <= -pi) % was negative
    Zobs(2) = Zobs(2) + 2*pi;
 end
</code>```

For the predicted measurements

```<code>q    = (map(i,1) - est_robot(1))^2 + (map(i, 2) - est_robot(2))^2;
    Zpre = [                                                             sqrt(q);
            atan2(map(i,2) - est_robot(2), map(i,1) - est_robot(1)) - est_robot(3);
                                                                              i];

     if (Zpre(2) > pi) % was positive
        Zpre(2) = Zpre(2) - 2*pi;
     elseif (Zpre(2) <= -pi) % was negative
        Zpre(2) = Zpre(2) + 2*pi;
     end
</code>```

答:
It seems to me that you did not consider the fact that angles are not just real numbers but cyclic ($+ \pi = - \pi$).

What I found out is that the estimated measurement of landmark # 4 is in the opposite direction of the actual measurement of landmark # 4.

No. The two angles $3.1272$ and $-3.0658$ are rather close and thus these numbers look perfectly fine. The angle difference is $0.09 \equiv 5.17^{\circ}$.

When computing the difference between two angles, you need to make sure the results lie in $[-\pi, +\pi]$ (e.g. as described  here).


问:
How to machine aluminium on a low budget?
For my robotic projects I need some aluminium parts. Currently I am looking for a way to build a chassis including simple gear box. So I need relatively high precision. Which options do I have to machine aluminium without investing in expensive tools?

This is what I could think of so far.

Design parts in CAD and send them to a third party company for fabrication. The problem with this is that hobby projects almost never need large quantities and piece production can be still expensive.

Buy cheap tools to work aluminium by hand. I don't know which tools would fit this task best. Moreover, the results might be inaccurate, which is a problem for designs with moving parts.

Find someone with a CNC who let's me machine my parts. This would most likely result in very slow prototyping cycles though.

A method that I can do at home with not too expensive tools would be perfect, but I'm looking forward to every solution.

答:
In recent years, there is a surge in low-cost desktop-size home/DIY/High School level CNC, milling machine, router and 3D printers (common 3D motions parts, just the 'head' differs).

Hundreds of companies do sell assembled unit and/or kits.

I do not have hands-on experience on this myself and cannot offer solid help. But since many people make/buy/sell them, it sure live up to expectation (software, speed, accuracy) at the DIY/home/hi school level. People does use metal, plastic and even wood and wide range of price and performance

Examples, randomly picked up for illustration, are
http://jason-webb.info/wp-content/uploads/2012/01/cnc-mill.gif
http://jason-webb.info/2012/01/cnc-machine-first-thoughts-and-project-overview/


问:
Best technique to built an ejectable drawer?
I want to build a closet with ejectable drawers. On the top should be 4 buttons, each eject opening one of the four drawers of the closet.

I am looking for ideas on how to accomplish this. What kind of springs, slider mechanisms perhaps, and other materials to use?

Any examples?

答:
Assuming you need only to eject the drawer automatically and can close it back manually, I would suggest using compressed spring which would push out the drawer if there is no resistance.
A hook or similar mechanism holds the spring when the drawer is pushed back in.

This mechanism would save you use of motors, and thus you won't use electricity. The drawer would function even in case of power outage.


答:
Stereo vision and SLAM are pretty heavy algorithms, both in terms of the processing power and RAM required. You can forget about running this on a little microcontroller like an Arduino. These run at tens of MHz, and have only a few KB RAM.

At the very least you'll need something running at hundreds of MHz with hundreds of MBs of RAM. You didn't say exactly what i7 you were using, but these typically run at several GHz clock speed, and would have several GB RAM installed. On this machine, your stereo vision took a whole second to process. On a Beaglebone, you might expect this to take tens of seconds at best.

I recommend using a small laptop computer to process the vision, and something like an Arduino to interface the laptop to the rest of the robot. The laptop can talk to the Arduino over the USB serial port, which should have ample bandwidth for that.

This is quite a common way to prototype a robot:

Title: Which micro-controler/processor to be used for autonomous stereo vision robot system?

Body:
I am very new two robotics, however I have a working stereo algorithm which I want to combine with a SLAM algorithm. I am developing this system for an other application but I decided integrating it on a robot first and testing it might be a good way to get used to the system and test its behaviour in a realistic environment. (rather than testing it in some kind of software simulator only) However, I want the system to be autonomous and running on-board of the rover.

The system I am talking about will consist of:

a stereo camera
a rover with wheels with one motor each
possibly some kind of sensor that "measures" the movement, e.g. how much the wheels turned
maybe some distance sensor

Appart from this it's only software
the stereo software is already developed, the SLAM algorithm not. Therefore it is currently impossible to say how much RAM it needs. I am currently running the stereo-vision only on an i7 in approx. 1s.

Now my question:
as mentioned I have no idea about robotics, and also my electronics knowledge is limited, so I have no idea what I need for this robot when it comes to the processor and the electronics.

I read some stuff about the Raspberry Pi and Arduino boards but I have no idea what to make from this. I am afraid that a Arduino will not be able to handle the computational load of the stereo vision and the SLAM algorithm but I read that Raspberry Pis are not the first choice when interfacing with sensors is needed (in this case my stereo cameras). Also I found the Leika kit which is a robotics kit for the Raspberry Pi. Maybe this would be a good option for me?

Maybe an entirely different system would be even more advisable?

Possibly someone else build an equally complex system before and can give me some advise form his/her experience?


答:
I have done this myself, controlling the exact position of a brushless DC motor as its velocity ramps up and down. And I did it using a position controller only. Sounds obvious, but it worked extremely well.

The integral term of the controller is key to this. Since you want the position error to be as close to zero as possible the whole time, but you need a large output from the controller to drive the motor, most of this comes from the I term.

The other thing you need to add is a feed forward term, which feeds some of the demanded acceleration to the output. This will give the controller the extra power it needs to track rapid velocity changes. We could call this an FPID controller.

Title: Cascading PID DC Motor Position & Velocity Controllers

Body:
I'm trying to build a robot with a differential drive powered by two DC Motors. First I implemented a PID Controller to control the velocity of each motor independently. Estimated the TF using the MATLAB's System Identification Toolbox, of the open loop system by the acquiring the velocity of each wheels encoder in function of the PWM signal applied by an Arduino microcontroller. All went well and i successfully dimensioned the PID gains for this controller.

What I'm trying to accomplish now is to control the exact (angular) position of the DC Motor. I thought in cascading a PID controller in the input of the other already implemented. So this way, I can give a position to the first controller, which will be capable of generate an output reference to the second (velocity) controller so it generates the appropriate PWM value signal to drive the DC Motor accordingly.

Will it work? Is that a good approach? Or should I try to implement a different controller which outputs the PWM signal in response to a position reference signal?

Many thanks for your attention and I hope somebody can help me with these doubts.


问:
Position Control of an Omni Wheel Drive Robot
I want to create a robot that will navigate on a desired path!
That path can be a straight line or a circular path with a given radius.

I will use 3 or 4 omni wheel drive platform and for positioning,
I am using this research paper which perform dead-reckoning using mouse sensors.

Dead-Reckoning using Mouse Sensors

I've understood that I will get x, y and θ positions, which are actual positions of robot.
These can be used to calculate the error and then using PID to compensate the error.

But, to find the error, I must have the desired position of the robot at that moment!

For example, the Robot is at (0,0) and it needs to move in a circular path of equation

$$ x^2 + y^2 - 10y = 0 $$

Now, I want to calculate the position at t = 2 sec, how to do that?

If someone has already done similar stuff, please post the link. I am not able to find any resource on web!

答:
This excellent course covers a lot of your question. Processor presented well in talking and also actual demo on real hardware.

Also has software stimulator for student to test out without real hardware.

As course now finished, not sure if you can log in or need to wait until next run.

https://www.coursera.org/course/conrob

also, I never used omni wheel, would you mind advise formula, pointer,tutorial,paper on how to convert wheel rotation to speed and angle of path. Also, if possible, can I have 10 to 20, photo of different omni wheel setup. First time to see your paper using 90 degree gear to allow longer motor than straight 120 degree delta format usually see. excellent idea.


答:
Generally speaking, you need to define how long you want a full revolution to take. From that, you know what the desired angle is at each timestep and can calculate the desired position.

Note this breaks down to cos and sin waves in both $x$ and $y$ for ellipses in general.
$$
\begin{align}
  x^d - x_c &= a_x \cos \left ( \frac{2 \pi}{p} t \right )
  \\
  y^d - y_c &= a_y \sin \left ( \frac{2 \pi}{p} t \right )
\end{align}
$$
where $x^d$ and $y^d$ are the desired respective positions, $(x_c, y_c)$ is the center of the circle, $a_x$ and $a_y$ define the ellipse size ($a_x = a_y = $radius for a pure circle), $p$ is the period in seconds for a full revolution, and $t$ is the time in seconds.

Title: Position Control of an Omni Wheel Drive Robot

Body:
I want to create a robot that will navigate on a desired path!
That path can be a straight line or a circular path with a given radius.

I will use 3 or 4 omni wheel drive platform and for positioning,
I am using this research paper which perform dead-reckoning using mouse sensors.

Dead-Reckoning using Mouse Sensors

I've understood that I will get x, y and θ positions, which are actual positions of robot.
These can be used to calculate the error and then using PID to compensate the error.

But, to find the error, I must have the desired position of the robot at that moment!

For example, the Robot is at (0,0) and it needs to move in a circular path of equation

$$ x^2 + y^2 - 10y = 0 $$

Now, I want to calculate the position at t = 2 sec, how to do that?

If someone has already done similar stuff, please post the link. I am not able to find any resource on web!


问:
Controlling a quadrotor from a PC
I need to control quadrotor from a PC, without using a joystick.

I have got a mini-beetle quad V929 Beetle 4-Axis  and also have this NRF24L01+ Wireless Transceiver Module Chip (2.4 GHz transceiver)
Is it possible to write an Arduino program to make them speak to each other?

I did some research and found that the quad V929 model uses FlySky protocol and only works with A7105 NRF24L01 2.4 GHz transmitter chip not the one which I mentioned above.

Are there any other better ways of controlling the quad from PC or Arduino board?

答:
You can easily remove A7105 module from your transmitter and connect it to Arduino (take care because it uses 3.3v levels).

You can get this library for Arduino based TX module:
http://www.cloud-rocket.com/2014/07/reverse-engineering-wltoys-v929v911protocol/

Title: Controlling a quadrotor from a PC


问:
Matlab for moving a robot towards the detected block
the matlab code is used to detect red colored object, but i want to control a bot to move towards the detected object. just need a simple algorithm or idea, controlling the servo i will be able to do it.

```<code>%get snapshot
data = imread('image.jpg');
% Now to track red objects in real time
% we have to subtract the red component
% from the grayscale image to extract the red components in the image.
diff_im = imsubtract(data(:,:,1), rgb2gray(data));
%Use a median filter to filter out noise
diff_im = medfilt2(diff_im, [3 3]);
% Convert the resulting grayscale image into a binary image.
diff_im = im2bw(diff_im,0.18);

% Remove all those pixels less than 300px
diff_im = bwareaopen(diff_im,300);

% Label all the connected components in the image.
bw = bwlabel(diff_im, 8);

% Here we do the image blob analysis.
% We get a set of properties for each labeled region.
stats = regionprops(bw, 'BoundingBox', 'Centroid');

% Display the image
imshow(data)

hold on

%This is a loop to bound the red objects in a rectangular box.
for object = 1:length(stats)
    bb = stats(object).BoundingBox;
    bc = stats(object).Centroid;
    rectangle('Position',bb,'EdgeColor','r','LineWidth',2)
    plot(bc(1),bc(2), '-m+')
    a=text(bc(1)+15,bc(2), strcat('X: ', num2str(round(bc(1))), '    Y: ', num2str(round(bc(2)))));
    set(a, 'FontName', 'Arial', 'FontWeight', 'bold', 'FontSize', 12, 'Color', 'yellow');
end

hold off
</code>```

答:
Image X and Y will reflect x and Y coordinates on the floor. Lens has distortion. Use calibration (if opencv), if high accuracy needed (may not need in this case).

Original answer was mis-understood:

Height and Width is distance (far, smaller image) then PID to control speed, slow down when near

Left, Central, Right of the block is angle of block as reference to vehicle coordinate frame and calculate the motion angle


答:
Depending on your actual project, you can choose several options.

DGPS accurate to 0.5 to 2 meters for real time application, meaning get corrected position now. Needs one GPS receiver and one data stream receiver, wireless broadcast and internet/cellularphone, feeding real time correction data (from reference station) to the GPS receiver.

RTK is real time. Same setup as DGPS. Normally, need professional/survey grade (not consumer grade) GPS receiver. The data stream format for RTK is different from DGPS.

Post processing mean getting accurate position afterward. Record data from GPS receiver that send out raw data (only higher grade unit does this), save to file. Back to office, use software to process the data against recorded 'data stream' from a reference station.

You can own your reference station by buying your own reference station receiver. Some countries/companies operate this as a service, named, CORS, continuously operated reference stations, at free or fee-based.  Through international co-operation, IGS operates this on international scale. Data accuracy, coverage area, how-to-get-data, fee vary by huge extend. You need to find out what you want, can have and willingness to pay. Some countries offer best money can buy service, free of charge, as public service.

Title: Low-cost centimeter accurate satellite positioning (GNSS/GPS)

Body:
I am looking for a cheapest possible GPS setup with a centimeter precision without much HW hacking. I am not able to produce my PCB or do any soldering (though I would do that if there is no other way) so a kind of a easy-to-assemble setup would be welcome. I know about the $900 Piksi thing but that is still too expensive for me. It seems like cm precision should be possible for much less - like employing a 50 USD raw GPS sensor with an antenna and ordinary PC with RTKLIB software.

I am not sure if it is better to use two GPS sensor setup for RTK (one base station and one for rover) or whether I can get the corrective DGPS data elsewhere (my region is Czech Republic - there seems to be national grid here allowing to stream correction data for reasonable cost).

My application will be in a passenger car so I will not be limited with power source - no low power needed although that would be nice. I will be using the position readings within OpenCV - so I need to get the data into C/C++ code. The application is data collection so I can use raw GPS post-processing.


问:
Could piezoelectric sensors be crushed?
I have found some load sensors (piezoelectric) that measure relatively small weights (on the order of ~ grams). That's what I need!

However...
Around my robot, there will occasionally be bursts of extremely high pressure. These bursts do not need to be measured... they just wash over.
The pressure appears, to the sensor, to be a ~ 2,000+ kg

Question:
Are these sensors likely to break or fatigue? I realize piezos do not measure via deformation, but still... that's a big load!

Maybe I should just order a few and try...

答:
Yes, of course it 'can be crushed' - (imagine I'm standing in front of a ginormous hydraulic press, with an evil grin on my face).

The sensor deforms under pressure. When it deforms far enough it will reach its elastic limit and fail.

The solution is to arrange to transfer the load from the sensor to a stand when the load exceeds the range (and before it exceeds the elastic limit and cracks). For a piezo sensor, this could be as simple as a pin that stops the anvil motion before it destroys the sensor.

If the transient is applied and removed rapidly, but all other changes in force are slow, you could simply put a shock absorber in parallel with the sensor. The shock would take the load during the overpulse.

Title: Could piezoelectric sensors be crushed?


答: Actually, you can perform most milling operations with a file, a micrometer, and patience.</p>

Title: How to machine aluminium on a low budget?

Body:
For my robotic projects I need some aluminium parts. Currently I am looking for a way to build a chassis including simple gear box. So I need relatively high precision. Which options do I have to machine aluminium without investing in expensive tools?

This is what I could think of so far.

Design parts in CAD and send them to a third party company for fabrication. The problem with this is that hobby projects almost never need large quantities and piece production can be still expensive.

Buy cheap tools to work aluminium by hand. I don't know which tools would fit this task best. Moreover, the results might be inaccurate, which is a problem for designs with moving parts.

Find someone with a CNC who let's me machine my parts. This would most likely result in very slow prototyping cycles though.

A method that I can do at home with not too expensive tools would be perfect, but I'm looking forward to every solution.


答: Indeed I d also go for an interrupt method. As this method allows you to execute code, do something etc.. on a very arbitrary base. Which I think youll ,due to the non constant dt</p>


问:
how to plot a line between two centroids in matlab

I am able to locate centroids of each blocks, but i am unable to join two blocks with a line segment by avoiding the obstacle as shown in the figure. Please need help how do i achieve this using matlab.

答:
Sorry I do not know. But following course has your needed info

Some course can register while not running. Some need wait for run time.

Low-level motion (PID, point a to b) https://www.coursera.org/course/conrob.

High level path planning https://www.edx.org/course/tumx/tumx-autonavx-autonomous-navigation-1658

part 1 and of of this, https://courses.edx.org/courses/SNUx/SNU446.345.1x/1T2014/info

Fly https://www.edx.org/course/tumx/tumx-autonavx-autonomous-navigation-1658


问:
Arduino with two Linear Actuators, two ACS714 Current Sensors, and an L298N Motor Driver setup
I am using the L298N motor driver to drive two HAD1 linear actuators (12V each and a no-load drive current of ~950mA each)

Linear Actuator: http://www.alibaba.com/showroom/mini-linear-actuator-had1.html

Motor Driver: is a L298N dual-h-bridge motor-driver controller board-module for arduino robot

I am also using a current sensor per motor to get feedback of what the motor is doing (only sensors I have available, but I can detect of the motors are moving or stopped). I am using two ACS714 current sensors. The supply voltage for each is 4.5V to 5.5V and Supply Current is 10mA to 13ma:

Current Sensor: is an ACS714 current sensor.

And Here is the circuit diagram that I made for my actual setup (an Arduino UNO, two current sensors, to linear actuators, and one motor drive):

Circuit Diagram:

Will this setup work? Will I have enough current/power coming out of the 5V of the arduino to power both the L298N logic and the two ACS714 sensors?

答:
Yes, that looks like it will work. Keep in mind that the arduino io pins aren't powering any logic. Most Arduinos can provide more than 500 mA from their 5v pin assuming that they are connected to a power supply other than usb (not that you want to draw much current from it). The io pins on atmega328 based boards can provide 40 mA, so powering anything more than an led from them is generally not a good idea.

The one thing I would worry about is that the ACS714 is rated at 30 amps, and it has a resolution of 66 mV/amp. The atmega328's 10bit adc has a theoretical resolution of 4mV. While this sounds like it should be enough, I personally doubt the adc would be reliably accurate below 39 mV when noise is taken into account (3 LSBs). This doesn't take thermal drift and other factors into account. It would still probably work fine, but don't expect much from the current sensors.


问:
Quadruped Learning Simulator
I'm currently building a robot with four legs (quadruped), 3 DOF (Degrees of Freedom) and Its been suggested here that I use a simulator to do the learning on a computer and then upload the algorithms to the robot. I'm using an Arduino Uno for the robot and what software could I use to simulate the learning and then be able to upload to the Arduino board?</p>

答:
The recently open-sourced V-REP simulator may suite your needs. I found it more approachable than Gazebo, and it can run on Windows, OSX, and Linux. Their tutorials are fairly straight forward. There are a ton of different ways to interface with it programmatically (including with ROS). It looks like there is even a tutorial for making a hexapod, which you could probably use as a starting point if they don't already have a quadruped example available. Unfortunately, I believe the simulator is tied directly with the UI rendering, which I believe is not necessarily the case with Gazebo.

So, your program would have to use one of the many ways to interface with V-REP, and then feed the performance of a particular gait, determined from some sensor in V-REP, into a machine learning algorithm (perhaps something from OpenCV as @WildCrustacean mentioned). You'd then have to come up with a translation from the gait description used by the simulated robot to something used to command actual motors on your Arduino.

On the other hand, you could make your own simulator using an existing physics engine, rendering it with a graphics library. Bullet and OGRE, respectively, could be used for this purpose, if you like C++. There are tons of others for other programming languages.

I would also look into how researchers who work on gait generation do their simulations. There might be an existing open source project dedicated to it.

Title: Quadruped Learning Simulator


答:
Have you tried the line() function, which plots a straight line on a figure?

You do something like

```<code>imshow(myImage);
hold on
line(X, Y);
</code>```

Check help line for details.

Title: how to plot a line between two centroids in matlab

Body: I am able to locate centroids of each blocks, but i am unable to join two blocks with a line segment by avoiding the obstacle as shown in the figure. Please need help how do i achieve this using matlab.

Body:
Have you tried the line() function, which plots a straight line on a figure?

You do something like

imshow(myImage);
hold on
line(X, Y);

Check help line for details.


答:
As John Williams points out you can find desktop metal milling machines that are reasonably priced.  However if you want to work with metal make sure the machine you're buying is designed for that.

There are a few major differences between metal cutting and machines designed for wood or for additive processes (3D printers):

The cutting forces with metal (even with a soft metal like Aluminium) are very high.  If you do not have a stiff enough frame the cutting tool will simply bounce off the surface of the metal (chatter) and will result with very poor cutting, extra heat, and fast dulling of the tool.  If you look at the design of metal mills they are generally very solid hunks of metal (steel).

The rotational speed of a metal working tool is going to be much slower than e.g. a wood tool.  A router designed to cut wood may run at 10K RPM which is way too fast for metal.  It may be able to take very light cuts off aluminium but the cutting tool will dull very quickly and the router itself is not designed to take the forces of cutting metal and will also not live for very long.

Metal cutting often requires lubrication/cooling that isn't used with wood.

There are many different Aluminium alloys with somewhat different properties.

Depending on what you are trying to build you may not need the entire spectrum of machining capabilities.  E.g. if you're just trying to locate some objects in 2D you can get a plate and drill holes in it with reasonable accuracy without needing any fancy milling equipment.  You can also sometimes substitute adjustability to accuracy/precision, the simplest example is drilling a large hole and using a caliper or micrometer to measure the position before tightening your bolts.


问:
How can I build a 10cm-200cm IR range sensor?
Everybody here is probably aware of the Sharp distance sensors (GP2Y0 series, e.g. GP2Y0A02YK0F). They use a diode to emit infrared light and measure the angle of the reflected light with a PSD (i.e. they do triangulation). They seem to be the only producers of this technology.

I am only aware of a few similar but incomparable devices (sensors of ambient light and distance or proximity like Si114x). Which other comparable products are out there?

Another way to ask this question: "What are the different ways to build a 10cm - 200cm range low-cost IR range sensor, and what is an example of each of those ways?"

答:
There are a variety of IR proximity sensors that you can buy.

You could also adapt this technique using a Panasonic IR sensor with an Arduino, and use successive approximation -- adjusting the IR LED resistance -- to make a guess at the range.


问:
Quadcopter degrees of freedom
It might be kind of a stupid question but how many degrees of freedom are there in a typical quadcopter? I say some saying 4 and some saying 6. The difference stands in translation throughout the other 2 axis (horizontal ones). Being strict to what you can directly tell the quadcopter to do, only 4 movements are possible since you cannot apply a pure lateral force. But you can tilt to start a lateral movement and align the body right after and let it hover in a horizontal axis, theoretically. So, formally, how many degrees of freedom should I consider to exist?</p>

答:
I think the term you are looking for is Holonomic.  The important distinction that you've missed is between "total degrees of freedom" and "controllable degrees of freedom" (which is what most roboticists mean when they refer to DOF).  </p>

<p>Your quadcopter is non-holonomic; it can achieve 6 degrees of freedom, but only by planning maneuvers that make use of its 4 controllable degrees of freedom.  </p>

Title: Quadcopter degrees of freedom

Body:
I think the term you are looking for is Holonomic.  The important distinction that you've missed is between "total degrees of freedom" and "controllable degrees of freedom" (which is what most roboticists mean when they refer to DOF).

Your quadcopter is non-holonomic; it can achieve 6 degrees of freedom, but only by planning maneuvers that make use of its 4 controllable degrees of freedom.