问:
Is there a list of maneuvers related to control of a tracked platform?
I have a platform with two tracks and two motors. Each one uses an electronic speed control with "double tap to reverse". Each ESC takes an input pulse train frequency from at 1500 neutral +/-700.

I'm interested in learning if there are algorithms or a list of commands I can use to control how such platform executes maneuvers. For example:

Lock one thread and have the platform rotate by using the other one

Have two treads rotate in opposite directions

Execute a U turn

I'm struggling with expressing in code how such maneuvers should be executed. There's a "dead" zone around the 1500 pulse train frequency where the ESC output is too weak to cause the platform to move. The double tap to reverse also makes it tough to understand for how long each track should be turned off.

Thank you for your input

答:
I think you're caught up in trying to build high-level behavior (maneuvers) from low-level motor functionality, when in reality you should be attempting to decouple them somewhat.

So you're asking 3 questions.

How do the high level behaviors work?

What low-level API do I want?

How should the low-level API be implemented on my ESC?

So, working backwards: the relevant information on implementation is most likely in your ESC's manual, on their website, or some such.  Call them up if it's unclear, sometimes they'll be familiar with the programming gotchas and can point you in the right direction.

I'd focus on writing a motor controller API that accepts desired velocity for each tread.  You'll have to fake it in the dead zone, most likely by varying the motor speed so on average it's the speed you want (probably some sort of PID here).  But, your controller should maintain a desired velocity (0%-100% + direction) for each motor until it's handed a new desired velocity.

The high level behaviors just set desired velocity for each tread.  So, a U-turn is any setting where the velocities are equal and opposite; a turn is anything where velocities are unequal but aligned.  Your path planner (or whatever tells the platform where it should go) will be the one to decide how tightly to turn to get wherever it's going (another PID, most likely).


问:
Are inverse kinematics and reinforcement learning competitive techniques?
Are inverse kinematics and reinforcement learning techniques contending techniques to solve the same problem viz. movement of robotic manipulators or arm?

By a glance through the wikipedia article, it appears that inverse kinematics seems to attempt to achieve a solution  as opposed to reinforcement learning which attempts to optimizes the problem. Have I misunderstood anything?

答:
From what I understand of your question, you'd like to know if inverse kinematics and reinforcement learning are trying to solve the same problem in the particular case of robotic manipulation. Of course both of these techniques can be applied outside of this particular realm, but let's focus on robot manipulation for now.

You're right that inverse kinematics is trying to find a solution, although this can be a family of solutions. You'd like to pose the end effector of your manipulator in a particular position and you have to find out the state of the rest of the arm in order to perform the motions that will achieve your goal.

Reinforcement learning is also trying to find a solution to the problem, and it's trying to optimize its solution with respect to a cost function. Imagine, for example, that there's a minimal set of movements that would get your end effector in the required position (e.g. by attaching a cost to actuating each of the manipulator's joints, you could learn the optimal way of achieving your goal with respect to power consumed).

Instead of considering the techniques to be at odds with each other, you could use inverse kinematics to find the family of solutions to your problem and reinforcement learning to search this space and find an optimal solution with respect to some cost/reward criteria of your choosing.

If you're intent on choosing one technique over the other, by posing the reinforcement learning problem as an optimization that rewards, say, how fast you reach the goal state of the end effector, you could still find a solution. However, there's a chance that you'd like to use some notion of the manipulator's kinematics to inform how you search the space of its movements.

ContentLicense: CC BY-SA 3.0


问:
Learning Algorithms for Walking Quadruped
I'm building a 4 legged robot (quadruped) with 3 Degrees of freedom per leg.
The goal of my project is to make this robot able to learn how to walk.
What learning algorithms will I need to implement for it to work?

I'm using an Arduino Uno for the microcontroller.

答:
There is not a specific set of learning algorithms that you will need to implement. Genetic algorithms (GA), neural networks (GA), and reinforcement learning (RL) have all successfully been applied to the problem of gait generation. I can also conceive of ways to use unsupervised learning methods to approach this problem but I can't say for certain whether they would work. Even if they would I'm inclined to think RL is the better approach.

Dr. Hod Lipson talks about using GAs in his TED video entitled Hod Lipson builds "self-aware" robots.

NNs have often been used. A few examples include:

A Distributed Neural Network Architecture for Hexapod Robot Locomotion

Biologically based distributed control and local reflexes improve rough terrain locomotion in a hexapod robot

Application of evolved locomotion controllers to a hexapod robot

A biologically inspired approach to feasible gait learning

I don't know whether RL has been appplied to quadrapeds but there are a number of succesful applications to hexapods.

Free gait generation with reinforcement learning for a six-legged robot

Q-Learning Hexapod

Beware that these lists are by no means comprehensive.

GA and NN would be relatively simple to implement. RL on the other is a more principled way to approached the problem. In all cases you will need more processing power than the Uno offers to actually perform the learning. If you intended to do offline learning then the Uno may work after the learning phase.


问:
How to calculate serial speed and buffer requirements for PC to microcontroller communications?
A common scenario is to have a PC that sends commands to a microcontroller via RS232.  My PC program is sending commands (each of which are composed of multiple bytes) as fast as it can to a small robot.  The microcontroller on the robot is a Parallax Propellor.

I have noticed that if I don't process bytes quickly enough on the microcontroller side of things, it can very quickly overflow the default buffers in the popular serial port drivers that are available for the Propellor. (The buffers are generally anywhere from 16 to 256 bytes).  I can arbitrarily increase these buffers or create my own larger circular buffer, but I would like to have a more methodical approach to determining appropriate size requirements and/or the minimal amount of time I can wait before pulling bytes out of the serial port driver buffer.

At 1st glance:

115200 == 115.2 bits per millisecond == ~12.8 bytes per millisecond (assuming 1 stop bit)

1) Is that a valid way to calculate timing for serial transmissions?

Also, given my specific setup:

PC Program <--> Bluetooth Serial Profile Driver <--> Bluetooth Transceiver <-*-> BlueSMIRF Wireless Modem <--> Parallax Propellor Program

2) What is the maximum amount of data I can send for a given period of time consistently without eventually running in to problems?

Maybe I'm over complicating things, but it seems like there are potentially multiple buffers involved in the transmission chain above.  How do others commonly deal with this? Do they throttle the PC sending to a known safe rate? Implement flow control?  If implementing flow control, how does that affect bandwidth and response times?

(If it matters, my experiment is to use a joystick on the PC to control multiple servos with instant reaction to the joystick movements. So every small movement of the joystick results in multiple commands being sent to the microcontroller. The commands are not just simple positional commands though, they also involve acceleration/deacceleration of servos over time and this is the reason that the microcontroller spends a significant amount of clock cycles before processing new bytes.)

答:
I think the form of your question is wrong.  The problem is not that you've improperly calculated how much data-per-second can be thrown at the microcontroller; it's that you have no way for the microcontroller to indicate its readiness to receive the next command.

To put it another way, if you attempt to solve this problem by precisely calculating how quickly to send data, you will inevitably do one of the following things:

send less data than the microcontroller can handle

send more data than the microcontroller can handle (and in the worst case, it will be only very slightly more so that the buffer takes an hour to overrun and leads you to debug something completely unrelated)

The solution is for your microcontroller to provide feedback -- flow control.  In the most basic example just send back a single character representing command completion (@Rocketmagnet's SpaceWire suggestion would be the most robust, but also heavy handed).

Most likely, you can afford to have a few commands in the buffer.  So, the calculation you should do is to divide your buffer size by the size of the largest command you'll send, then subtract 1 (or more) for safety.  That will tell you the greatest allowable difference between commands sent and acknowledgements received, and will allow you to work at maximum speed by keeping the buffer filled.

Example

Say that your longest possible command is 7 bytes ("fw 4.32") or some such, and that you have a 64-byte buffer.  That means you can fit 9 commands in the buffer ($7 \times 9 = 63 < 64$), but for safety you'll subtract one and only allow 8 commands.  Here's some python psudeocode:

```<code>MAX_UNACKED = 8  # constant, how many un-acked commands to send
unacked = 0      # number of un-acked commands that have been sent
while (true):
    # can send up to MAX_UNACKED commands as we like
    if MAX_UNACKED > unacked:
        send_command()
        unacked = unacked + 1

    # assume that the ack is a single character, we don't care which
    acks = receive_response()      # receive a string of characters
    unacked = unacked - len(acks)  # number of characters = number of acks
</code>```

Note that this psuedocode is an example of spin blocking and that there are better ways to wait for input... but which one specifically will depend on how your PC code works.

Body:
I think the form of your question is wrong.  The problem is not that you've improperly calculated how much data-per-second can be thrown at the microcontroller; it's that you have no way for the microcontroller to indicate its readiness to receive the next command.

To put it another way, if you attempt to solve this problem by precisely calculating how quickly to send data, you will inevitably do one of the following things:

send less data than the microcontroller can handle

send more data than the microcontroller can handle (and in the worst case, it will be only very slightly more so that the buffer takes an hour to overrun and leads you to debug something completely unrelated)

The solution is for your microcontroller to provide feedback -- flow control.  In the most basic example just send back a single character representing command completion (@Rocketmagnet's SpaceWire suggestion would be the most robust, but also heavy handed).

Most likely, you can afford to have a few commands in the buffer.  So, the calculation you should do is to divide your buffer size by the size of the largest command you'll send, then subtract 1 (or more) for safety.  That will tell you the greatest allowable difference between commands sent and acknowledgements received, and will allow you to work at maximum speed by keeping the buffer filled.

Example

Say that your longest possible command is 7 bytes ("fw 4.32") or some such, and that you have a 64-byte buffer.  That means you can fit 9 commands in the buffer ($7 \times 9 = 63 < 64$), but for safety you'll subtract one and only allow 8 commands.  Here's some python psudeocode:

MAX_UNACKED = 8  # constant, how many un-acked commands to send
unacked = 0      # number of un-acked commands that have been sent
while (true):
    # can send up to MAX_UNACKED commands as we like
    if MAX_UNACKED > unacked:
        send_command()
        unacked = unacked + 1

    # assume that the ack is a single character, we don't care which
    acks = receive_response()      # receive a string of characters
    unacked = unacked - len(acks)  # number of characters = number of acks

Note that this psuedocode is an example of spin blocking and that there are better ways to wait for input... but which one specifically will depend on how your PC code works.


问:
What is the difference between 4-point and 8-point connectivity in graph based planning?
In graph-based planning (say, A*), states are connected to their neighbors.  How should one decide whether to connect to the 4 neighbors or the 8 neighbors?  What are the pros and cons of each approach?</p>

答:
Graph-based planning is a simplification of a space (that may be continuous) into the set of possible branching points, each representing the decisions that can be made.  In a pure simulation, that simplification usually goes as far as working in terms of steps instead of distance or time.  So, restricting movement to the 4 cardinal directions would be the correct choice because you'd want all the distances to be equal.

For a simulation with diagonals, it should still work -- provided that you adjust your algorithm so that diagonal step costs $\sqrt 2$ times more than the vertical/horizontal steps (which pushes you back in the direction of a continuous space, difficult to simulate).  But it might make more sense to just adopt a hexagonal grid if you want more ways to move between squares.  (For more discussion on grid types and their algorithms, see http://www-cs-students.stanford.edu/~amitp/game-programming/grids/)

Example 1

You have a car-style robot -- front-wheel steering.  You might represent 3 possible branches from each state: turn left, go straight, and turn right.  In this case, a hexagonal grid would make the most sense; at every space, only 3 of the 6 neighbors would be valid and exactly which ones would depend on the direction you came from.  This would reflect reality more than a cardinal-directions grid because to reach the space to your immediate right (or left) would require a U-turn over a few extra spaces.

Example 2

You have a gantry robot -- X and Y actuation.  In this case, both motors can be active at once, so moving diagonally "costs" the same as moving vertically or horizontally.  The 8-neighbor square grid would be correct.

Example 3

You are simulating a large room with some objects that move.  If you allow diagonal movement, you lose the ability to use an integer for the time component -- things would end up only partway between squares.  The 4-neighbor square grid would be correct.


问:
What are good strategies for tuning PID loops?
Tuning controller gains can be difficult, what general strategies work well to get a stable system that converges to the right solution?

答:
In contrast to the other two answers I'd say a good manual way of tuning a PID is ignoring the Kd. So start at 0 and increase Kp until you are getting to the target, then increase Ki to get rid of steady state error.

Kd can confuse the issue as it responds poorly to noise, then you start adding filters on your analog input and then question what that does besides slow down your control and make the whole thing harder to work out...

Another thing bound to confuse me is if the PID equation is in the standard form or in an independent (parallel in wikipedia) form. The effect of Ki seems to inverse when the form is the wrong way to what you think it is. Both types are used in automation, sometimes with the option to switch between them.


答:
Instead of calculating the speed requirement (which may vary from time to time/comp to comp and whenever you change the code), there are some other things you can do:

Have your μC request input by sending interrupts to the master device (in this case, it's a PC--you may not need to use interrupts, just keep a port reserved). You can either have the master device buffer the outputs (easier to do that with a pc--effectively unlimited buffering), or you can just discard them unless necessary.

With your scenario, it's better to get rid of buffering entirely. Accept the inputs to the  μC via the interrupt pin. Have some flag variable that basically says "need input" on the μC. If this flag is set, the  μC will accept the input. Otherwise, it will just discard it. This way, all the input is rapidly consumed (keeping buffers free), but not all is used. For efficiency, adjust the timing to the approximate baud of the entire setup. Instead of discarding it, you may wish to code your own buffer-type thing--have a small array in which a few inputs are stored. Now, you have gotten rid of all the upstream buffers, and have a single "artificial" buffer on the μC--over which you have complete control.

It may be better to keep all computations on the pc and use the μC as a simple slave controller--give it simple motion/position commands that can be piped directly to the motors. If you have enough interrupt pins/interrupt MUXing, you may want to send these commands via interrupts for faster response.

Title: How to calculate serial speed and buffer requirements for PC to microcontroller communications?

Body:
A common scenario is to have a PC that sends commands to a microcontroller via RS232.  My PC program is sending commands (each of which are composed of multiple bytes) as fast as it can to a small robot.  The microcontroller on the robot is a Parallax Propellor.

I have noticed that if I don't process bytes quickly enough on the microcontroller side of things, it can very quickly overflow the default buffers in the popular serial port drivers that are available for the Propellor. (The buffers are generally anywhere from 16 to 256 bytes).  I can arbitrarily increase these buffers or create my own larger circular buffer, but I would like to have a more methodical approach to determining appropriate size requirements and/or the minimal amount of time I can wait before pulling bytes out of the serial port driver buffer.

At 1st glance:

115200 == 115.2 bits per millisecond == ~12.8 bytes per millisecond (assuming 1 stop bit)

1) Is that a valid way to calculate timing for serial transmissions?

Also, given my specific setup:

PC Program <--> Bluetooth Serial Profile Driver <--> Bluetooth Transceiver <-*-> BlueSMIRF Wireless Modem <--> Parallax Propellor Program

2) What is the maximum amount of data I can send for a given period of time consistently without eventually running in to problems?

Maybe I'm over complicating things, but it seems like there are potentially multiple buffers involved in the transmission chain above.  How do others commonly deal with this? Do they throttle the PC sending to a known safe rate? Implement flow control?  If implementing flow control, how does that affect bandwidth and response times?

(If it matters, my experiment is to use a joystick on the PC to control multiple servos with instant reaction to the joystick movements. So every small movement of the joystick results in multiple commands being sent to the microcontroller. The commands are not just simple positional commands though, they also involve acceleration/deacceleration of servos over time and this is the reason that the microcontroller spends a significant amount of clock cycles before processing new bytes.)


问:
What useful gaits exist for a six legged robot, and what are their pros and cons?
http://www.oricomtech.com/projects/leg-time.htm lists three gaits:

the tripod

wave, and

ripple.

Can these be improved, or can their relative pros and cons be altered, and are there other gaits worth considering?

答:
Discrete gaits are a very limited way of implementing hexapod motion.

Imagine trying to limit a person to two speeds, walk and run.  In reality we spend a lot of time meandering around with no defined gait or in transitions between various gaits.

There is a reasonable amount of research on insect gaits and the common discrete gaits you read about are essentially what insects settle upon as the optimal solution when spending a long time at a single speed.

A gait can be fully defined by the timings of its return strokes.  In general, going faster requires performing more return strokes in a given amount of time (which is why a tripod gate will be faster than a tetrapod gait which will be faster than a wave/ripple).

I am not an expert in insect locomotion, but my understanding is that each leg independently decides when to return based on a set of simple rules.

As an example, a leg must return when it approaches the end of its stroke.  To avoid having all the legs retract at once, legs are discouraged from performing their return stroke when its neighbours are retracting, or if the leg directly opposite is retracting.

As well, legs are mildly discouraged from retracting when any other leg is retracting so as many legs are on the ground as possible.

It is easy to see that both the tripod and ripple gait obey the above rules but you also get additional gaits and transitions as speed and direction changes.

TL;DR An insect will never use a single gait so if you want optimal creepyness (or efficiency since evolution is pretty good at that) there are a lot of books/papers on how insects walk.

EDIT: There are also a lot of per-leg rules that help traverse rough terrain.  As an example, legs will always try to stand in a spot where a leg has already been (since it knows that place is solid).  A typical insect will place its front legs in areas it knows are secure and all the subsequent legs will only use those locations.


答:
At 1st glance:

115200 == 115.2 bits per millisecond == ~12.8 bytes per millisecond
  (assuming 1 stop bit)

Is that a valid way to calculate timing for
  serial transmissions?

Very simplistically, this is OK - but don't forget any start and parity bits also, and don't forget any protocol overhead along the bluetooth links

Also, given my specific setup:

PC Program <--> Bluetooth Serial Profile Driver <--> Bluetooth
  Transceiver <-*-> BlueSMIRF Wireless Modem <--> Parallax Propellor
  Program

I think it is reasonable to assume that the PC through to the Modem are capable of handling the traffic at 115200 bps, so you can eliminate these from the equation.

However, having multiple hops like this does prevent use of flow-control signals, without introducing response messages... which would slow down response time.

Now, take the worst case, of no protocol overhead, 115200 bps means your Parallax will be receiving a byte every 69us - adding in start, stop or parity bits will slow this rate down a little bit, but assuming worst case gives you some leeway.

This means that your controller has to handle receiving a byte every 69us, as well as doing its normal stuff (calculations etc).

But in reality, you will be sending a message string of (n) bytes, which need to be buffered, and processed as a string - whilst still doing the normal stuff.  Calculating the buffer is an art in itself, but I would normally work on (a minimum of) twice the size of the longest string (if you have the RAM space).  Anything less has the potential for losing messages, if one is not processed before reception of the next commences.

If you are restricted to only the length of the longest message, you need to be 100% sure that you can process that message between the receipt of the last byte, and the receipt of the first byte of the next message. (Obviously less of a problem with smaller messages).


问:
Processor and command interface preference for a robot arm
I want to build a robot arm that'll be approximately 1.25 meter long and will be able to lift up to 2 kilograms. It'll have 6 dof and it is an expensive project. And most importantly, i am the only programmer in this brand new robotics facility of ours. :)

The robot that i want to build will be led by Inverse Kinematics, so with all these parameters and matrices, i think that i'll need a tough processor (Not so sure).

Assuming that my robots control interface will be on an Android tablet, i thought that i also could develop my program for Android, and send necessary commands to the control chip via RS-232 interface.

So, my question is, are standart 1 GHz Android tablets suitable for these tasks? If not, has anybody got an advice for me?

答:
It looks like you are implementing Inverse kinematics(IK) control of robot manipulator for first time. I would suggest you to start of inverse kinematics control program in regular computer. Once you have implemented stable IK control program, you can implement the same same for Android tablet.

Please don't complicate the task which is already complicated! Best way start is to keep building of arm and developing IK control for the arm as separate modules and integrate them once both modules are working properly. For IK control program you can start off with simulated robot arm. Building reliable 6 DoF arm of reach 1.25 meter is definitely not easy job, especially if you are doing it for first time. It would be good idea to start with smaller prototype and later scale it up required size.


答:
This project sounds quite plausible. The question is, where do the servo loops happen? Does it go through the Android Tablet, or just the control chip? What chip is this?

If the servo loops go through the tablet, then be warned that the tablet needs to be able to process that servo loop in good time each cycle. No being late, or missing cycles. No sudden waiting for a WiFi connection, or spending too much time doing voice recognition. It doesn't need to be hard real time (ROS isn't for example) but it should be fairly reliable.

If the servo loop goes only through the control chip, whatever that is, then that would be much better. The tablet would just send demand values to the control chip, and it wouldn't matter so much if these were a bit late or were skipped.

Your robot arm is only 6 degrees of freedom, meaning the Inverse Kinematics function can be solved analytically every control cycle, and will be very fast. 1GHz is actually quite a fast processor. I used to do IK on a 12 DOF simulation in QBASIC on an old 486, and could easily get 30 FPS.

Title: Processor and command interface preference for a robot arm

Body:
I want to build a robot arm that'll be approximately 1.25 meter long and will be able to lift up to 2 kilograms. It'll have 6 dof and it is an expensive project. And most importantly, i am the only programmer in this brand new robotics facility of ours. :)

The robot that i want to build will be led by Inverse Kinematics, so with all these parameters and matrices, i think that i'll need a tough processor (Not so sure).

Assuming that my robots control interface will be on an Android tablet, i thought that i also could develop my program for Android, and send necessary commands to the control chip via RS-232 interface.

So, my question is, are standart 1 GHz Android tablets suitable for these tasks? If not, has anybody got an advice for me?


问:
How to fuse linear and angular data from sensors?
My team and I are setting up an outdoor robot that has encoders, a commercial-grade IMU, and GPS sensor. The robot has a basic tank drive, so the encoders sufficiently supply ticks from the left and right wheels. The IMU gives roll, pitch, yaw, and linear accelerations in x, y, and z. We could later add other IMUs, which would give redundancy, but could also additionally provide angular rates of roll, pitch, and yaw. The GPS publishes global x, y, and z coordinates.

Knowing the robot's x y position and heading will useful for the robot to localize and map out its environment to navigate. The robot's velocity could also be useful for making smooth movement decisions. It's a ground-based robot, so we don't care too much about the z axis. The robot also has a lidar sensor and a camera--so roll and pitch will be useful for transforming the lidar and camera data for better orientation.

I'm trying to figure out how to fuse all these numbers together in a way that optimally takes advantage of all sensors' accuracy. Right now, we're using a Kalman filter to generate an estimate of [x, x-vel, x-accel, y, y-vel, y-accel] with the simple transition matrix:

```<code>[[1, dt, .5*dt*dt, 0,  0,        0],
 [0,  1,       dt, 0,  0,        0],
 [0,  0,        1, 0,  0,        0],
 [0,  0,        0, 1, dt, .5*dt*dt],
 [0,  0,        0, 0,  1,       dt],
 [0,  0,        0, 0,  0,        1]]
</code>```

The filter estimates state exclusively based on the accelerations provided by the IMU. The IMU isn't the best quality; within about 30 seconds it will show the robot (at rest) drifting a good 20 meters from its initial location. I want to know out how to use roll, pitch, and yaw from the IMU, and potentially roll, pitch, and yaw rates, encoder data from the wheels, and GPS data to improve the state estimate.

Using a bit of math, we can use the two encoders to generate x, y, and heading information on the robot, as well as linear and angular velocities. The encoders are very accurate, but they can be susceptible to slippage on an outdoor field.

It seems to me that there are two separate sets of data here, which are difficult to fuse:

Estimates of x, x-vel, x-accel, y, y-vel, y-accel

Estimates of roll, pitch, yaw, and rates of roll, pitch, and yaw

Even though there's crossover between these two sets, I'm having trouble reasoning about how to put them together. For example, if the robot is going at a constant speed, the direction of the robot, determined by its x-vel and y-vel, will be the same as its yaw. Although, if the robot is at rest, the yaw cannot be accurately determined by the x and y velocities. Also, data provided by the encoders, translated to angular velocity, could be an update to the yaw rate... but how could an update to the yaw rate end up providing better positional estimates?

Does it make sense to put all 12 numbers into the same filter, or are they normally kept separate? Is there already a well-developed way of dealing with this type of problem?

答:
Two things.

If you plan to do mapping, you need a full-fledged Simultaneous Localization and Mapping (SLAM) Algorithm. See: Simultaneous Localisation and Mapping (SLAM):
Part I The Essential Algorithms. In SLAM, estimating the robot state is only half the problem. How to do that is a bigger question than can be answered here.

Regarding localization (estimating the state of the robot), this is not a job for a Kalman Filter. The transition from
$x(t)=[x,y,\dot{x},\dot{y},\theta,\dot{\theta}]$ to $x(t+1)$ is not a linear function due to the
angular accelerations and velocities. Therefore you need to consider
non-linear estimators for this task. Yes, there are standard ways of
doing this. Yes, they are available in literature. Yes, typically all
inputs are put into the same filter. Position, velocity,
orientation, and angular velocity of the robot are
used as outputs. And Yes, I'll present a brief introduction to their
common themes here.   The main take-aways are

include the Gyro and IMU bias in your state or your estimates will
diverge

An Extended Kalman Filter
(EKF) is commonly used for this problem

Implementations can be derived from scratch, and don't generally
need to be "looked up".

Implementaitons exist for most of the localization and SLAM problem, so don't do more work than you have to. See: Robot Operating System ROS

Now, to explain the EKF in the context of your system.
We have an IMU+Gyro, GPS, and
odometry. The robot in question is a differential drive as mentioned.
The filtering task is to take the current pose estimate of the robot
${\hat{x}_t}$, the control inputs $u_t$, and the measurements from
each sensor, $z_t$, and produce the estimate at the next time step
$\hat{x}_{t+1}$. We'll call the IMU measurements $I_t$, GPS is $G_t$, and
odometry, $O_t$.

I assume we are interested in estimating the robot pose as
$x_t={x,y,\dot{x},\dot{y},\theta,\dot{\theta}}$.
The problem with IMU and Gyros is drift. There is a non-stationary
bias in the accelerations which you must account for in the EKF. This
is done (usually) by putting the bias into the estimated state. This
allows you to directly estimate the bias at each time step.
$x_t={x,y,\dot{x},\dot{y},\theta,\dot{\theta},b}$, for a vector of
biases $b$.

I'm assuming:

$O_t$ = two distance measurements representing the distance the
treads have travelled in some small time increment

$I_t$ = three orientation measurements ${\alpha, \beta, \theta}$ and three accelleration
measurements ${\ddot{x},\ddot{y},\ddot{z}}$.

$G_t$ = the position of the robot in the global frame,
$^Gx_t,^Gy_t$.

Typically, the result of the control inputs (desired speeds for each
tread) are difficult to map to the outputs (the change in the pose of
the robot).  In place of $u$, it is common (see Thrun, Odometry Question) to use the
odometry as the "result" of the control. This assumption works well
when you are not on a near-frictionless surface. The IMU and GPS can
help correct for slippage, as we'll see.

So the first task is to predict the next state from the current state:
$\hat{x}_{t+1} = f(\hat{x}_t,u_t)$. In the case of a differential
drive robot, this prediction can be obtained directly from literature
(see On the Kinematics of Wheeled Mobile Robots or the more concise treatment in any modern robotics textbook), or derived from scratch as shown here: Odometry Question.

So, we can now predict $\hat{x}_{t+1} = f(\hat{x}_t, O_t)$. This is
the propagation or prediction step. You can operate a robot by simply
propagating. If the values $O_t$ are completely accurate, you will
never have an estimate $\hat{x}$ which does not exactly equal your
true state. This never happens in practice.

This only gives a predicted value from the previous estimate,
and does not tell us how the accuracy of the estimate degrades with
time. So, to propagate the uncertainty, you must use the EKF equations
(which propagate the uncertainty in closed form under Gaussian noise
assumptions), a particle filter (which uses a sampling-based
approach)*, the UKF (which uses a point-wise approximation of the
uncertainty), or one of many other variants.

In the case of the EKF, we proceed as follows. Let $P_t$ be the
covariance matrix of the robot state. We linearize the function $f$
using Taylor-series expansion to obtain a linear system. A linear
system can be easily solved using the Kalman Filter. Assume the
covariance of the estimate at time $t$ is $P_t$, and the assumed
covariance of the noise in the odometry is given as the matrix $U_t$
(usually a diagonal $2\times2$ matrix, like $.1\times I_{2\times 2}$).
In the case of the function $f$, we obtain the Jacobian
$F_x=\frac{\partial f}{\partial x}$ and $F_u=\frac{\partial f}{\partial
u}$, then propagate the uncertainty as,

$$P_{t+1}=F_x*P_t*F_x^T + F_u*U_t*F_u^T$$

Now we can propagate the estimate and the uncertainty. Note the
uncertainty will monotonically increase with time. This is expected.
To fix this, what is typically done, is to use the $I_t$ and $G_t$ to
update the predicted state. This is called the measurement step of the
filtering process, as the sensors provide an indirect measurement of
the state of the robot.

First, use each sensor to estimate some part of the robot state
as some function $h_g()$ and $h_i()$ for GPS, IMU. Form
the residual or innovation which is the difference of the
predicted and measured values.
Then, estimate the accuracy for each sensor estimate in
the form of a covariance matrix $R$ for all sensors ($R_g$, $R_i$ in
this case). Finally, find the Jacobians of $h$ and update the state
estimate as follows:

For each sensor $s$ with state estimate $z_s$  (Following wikipedia's entry)

$$v_s=z_s- h_s(\hat{x}_{t+1})$$
$$S_s = H_s*P_{t+1}*H_s^T + R_s$$
$$K = P_{t+1}*H_s^T S^{-1}_s$$
$$\hat{x}_{t+1} = \hat{x}_{t+1} - K*v$$
$$P_{t+1} = (I-K*H_s)*P_{t+1}$$

In the case of GPS, the measurement $z_g=h_g()$ it is probably just a
transformation from latitude and longitude to the local frame of the
robot, so the Jacobian $H_g$ will be nearly Identity. $R_g$ is
reported directly by the GPS unit in most cases.

In the case of the IMU+Gyro, the function $z_i=h_i()$ is an integration of
accelerations, and an additive bias term. One way to handle the IMU is
to numerically integrate the accelerations to find a position and
velocity estimate at the desired time.  If your IMU has a small
additive noise term $p_i$ for each acceleration estimate, then you
must integrate this noise to find the accuracy of the position
estimate.  Then the covariance $R_i$ is the integration of all the
small additive noise terms, $p_i$. Incorporating the update for the
bias is more difficult, and out of my expertise. However, since you are interested in planar motion, you can probably simplify the problem.
You'll have to look in literature for this.

Some off-the-top-of-my-head references:

Improving the Accuracy of EKF-Based Visual-Inertial
Odometry

Observability-based Consistent EKF Estimators for Multi-robot
Cooperative
Localization

Adaptive two-stage EKF for INS-GPS loosely coupled system with
unknown fault bias

This field is mature enough that google (scholar) could probably find
you a working implementation. If you are going to be doing a lot of
work in this area, I recommend you pick up a solid textbook. Maybe
something like Probablistic Robotics by S. Thrun of Google Car fame.
(I've found it a useful reference for those late-night
implementations).

*There are several PF-based estimators available in the
Robot Operating System (ROS). However, these have
been optimized for indoor use. Particle filters deal with the
multi-modal PDFs which can result from map-based localization (am I
near this door or that door). I believe most outdoor
implementations (especially those that can use GPS, at least
intermittently) use the Extended Kalman Filter (EKF). I've
successfully used the Extended Kalman Filter for an outdoor, ground
rover with differential drive.

ContentLicense: CC BY-SA 4.0


问:
How much can working with CNC machines teach you about robotics?
I have built a few simple X/Y/Z CNC machines.  I've learned about G-Code, motor control, firmware and open loop systems.  I see machines like rovers, big dog and factory arms that seem incredibly complex by comparison, yet they don't seem that magical any more.

What are the important skills to pick up from working with CNC machines?  What's the next logical thing to learn?  What things would CNC machines never teach me?

答:
You could think of robotics as being broken down into 3 parts: sensing, decision making, and actuating.  Open loop systems are just the "actuating" part of that picture, and it sounds like you have a good handle on that already from your work with CNC machines.

I think the next area for you to check out would be sensing.  It's not as easy as it looks, and Katy Levinson will explain some of it to you: http://www.youtube.com/watch?v=gFW0schumkE

Not that you need to jump right into sophisticated sensors.  Getting comfortable with sensors (and their limitations, and filtering, and combining separate sensors into a unified world view) could be as simple as using a clock and a light sensor to determine whether it is a cloudy day ouside.

The last thing to check out would be the decision making: how to use the data from the sensors to decide what to do with the actuators.  There are too many possibilities to enumerate here, so it's best to come up with a project idea like "I want to dispense water into my plants when the soil gets too dry" or "I want to close my blinds at night and open them in the morning" or "I want to put a sharpie in my CNC machine and move the table to plot the signal from my phone's accelerometer in realtime".... then use that problem to teach yourself the theory.


答:
How many degrees of freedom do you plan to implement?

I use Arduino Mega for my arm with 4 axis and plan to use simple ARM processor instead it.


问:
What UAV kit(s) would be suitable for a beginner roboticist with programming experience?
I'm really new to robotics, however I am a programmer familiar with several different languages. I don't have a ton of money to spend and I was wondering what is a really good starter kit.

My criteria is for the kit to be inexpensive and powerful, in that its functionality is extensible -- something that would allow the builder to be creative and possibly invent new ways to use it, not just a glorified model kit.

Being extendable to smartphones is a plus.

I'm not looking for something easy or introductory, just something powerful, flexible, and cost effective.

答:
Parrallax offers some products in the space you are looking, but I think what you really want to do is go to hobby king;

http://www.hobbyking.com/hobbyking/store/_657_501__Multi_Rotors_Parts-Flight_Controller.html

make no mistake, they ARE cheap copies of other products, and if that bothers you go back to parallax and spend the full amount. I'd go with the 550 frame with motors, and add speed controlers, and props then

Look at http://store.openpilot.org/ for open source modifiable hardware and software.

hobby king also has a few controllers including an arduino, but I'd prefer the wii if it was me (just personal preference)

This is not a plug and play adventure!! You will at very least end up soldering your own cables, and if you are not comfortable with that, stay clear.


问:
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)?

答:
Simple 3-axis accelerometers will give you an estimate of pitch. However, this will be very noisy, especially when the hand is moving from one pose to another. This is because the direction of acceleration is directly used to estimate the direction of gravity. Thus, this option would only be useful if the hand is not moving.

Gyroscopes allow the direction of gravity to be stabilized. This allows the data to remain useful during movement. Drift/bias is not a problem, so long as you correct for this. This can be done by using a Kalman filter, with a model of gyroscopic drift. The drift is corrected by comparing the derivative of the long term estimate of the direction of gravity compared to the gyroscopic data. Some IMUs correct for drift automatically, for example, the VN-100 from VectorNav.

Magnetometers provides a global estimate of the remaining angular direction (yaw). This simply adds further useful data.

If you only place the IMUs on the fingertips, the data is insufficient to estimate pose. Remember that IMUs only measure attitude (also known as orientation) in space. Can you imagine cases where the fingertip may remain in the same orientation, yet the hand pose is different?

Observe that the index fingertip orientation does not change, however, the position (pose) has changed.

Therefore, you can see that IMU data on the fingertips is not enough to estimate pose. However, additional data can improve the estimate of hand pose, if you fuse the IMU data with your existing data using a Kalman filter.

It is theoretically possible for IMU data alone to be sufficient to estimate pose. However, this would require an IMU for each and every independently movable part of the hand. Since I cannot independently move the top two segments of each finger, we would only need 2 IMUs per finger (one on the fingertip, and one on the segment just after the knuckle, ie. segments 1 and 3 on the finger), plus 2 for the hand, and another for the end of the arm (to get the wrist motion). Therefore, you need a total of 13 IMUs to get all the data required.

I do not know that much about the price of tiny IMUs, however, I would guess that it is not that cheap to get that many IMUs (I don't know your budget). Normally, a single IMU is used for a rigid body. IMUs vary in price (a list at http://damien.douxchamps.net/research/imu/), but say, the VN-100 IMU might be able to give you 0.1 degree accuracy in optimal conditions. If you get a cheaper IMU, the accuracy may not be as good and/or they may lack an integrated Kalman Filter. Getting 13 VN-100 IMUs, costing thousands would probably break the bank (although the VN-100 at 20x20x2mm may not be appropriate if you want an IMU with a smaller form factor).

My suggestion is to consider other data sources which may be obtained more cheaply. For example:

camera-based systems, after image processing, you can get data about the position of different parts of the hand. Image processing can be aided by using some sort of reflective markers.

sensors embedded in the fabric of the glove

strain gauges

SMA wire

...


答: While ronalchn already provided a pretty good answer, I would actually like to take the stance that it should be possible. It would essentially work the same as the full-body tracking devices that XSens is selling. In these applications you perform model fitting, based on the orientation data from your imu. I am not sure how many sensing nodes you would need, but e.g. you could use something like this integrated 6DOF IMU sensor. Using 13 sensors wouldn't be all that implausible anymore, even from a price point of view. I guess you could also do it with just accelerometers, and one full IMU on the wrist, but it would be quite involved. In the end it comes down to the accuracy that you require.</p>

Title: Can I use IMUs to improve the position/posture measurement of fingers in a "data glove"?

Body:
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)?


问:
Mobile robot localization in a known map
I want to localize a mobile robot equipped with a 2D laser scanner in a known indoor environment.  The map is a 2D occupancy grid, but is not perfect.

What algorithms are appropriate for mobile robot localization?

答:
As i have mentioned in this post, it can be achieved with a camera and some markers in known locations on/in the environment as demonstrated here by the robotics team I am in. We use the location of the markers on the desks, which have a known height and width, and the center we can get from the libkoki library. It is then a simple task of using some trigonometry to find out where we are, as demonstrated in this blog post.

Although by Given sensors I assume you don't know what method you are going to use... I'm sure there are other ways of getting your position to varying degrees of accuracy.


答:
If you consider e.g. a robotic arm, the inverse kinematics tell you how to choose the arm's joint angles to move the arm to some position and orientation where you want it to be.

In contrast to determining the forward kinemactics of some mechanism, determining it's inverse kinematics is usually hard and sometimes, there isn't even an analytic solution. Industrial robots, however, are often designed in such a way that they have an analytic solution for the inverse kinematics. This can be achieved by e.g. clever alignment of joint axes.

Reinforcement Learning, on the other hand, is a machine learning technique. Like any other machine learning technique or algorithm, it can be used to determine a function which you don't know - given that you choose a good reward function that is related to the problem you want to solve.

So, in a nutshell: you can use Reinforcement Learning to determine the inverse kinematics of a robot (if there is no analytical solution or determining one would be ridiculously hard).

Title: Are inverse kinematics and reinforcement learning competitive techniques?

Body:
Are inverse kinematics and reinforcement learning techniques contending techniques to solve the same problem viz. movement of robotic manipulators or arm?

By a glance through the wikipedia article, it appears that inverse kinematics seems to attempt to achieve a solution  as opposed to reinforcement learning which attempts to optimizes the problem. Have I misunderstood anything?


问:
Selecting an accelerometer for Deduced Reckoning
I have never used an accelerometer before, but I am aware that they come with I2C, SPI and analog outputs. If I choose to use an I2c or SPI, device, will I accumulate errors due to communication time?

Is the fast sampling of an analog signal likely to get me a more accurate deduced position than using am I2C?

Will this be true for

A robot moving in a room

A robot moving in an outdoor terrain and is likely to slip and roll down a slope.

Also, I have no sense of Gs. I tried to move my hand around fast with my phone running andro-sensor in my fist and saw that the readings saturated at 20m/s2. What G can I expect my robot to experience if it is hit by another fat moving bot or bumped by a fast walking human?

答:
Increasing the sampling frequency of the sensor doesn't improve it's accuracy or precision. That is a feature of the sensor which you usually cannot change. If you try to estimate your position by integrating accelerations alone, you definitely will accumulate error over time, because every sensor is noisy. If you want to use the accelerometers to determine position or velocity, you should combine them with some other sensor that actually measures position (even with lower precision) or velocity. Then, you can combine these different sensor signals with a Kalman filter to obtain a reasonable estimate of where you are and how fast you are moving.

Considering G forces, consider that 1 G is 9.81 m/s^2, which seems a lot to me, in the context of small hobby robots, at least for indoor robots. Outdoor could be a different story, depending on how powerful your engine is. A saturation at 20m/s^2 should be enough.


答:
Particle filters or Monte Carlo localization can be used. Basically you distribute a set of points at random across the maps and see which points would have sensor readings most similar to the reading from your map. The best points survive and you create new points and so forth. After some iterations you have a group of points, hopefully, all in the same place on the map as your robot.

I believe there is a few methods explained in this course.

Title: Mobile robot localization in a known map

Body:
I want to localize a mobile robot equipped with a 2D laser scanner in a known indoor environment.  The map is a 2D occupancy grid, but is not perfect.

What algorithms are appropriate for mobile robot localization?


问:
restricting range of motion with complex constraints
I am looking for a way to restrict a robot's range of motion, using complex constraints such as not tearing of a cable attached to the robot.

Take an articulated 6-axis robot arm as shown below, with attached cable (red), fixed at points X (before axis A4) and Y (after axis A6).

The cable will limit the range of movement for the robot. It can stretch and bend only to some extend, but something like a full 360° turn of axis A4, with all other axes remaining as they are in the picture, will tie the cable around the arm and rip it off.

If joint A5 is at 0°, then A4 and A6 can still move the full 360°, but they cannot diverge too much from each other, as that would twist the cable. If A5 is tilted, the relationship becomes even more complicated.

How can you express such a constraint?

It is not a simple joint constraint, where you can independently limit the range of the joints, and it is also not a positional constraint, where you can define a region the robot must not enter. Checking a start and a goal posture is not sufficient, since along the path from start to goal posture there may still be a posture that puts too much strain on the cable.

Without limiting the robot to a small set of pre-tested paths, how can you limit the robot to movements that will not rip off the cable?

What are the standard techniques used for this sort of problem?

答:
Don't fix it in software. Fix it in your mechanical cable harness design. If you try to do it in software, your robot will inevitably break itself. Even if it never exceeds its limits, using a cable this way will wear it out quickly.

Trying to share the slack between joints will require sliding movement of the cable, which will damage the cable over time by abrasion and by repeatedly bending the cable around tight radii when you get close to overall limits. Sharing the slack means you'll have to attach the cable loosely, which will make it tend to flop around, encouraging you to leave even less slack.

Instead, fix the cable along each segment of the robot and treat each joint individually. Ensure that the cable bend radius is greater than 10X its diameter (more is better) over the entire range of motion of each joint. If this requires a large loop, then there are chain cable guides (looks a bit like wide plastic bicycle chain) to help keep it from getting in the way of other parts.


答:
Think in terms of your control loop speed. A typical fast control loop speed is 1kHz. Some robots use a faster rate, some slower. Usually your control loop speed is higher than you really need it to be.

So each control frame lasts for 1000us. Within this control frame you need to:

Sample your sensors

Perform the control calculations

Send the new outputs to the motors

As long as you can comfortably do all of this within the time frame, you've got no problems. So how long does it take to read the accelerometer? If it's a 3-axis device, using 400kbps I2C, then it might take about 160us to read the data. That leaves you 840us to perform the calculation and update the motors. Even an 8-bit PIC can manage that.

About G forces. During an impact, they can be surprisingly high. For example, how much of a whack do you think it would take to break a hard drive? Probably not that much. Well a hard drive I had recently said it was rated for 75G max acceleration. So expect two robots colliding to produce at least several G. It's impossible to estimate accurately because it depends hugely on the mechanical design of the robots. If they are both completely solid like snooker balls, then you can expect very high accelerations. If they have some kind of flexible shell to them, then this will reduce the acceleration a great deal. But, the question is, do you really need to know the actual value of acceleration during an impact?

Title: Selecting an accelerometer for Deduced Reckoning

Body:
I have never used an accelerometer before, but I am aware that they come with I2C, SPI and analog outputs. If I choose to use an I2c or SPI, device, will I accumulate errors due to communication time?

Is the fast sampling of an analog signal likely to get me a more accurate deduced position than using am I2C?

Will this be true for

A robot moving in a room

A robot moving in an outdoor terrain and is likely to slip and roll down a slope.

Also, I have no sense of Gs. I tried to move my hand around fast with my phone running andro-sensor in my fist and saw that the readings saturated at 20m/s2. What G can I expect my robot to experience if it is hit by another fat moving bot or bumped by a fast walking human?


问:
What is the current state of the Google Self Driving Car Project?
I am aware of the legislation's in Nevada, but what is happening with the technology currently. When is it expected to be commercialized ?</p>

答: Google themselves have suggested that fully self driving cars will not be around for a decade. They have cars that can drive themselves but the entire standard is not there yet. It's difficult to take any risks with this project because it puts so many lives at risk. </p>


问:
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).

答:
As I understand it, the flight control board allows you to control your Quadcopter using a standard 5 or 6 channel RC receiver. So you don't need any other equipment. The radio controller you suggested is 6 channel, so that's plenty. The flight control board just provides stability, as it would be almost impossible for a human to control the speeds of all four motors rapidly enough to keep it stable.

You'll be able to steer the quadcopter using the controller, but won't be able to use GPS or anything clever without adding some more electronics.


问:
What is the best way to power a large number (27) servos at 5 V?
I apologize if this question may sound a little vague. I am working on a robotics project that will contain 27 servos of various sizes and I am having trouble figuring it how they should be powered.

I was hoping to use several (3-6) 5 W 18650 battery boxes to power them, but the smallest motors would use 2.5 W each, so 1 battery box can only power two. The larger servos, obviously, use even more current, so this plan of using a small number of 18650's becomes infeasible.

There is not enough room on the robot for a 12 V car battery, and adding one would require recalculating the sizes of the servomotors that would be needed. Furthermore, I am not sure how to convert the 12 V it gives down to 5 V for the servomotors.

P.S. What about the stall current of the motors? Should the power supply be able to supply the stall current of all the motors it supplies (at the same time) or just the working current? Should I use a fuse to handle when (if?) the servomotors stall? Should I use a fuse or a circuit breaker? Do they make 5 V fuses? If so, where can I get one?

Something like a larger version of the 18650 box would be most preferable.

答:
This problem is a lot like rocket science. With a rocket, the heavier it is, the more fuel they need to lift off which makes it even heavier! You have your servos, but to power them you need a big battery making the robot heavier, this means stronger servos and an even bigger battery! If you can't work out how to power the robot with an onboard battery then prehaps you would have to settle for an off-board power supply.

Hope this helps.


答:
It's always difficult speccing the power supply for a robot, and you've hit the exact problem we all face. Do you spec it to cope with the typical load, or the absolute maximum load when all motors are stalled at max current?

There's no right answer to this, except that whatever happens it shouldn't damage anything. The good news is that the servos probably won't be consuming 2.5W all the time, so a good way to start is to connect your system up to a large power supply with an ammeter and measure the actual current draw under typical heavy use. Once you know the maximum current draw, you can spec the batteries for that.

The other thing you need to decide is how long you want the thing to run for. That will tell you how much battery capacity you need, and therefore the size of the battery. But, as you say, if that means you need a larger battery, then it might mean you need larger servos and more current, and therefore a larger battery! There might be no solution to this problem, except:

Ease your requirements. Accept that the robot won't run as long as you'd hoped.

If possible, add torsion springs to the servos to help them lift the battery weight. This will mean they consume slightly less power.

But what to do in the extreme case where all the motors are stalled?

You might consider something like a Hot Swap controller. This is a little chip which guards the power input to your system. It protects against the large inrush current caused by your system's capacitors. It also protects against over current in general, as well as over voltage.

Title: What is the best way to power a large number (27) servos at 5 V?

Body:
I apologize if this question may sound a little vague. I am working on a robotics project that will contain 27 servos of various sizes and I am having trouble figuring it how they should be powered.

I was hoping to use several (3-6) 5 W 18650 battery boxes to power them, but the smallest motors would use 2.5 W each, so 1 battery box can only power two. The larger servos, obviously, use even more current, so this plan of using a small number of 18650's becomes infeasible.

There is not enough room on the robot for a 12 V car battery, and adding one would require recalculating the sizes of the servomotors that would be needed. Furthermore, I am not sure how to convert the 12 V it gives down to 5 V for the servomotors.

P.S. What about the stall current of the motors? Should the power supply be able to supply the stall current of all the motors it supplies (at the same time) or just the working current? Should I use a fuse to handle when (if?) the servomotors stall? Should I use a fuse or a circuit breaker? Do they make 5 V fuses? If so, where can I get one?

Something like a larger version of the 18650 box would be most preferable.


答:
We have used an older generation of that board in our lab. It takes it's commands via RC which means you would not need another microcontroller. It is only a hover controller however so if you want to do any autonomy you will need another solution.

One possibility is to use an Arduino and an Xbee to replace the RC system and use your computer to control it. We have been doing this in our lab for nearly a year now and it works fairly well.

Another solution is to use an ArduPilot (instead of the aforementioned controller) and communicate directly with it via an Xbee. Again you will use your laptop, desktop, or tablet to control it.

Title: Questions about quadcopter and radio controller

Body:
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).


答:
There's a good, if slightly overly optimistic study done by KPMG and the Center for Automotive Research called Self Driving Cars: the Next Revolution.  You'll be seeing more and more semi-autonomous features within the decade, starting in higher end vehicles (all the major automakers are working on such systems and we already have advanced cruise control and lane departure warning).  However full autonomy is still a fair ways off, for cost as well as perception and institutional/legal issues.  One of the problems with commercializing Google's car is that the sensor systems cost over $250,000 (see http://www.businessinsider.com/google-self-driving-car-sensor-cost-2012-9).  Even with economies of scale, we're a ways off from that system being affordable.

Google's accomplishments are VERY impressive.  They've expanded to more vehicle types and more uses for testing (e.g., commuting to and from Google).  They still don't work in all environments (snow being one issue).

By the way, though, California and Florida have joined Nevada in passing laws regulating experimental use of autonomous vehicles on public roads.

Hope this gives you some info.

Title: What is the current state of the Google Self Driving Car Project?

Body: I am aware of the legislation's in Nevada, but what is happening with the technology currently. When is it expected to be commercialized ?</p>


问:
How do you implement an INS from an accelerometer and (optionally) gyros and a magnetometer?
I'm building a walking robot that will need to know when it moves forward. I'm using on-board intelligence and I plan on using accelerometers, gyros, and magnometers (if needed) to be able to detect if the robot moves forward. The problem is, I dont know how to program an Internal Navigation System or an IMU.  What software algorithms are needed?

To clarify my problem, I need to know how to program the micro controller to read the sensors and be able to tell if the robot has displaced itself forward since a previous measurement.
Also if I used this sensor board (or similar) could I use it to determine the displacement.

答: If you're looking for an inexpensive sensor, you could check out InvenSense's MPU-6000, which combines a 3-axis gyroscope and a 3-axis accelerometer. It communicates via an I2C or SPI bus with your main processor and is capable of estimating attitude when you add a magnetometer.</p>


问:
Tendon longevity
I am thinking of developing a tendon driven robot manipulator for an industrial application that requires a high level of reliability. However, I am aware that tendons in a robot are prone to wear and tear, and failure.

How can I go about selecting a suitable tendon material (steel, kevlar, spectra, etc.) and use it appropriately?

Have any studies been undertaken to examine longevity and failure patterns in robotic tendon materials?

If I were to perform tests on materials myself, how can I perform those tests efficiently, and make best use of the testing time (learn as much as possible about tendon failure in a reasonable length of time).

答:
Robot tendons aren't much different from any other load-bearing cable. The same sources of stress and wear apply: the load tension, bending around pulleys, friction with other objects and friction between its own strands.

Fatigue is much of what limits the life of a cable/wire rope, and both bending stress and abrasion play a role. Each time a section of the cable passes through a pulley or is wound around a drum, it must bend and straighten again. This creates a repeated reversing stress that causes cracks to grow through the material until it breaks (fatigue). Abrasion has a synergistic effect, by roughening the outside of the wires and making it easier for cracks to form. Both the abrasion and bending stresses are greatest at the outside of the cable, so those strands tend to fail first.

It might not even be the cable itself that breaks. Consider an everyday cable actuated mechanism: the window regulator that raises and lowers side windows in an automobile. It's not usually the cable or motor that fails, but rather the pulleys break. The pulleys are usually plastic and only supported on one side, so they're not as strong as the steel cable they're supporting. Sometimes the manufacturers don't even use pulleys, and instead just use a U-shaped plastic channel. Then, the cable slowly saws through the plastic piece. I suppose it only has to outlast the warranty.

Some guidelines for maximum life are:

Keep the diameters of pulleys and winding drums large relative to the cable. 10 times the diameter of the cable is barely enough, and 40 times the diameter of the cable is not too much.

Lubricating the cable helps extend life both by reducing abrasion and by letting the strands slide against each other, making the cable more flexible and reducing bending stress.

Don't neglect the other parts of the system, such as the pulleys the cable wraps around, guides it runs through, and its attachment points.

Don't neglect the environment. Make sure any materials can handle the temperatures and chemicals they may be exposed to. Keep abrasive dust away from anything that moves.

As far as fatigue testing materials goes, there are commercial testing machines for fatigue testing wire and cable, and testing houses that can perform the tests as a service. Actually getting a sample to fail in fatigue can take days at low stress levels, and accelerated (high stress) tests don't map easily across different materials. Narrowing options down based on calculations before testing is a good idea.

References:

Shigley et al. Mechanical Engineering Design, 7th ed. McGraw Hill, 2004 (specifically, chapter 17-6 on Wire Rope)

Wirerope Works Technical Bulletin on Fatigue

Title: Tendon longevity


问:
Up to what force is a servo motor a reasonable choice as an actuator?
I'm working on an application where I need to apply a linear or angular force to operate a linkage mechanism, but I don't (yet) know what amount of force I will need. I anticipate that it will be less than 4.5 kg (44 N). The travel distance on the linkage input should be less than 15 cm.

As I look through available servos, they seem to exist firmly in the scale-model realm of remote control vehicles, and as such I am uncertain if any will be suitable for my application. For example, one of Futaba's digital servos, the mega-high torque S9152, is listed at 20 kg/cm.

From what I understand, this means that at 1 cm from the center of the servo shaft, I can expect approximately 20 kg force. If I wanted 15 cm of travel distance I would need roughly a 10.6 cm radius, which would diminish the applied force to 20 / 10.6 = 1.9 kg, well below the 4.5 that might be required.

Question:

Is my understanding and calculation even remotely accurate? Should I be looking at other types of actuators instead of servos? They seem to become prohibitively expensive above 20 kg/cm torque. (For the purposes of this project, the budget for the actuator is less than $250 US.)

For my application, I'd like to have reasonable control over intermediate positions across the travel range, good holding power, and fairly fast operation. For this reason I have dismissed the idea of using a linear actuator driven by a gearmotor and worm drive.

I am relatively new to robotics in the usage of motorized actuators, but I've used pneumatic cylinders for many years. For this application, I can't use pneumatics.

Edit:

Per comments, some additional constraints that are important:

Linkage Details: The linkage is a planar, one degree-of-freedom, part of a portable system (similar to a scissor lift mechanism). It is for a theatrical effect where the motion is amplified and force reduced (speed ratio and mechanical advantage are < 1).

Power: It will be carried by a person. As such, the actuation needs to be battery-operated, as no tubing or wiring can tether the person. Tubing or wiring that is self-contained is okay. Because this is a portable system, battery-power will be used. The control system will be designed specifically for an appropriate actuator. Rechargeable batteries up to 12V will most likely be employed. Actuators could operate on as high as 24V. Ideally a motor would not exceed 1-2 amperes draw, but as it is not in continuous operation, this is not a hard limit.

Not Pneumatic: I've considered pneumatic actuation, using CO2 cartridges, for example, but the client would prefer not to use pneumatics. Also, the ability to stop/hold at intermediate points in the motion range is desirable, and somewhat more complicated to do with pneumatic actuators.

Speed: An ideal actuator will be able to move the input coupling 15 cm in 1-2 seconds.

Weight: Weight constraints are not well-defined. As it will be carried by a person, it should be moderately lightweight. The actuator itself should probably be less than 1kg, but certainly this can vary. (The rest of the mechanism will probably be 6-8 kg.)

Size: The primary size constraint is that everything must fit within a space measuring no more than 500 x 500 x 120 mm (H x W x D). The linkage mechanism extends from and collapses outside the enclosure, parallel to the width.

Noise: The quieter the better, but noise is the least priority.

Servos seemed like the best choice for the job, but they don't seem to be available with the sort of torque I need.

答:
The motion control parts of this well  documented open sourced project likely suits your specification and cost budget.

It uses mass-produced and widely available 3D printer parts in a re-purposed (different functions) manner.  Stepper motor is sized by a NMEA number. Choose one suits your N.cm specification. also, note the power / current rating of driver.

The scheme is widely scalable. You can use bigger or small motor, gear and belt to achieve a very wide range of force, speed and cost. The scheme (at small size) is widely used in millions of ink jet printers and scanner.

For even higher force, use lead screw.
Google IMAGE for pcb drilling machine. High end unit drive 100kg load, at 0.01mm accuracy and amazing high speed.

https://www.google.com/search?safe=off&hl=en&site=imghp&tbm=isch&source=hp&biw=1824&bih=795&q=pcb+drilling+machine&oq=pcb+drilling+machine&gs_l=img.3..0l3j0i5l3j0i24l4.3081.6630.0.9591.20.18.0.2.2.0.119.1541.15j3.18.0....0...1ac.1.48.img..0.20.1534._cNDl940Wms#hl=en&q=lead+screw&safe=off&tbm=isch

https://www.google.com/search?safe=off&hl=en&site=imghp&tbm=isch&source=hp&biw=1824&bih=795&q=pcb+drilling+machine&oq=pcb+drilling+machine&gs_l=img.3..0l3j0i5l3j0i24l4.3081.6630.0.9591.20.18.0.2.2.0.119.1541.15j3.18.0....0...1ac.1.48.img..0.20.1534._cNDl940Wms

Choice belt or screw.

Large size belt can suit high force. However, it is 'plastic and soft' and cannot support too high acceleration and rapidly changing speed / acceleration / quick start /sudden stop.

Lead screw is all-metal and can support very high acceleration.

Large size NMEA stepper motor should be more than sufficient for your loading. If even higher force is needed, us industrial servo motor, tens to a few thousand watts. Precise angle 1000 to 20000 steps of one revolution. This type is over your stated budget and no need for your stated load.

https://www.google.com/search?safe=off&hl=en&site=imghp&tbm=isch&source=hp&biw=1824&bih=795&q=pcb+drilling+machine&oq=pcb+drilling+machine&gs_l=img.3..0l3j0i5l3j0i24l4.3081.6630.0.9591.20.18.0.2.2.0.119.1541.15j3.18.0....0...1ac.1.48.img..0.20.1534._cNDl940Wms#hl=en&q=industrial+servo+motor&safe=off&tbm=isch

Video
http://www.youtube.com/watch?v=CjzSeOg8oTs

Description
http://cienciaycacharreo.blogspot.com.es/2014/02/new-project-air-hockey-robot-3d-printer.html

Github for design files
https://github.com/JJulio/AHRobot

Build manual
https://docs.google.com/document/d/1SXIIW5MG1uT7O6P6tBWwzjiLe_gj4_Z2HHhHXPehwso/edit?pli=1

Hope this helps


问:
Best microphone for speech recognition tasks
I made several tests with different setups in order to achieve an acceptable speech recognition quality. It works well when I push a button to activate it but now I want it to be automatically activated when a user speaks. This is a big problem, especially when I only use the energy of the audio signal to guess when the user is speaking. That is why I thought about using a headset and not a distant microphone. In a headset the microphone is very close to the users mouth and it is easier to make correct guesses about when the user is speaking. Now my question is if bluetooth sets used with mobile phones also have such a property. They are not long enough and their microphone is not positioned exactly in front of the mouth. Is there a possibility that such devices can also capture some speech/noise from a distant user? Is there a significant difference in the signal energy coming from the user's speech and a 1 meter distant person's speech?</p>

答:
Best audio needs mic be close, not 1 m away.

Consumer grade, 10 to 20 US dollars
http://www.amazon.com/Panasonic-KX-TCA60-Hands-Free-Headband-Cordless/dp/B00007M1TZ/ref=sr_1_6?ie=UTF8&qid=1405009506&sr=8-6&keywords=headset

Professional Audio (stage, TV station, etc.) grade, 200 US dollars
http://pro.sony.com/bbsc/ssr/cat-audio/cat-wiredmics/product-ECM322BMP/

Example for very best audio quality in real action
http://www.ted.com/talks/amanda_palmer_the_art_of_asking

Hope it helps


问:
Designing compatible spur gears for a robot gearbox
I'm trying to increase the torque on the output shaft of my robot's gearbox.  I have a motor with a pinion attached to it with 8 teeth.  I want to create a gear with 33 teeth that will mesh with the pinion that I currently have.  I've got access to a 3D printer to make the gear, but I don't know how to design the second gear so that it will mesh properly.

What parameters do I need to know about the first gear (8 teeth) to ensure that the second gear (33 teeth) will mesh correctly?  How do I translate these parameters into the design of the second gear?

答:
To make compatible gears, you need to match the pitch and shape of the teeth.

First, check out this wiki article about gears and especially the image about nomenclature, so you have a good idea of the names for things:

You first need to determine the pitch of the gear you want to match, the 8-tooth gear. If it has a diameter of say 10 mm, then take the circumference for your new gear (πd = 31.4 mm) and divide by the number of teeth (8) to get a pitch of 3.925 mm. Note that I am using the root circle to calculate diameter, rather than outside circle.

Knowing the pitch, multiply by 33 to get the circumference: 129.525 mm. We can now determine the diameter (d = c / π), 41.25 mm.

You'll need to use the same tooth shape, that is, the angles for the faces and flanks of the teeth, so that the gears mesh well.


问:
I need a software that will help me track passage and identify fish in clear water
I am in charge of studying passage of different species of fish (six species) between lakes in Patagonian Andean range. We've been thinking of deploying video cameras underwater, but we'd need software that would control the cameras and record images only when the video adequately changes so as to avoid having to continuously check the video.

If the software is also capable of recognizing the species that would even be better.

答:
OpenCV, a portable video library for hosted (e.g. Linux, Windows etc) as well as specialized embedded systems (e.g. Raspberry Pi), has been around for decades and has hundreds of books and tutorials written for it.

Use functions to detect:

difference between frame

calculate the size (of fish)

Tune to match size of fish and reduce false alarms

movement of the 'detected block' (fish, as a group of pixels moving in the same direction)

helps avoid false detection due to noise (floating leave, rubbish, etc.)

OpenCV has template matching and can detect different types of objects under good lighting conditions and pose. It may not work too well in natural setting in your case, but you can try and see.

OpenCV is a library, not a ready-made application. It is portable and works well in Linux, Windows and other operating systems. There are many high quality tutorials on the web as well as examples.

In all computer vision projects, the computer itself is only half of what matters. Camera, lighting, etc are very important, too. Select a suitable camera, focal length, lighting, etc to get the best possible image quality. If video is EASILY detected by human, computer may be able to do it (for vision, computer is less able than human, but, works 24 hours).

Raspberry Pi has many "tracking" or "counting" projects, such as detecting new people who have just entered a room (note some such projects use opencv some do not) or passed a line. Some examples from YouTube:

People Counter With OPENCV

Real time vehicle counting and velocity estimation using OpenCV

Learning resources

http://opencv-srf.blogspot.hk/

http://www.stemapks.com/opencv.html

http://videolectures.net/icml2010_bradski_ocv/   [[author of a opencv book]]

There are companies selling complete packages for people/vehicle counting or vehicle classification (e.g. car, truck).

You can search YouTube further for demos such as this:

RIVA IP Cameras - People Counting Supermarket

Hope this helps.


问:
Good method for Retuning a PID After Detecting Oscillation
Given a PID controller with an anti-windup, what are some practical ways to retune the controller once oscillation has been caused and detected? I have access to the magnitude and period of the oscillation.

I don't want to use the Ziegler-Nichols method; rather I'd like a method that allows me to specify a phase/gain margin as I am returning the system.

Could someone recommend me towards a book/article or theory?

答:
I'm am just going to mention the two first approaches that came to my mind when reading about your situation. You can change the behavior of a PID controller by adjusting the Kp, Ki and Kd parameters. For doing so, I suggest:

Evolutionary Programming

Another PID controller (or three, in fact)

In both scenarios you will need to be have some idea of what your ideal response would be, for instance using the gain/phase, the amount of overshoot, the number of oscillations - or similar characteristics - as measurements. I have previously experimented with both options, but never implemented either. Also, I do not know if these methods are actually used in practice for auto-tuning PIDs. Good luck. :)


答:
The main difficulty of using openCV to classify fish underwater involves lighting.  Even in clear water, the amount of available light varies wildly with depth, cloud cover, sun position, etc.  Fish prefer not to advertise their presence to any possible predators, so they've evolved to blend into the water column as much as possible.

That's not to say it's impossible, but keep in mind that you will be looking for some very low-contrast features.

For simply recording video when there is motion, look for a "video motion detector".  These analyze the difference between successive frames of video (with some intelligence built in, in some cases) to decide when to record.

Title: I need a software that will help me track passage and identify fish in clear water

Body:
I am in charge of studying passage of different species of fish (six species) between lakes in Patagonian Andean range. We've been thinking of deploying video cameras underwater, but we'd need software that would control the cameras and record images only when the video adequately changes so as to avoid having to continuously check the video.

If the software is also capable of recognizing the species that would even be better.


问:
Predicting the impact point of a moving object
Suppose we have a moving object (a horizontal projectile motion as one of the most basic examples). Is there any way to predict where it will hit finally? Please note that I'm looking for a machine learning method not a closed form solution.

Although we can track the motion, using Kalman filter, That is only applicable when we want to predict the new future(As far as I'm considered). But I need to predict the ultimate goal of a moving object.

To better express the problem let see the following example:

Suppose a goalkeeper robot that of course uses filtering methods to smooth the ball motion. It needs to predict if the ball is going to enter the goal or not, before it decide to catch the ball or neglect it to go out.

Input data is a time series of location and velocity [x,y,z,v].

答:
Unless you are talking about something higher-order (like learning the behavior of an autonomous agent and predicting how it will move in the future), what you are looking for is to create a simple physics simulator.

It will be closed-form, unless you are asking how to build a system that can "learn" the laws of physics.


答:
Most laptops, cell phones, and conference phones actually use an array of microphones to properly locate the source of the person speaking, and filter out noise that comes from other locations.  This is called "beamforming", used with a "microphone array".

See also: this answer.

Title: Best microphone for speech recognition tasks

Body: I made several tests with different setups in order to achieve an acceptable speech recognition quality. It works well when I push a button to activate it but now I want it to be automatically activated when a user speaks. This is a big problem, especially when I only use the energy of the audio signal to guess when the user is speaking. That is why I thought about using a headset and not a distant microphone. In a headset the microphone is very close to the users mouth and it is easier to make correct guesses about when the user is speaking. Now my question is if bluetooth sets used with mobile phones also have such a property. They are not long enough and their microphone is not positioned exactly in front of the mouth. Is there a possibility that such devices can also capture some speech/noise from a distant user? Is there a significant difference in the signal energy coming from the user's speech and a 1 meter distant person's speech?</p>


问:
Robot interaction language
Is there any well documented robot interaction language? I would imagine something like taking a user's speech in English, parsing it using some natural language processing like NLTK or Stanford NLP and then building a new sentence understandable by the robot. Does something like this already exists?

I recently found ROILA http://roila.org/language-guide/ but it seems like it is a whole different language and not just a reformulation of sentences using English words with less grammatical complexity.

答:
This does exist (or will, both eventually and inevitably).  The most relevant project to what you are talking about is Eugene who recently sort of passed the Turing test.

Update: hopefully non-rotting link with up-to-date information https://en.wikipedia.org/wiki/Eugene_Goostman

Title: Robot interaction language


问:
Tilt-compensated motor output to keep altitude for quadcopter
The propellers of a multicopter produce thrust. Unfortunately the thrust is the smaller, the more the copter is tilted. I was currently wondering whether there is an established method to calculate how much the overall thrust has to be modified to hold the current altitude, based on the current attitude.

This is the way a calculate the motor output so far. rol/pit/yaw-output already ran through the PIDs.

```<code>// Calculate the speed of the motors
int_fast16_t iFL = rcthr + rol_output + pit_output - yaw_output;
int_fast16_t iBL = rcthr + rol_output - pit_output + yaw_output;
int_fast16_t iFR = rcthr - rol_output + pit_output + yaw_output;
int_fast16_t iBR = rcthr - rol_output - pit_output - yaw_output;
</code>```

答:
The thrust vector is given by $f = qRg$ where $q$ is the magnitude of the thrust vector, $R$ is the rotation matrix for the current attitude and $g$ is the gravity vector in world coords, i.e. $[0~0~\pm1]^T$. Expanding $R$ for the ZYX Euler angles usually used for quadrotors, we have

$$\
\begin{align}
R &= \begin{bmatrix}
c_\psi c_\theta  & c_\psi s_\theta s_\phi - c_\phi s_\psi  & s_\psi s_\phi + c_\psi c_\phi s_\theta \\
c_\theta s_\psi  & c_\psi c_\phi + s_\psi s_\theta s_\phi  & c_\phi s_\psi s_\theta - c_\psi s_\phi \\
-s_\theta  & c_\theta s_\phi     & c_\theta c_\phi
\end{bmatrix}
\end{align}
$$
where $\phi$ is the roll angle, $\theta$ is the pitch angle, and $\psi$ is the yaw angle.

For simplicity, assume $\psi=0$ since it doesn't affect the vertical lift force. Multiplying $Rg$ and looking at just the vertical component we have
$$
f_z = q c_\theta c_\phi
\\
q = \frac{f_z}{c_\theta c_\phi}
$$

So just plug in your desired lift force (e.q. mass*gravity) and use your current roll and pitch angles to get the needed total thrust force.


答:
Speech recognition is a pretty vast problem, if you are simply wanting to command a robot using your voice, a lot of ROS users use Pocket Sphinx. You'll have to teach the program all the words, sentences or phrases you want it to recognize, but there are built-in tools that make this easy. It's also straight forward to teach it multiple phrases that mean the same thing, for example: come here, get over here, heel boy, etc. There is a nice example of how to use it in the ROS by Example book if you can get your hands on a copy.

If you're not using ROS, Pocket Sphinx is actually independent of ROS, that link just points to the ROS wrapper, I've never used it outside of ROS.

Title: Robot interaction language

Body:
Is there any well documented robot interaction language? I would imagine something like taking a user's speech in English, parsing it using some natural language processing like NLTK or Stanford NLP and then building a new sentence understandable by the robot. Does something like this already exists?

I recently found ROILA http://roila.org/language-guide/ but it seems like it is a whole different language and not just a reformulation of sentences using English words with less grammatical complexity.


问:
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?

答:
Plan A: get IMU chip and read the raw register data. Read data is easy. Using data is hard.

Plan B: use 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 yaw format.

FreeIMU
http://www.varesano.net/projects/hardware/FreeIMU

(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.

Use Arduino MCU board as it is low cost and has plenty examples.

Hope this helps


问:
Differential Drive Robot Control
Edited: I have a differential drive robot that needs to drive down a hall and stay in the center. I have 4 ultra sonic sensors, 2 on each side. Currently, I thought of implementing pure pursuit and having a lookahead distance etc. but I am not sure if this is the correct approach. I have all the lower level PIDs for motor control working, I just need some help in choosing a path planning algorithm? Will pure pursuit work to my needs? OR do people have any suggestions.</p>

答:
At the foundation of PID control, there is the assumption that the quantity you are measuring (and using to compute your error) has a direct linear relationship with the quantity you are controlling.

In practice, people frequently bend this rule without things going horribly wrong. In fact this resiliency to modeling error--when our assumptions (our "model") do not match exactly to the real system--is one of the reasons PID control is such a popular and commonly used technique.

In your case, what you are measuring is distances between your robot and the walls, and what you are controlling is the speed of your motors. So your question really boils down to "How can we describe a (hopefully) linear relationship between these quantities?"

First off, we have to deal with the fact that we have at least six different numbers floating around (four sensor measurements and at least two motor speeds), when we'd really like to have just one, to make a simple SISO (Single Input Single Output) PID controller.

For the motors, one way we can accomplish that is by choosing to use the difference between the motor speeds as our control quantity. We will have to control overall speed separately, but it makes steering a lot easier this way.

$\omega = R_\text{wheel speed}-L_\text{wheel speed}$

Next, for combining the range sensor inputs we have a number of different options to choose from. Which one is best for a given situation will depend a lot on the geometry of the robot and where the sensors are pointing. For now, let's just assume we can boil it down to a DISTANCE_LEFT and DISTANCE_RIGHT that tells us how far away the walls are on either side. We can then take the difference and use that as our "error" measurement. Minimizing this error makes the distance to either wall equal and keeps us centered in the hall. So far, so good.

error = RIGHT_DISTANCE - LEFT_DISTANCE

Now for the part where we bend the rules. When we chose to use the difference between left and right motor speeds as our control variable, what we were in effect doing is controlling the angular rate of our robot. The relationship between angular rate and us being centered in the hallway goes something like this:

angular rate --> {integration over time} --> robot heading angle -->
  {cosine of heading angle * forward movement speed} --> movement speed
  toward or away from the hallway center --> {integration over time} -->
  robot position in the hallway

Yikes! That does not look linear. What do we do? Well, we can do what all good engineers do when faced with a complex math problem. We approximate. ;)

For example, if the robot is facing in roughly the direction down the hall that we would like it to go, we can make the claim that our robot's heading (for small heading angles) is (approximately) linearly proportional to it's movement speed toward or away from the hallway center. Now we have:

angular rate --> {integration over time} --> robot heading angle -->
  {approx. linear} --> movement speed toward or away from the hallway
  center --> {integration over time} --> robot position in the hallway

Better, but we're not there yet. We still have those integration operations to deal with. This is where it gets complicated. I'll see about filling out this answer more later, but for now I'll say that the reason this PID controller (might) still work has to do with (a.) the integral and derivative terms in the controller and (b.) interaction between the controller and the dynamic equations governing the motion of the robot itself.

Title: Differential Drive Robot Control


答:
Ball catching - which I believe should cover your intention - has been investigated a fair bit in robotics. There is some nice work on this from Udo Frese, which has been demonstrated on DLR's two arm humanoid Justin. They use a multi hypothesis filter to track the ball, and predict the landing [1].

Using the laws of physics will make it easier for you, and you should get a good enough accuracy. I would start out with something that is already working. Using a learning approach you could definitely enhance on the result. You could for example use the difference of your initial prediction with the final result as a signal for a reinforcement learning approach.

[1] Birbach, Oliver, Udo Frese, and B. Bauml. "Realtime perception for catching a flying ball with a mobile humanoid." Robotics and Automation (ICRA), 2011 IEEE International Conference on. IEEE, 2011.

Title: Predicting the impact point of a moving object

Body:
Suppose we have a moving object (a horizontal projectile motion as one of the most basic examples). Is there any way to predict where it will hit finally? Please note that I'm looking for a machine learning method not a closed form solution.

Although we can track the motion, using Kalman filter, That is only applicable when we want to predict the new future(As far as I'm considered). But I need to predict the ultimate goal of a moving object.

To better express the problem let see the following example:

Suppose a goalkeeper robot that of course uses filtering methods to smooth the ball motion. It needs to predict if the ball is going to enter the goal or not, before it decide to catch the ball or neglect it to go out.

Input data is a time series of location and velocity [x,y,z,v].


问:
Stereo camera baseline not needed for calibration?
I am doing stereo camera calibration as described in this blog post. I wonder I do not need to input camera baseline for the calibration. The fact probably goes back to some very basic mathematics of triangulation. Can someone explain?</p>

答: The baseline is an output parameter of the calibration. What the calibration needs to know is the size of your calibration object. How it works is to find the transformation between the two views, and reduce the overall error for multiple views. The transformation is both the rotation and the translation. The translation in this case is the baseline. </p>


问:
Visibility Graph Toolbox for Python
I'm searching for a python toolbox/library to do visibility graph based motion planning. I have searched on the internet, but couldn't find anything. I'm probably missing out...

Is there any package, you can recommend me?

答: The VisiLibity implementation appears to have python bindings.</p>

Title: Visibility Graph Toolbox for Python