问:
How to control the velocity of a mobile robot?
I have a differential drive robot whose linear velocity and angular velocity is to be controlled. The current strategy for doing that is:

A high level path tracking module spits out the reference velocities (linear and angular)

Using the kinematic equations of the differential drive robot, the rpm of each wheel is calculated.

A PID controller is run for each motor which achieves the desired RPM for that motor.

Is this a good strategy for controlling the linear and angular velocity?

It seems like an open loop controller because two separate PIDs are just maintaining the RPMs of individual motors. But the linear and angular velocities seem uncontrolled.

If I want to model a plant whose states are linear velocity and angular velocity, I don't know how to find the dynamics equation for the states (linear acceleration and angular acceleration)

Even if I refer to the data sheet of the motors and get the dynamics right would it make sense to implement such a controller?

What would be the best way to go about this problem of controlling linear and angular velocity of a mobile robot?

答:
The main problem controlling the wheels speed after the kinematics conversion is that you are only controlling the response of the wheels to the setpoint, not the linear velocity response and the angular velocity response. See diagram below.

This way, you will normally have 2 similar PIDs calibrated with the same parameters for controlling the wheels.

Another approach is to have 2 different PIDs for controlling the Linear Velocity (V_comm) and the Angular Velocity (W_comm) commanded from the High-level Path Tracking. Using this, you can calibrate differently the response for the linear and the angular velocities.

To make this work properly, you will need also a Forward Kinematics module to estimate the actual linear velocity and angular velocity from your encoders measurements, and then use this estimation to calculate the error in your 2 PIDs. See diagram below.

With this approach, after calculating the Setpoint for the linear velocity (V_set) and angular velocity (W_set), you can then calculate the speed for every wheel (RPM_set_wheel_1 & RPM_set_wheel_2) with already-known inverse kinematics equations.

Here (Slide 5) you can find the equations for the direct kinematics differential drive.


问:
RC transmitter/receiver for underwater robot
I am working on a project to build a remotely controlled underwater robot. The max depth the robot has to dive is 40cm. I tested the 2.4GHz RC transmitter and receiver and it could work only up to 15cm below water surface, even though not very stable. I googled a lot, but didn't find any proper transmitter and receiver set with minimum 4 channels, in frequency range of less than 100MHz or at 433MHz. Would anyone please suggest where I can find one or how I can assemble one with off-the-shelf modules?</p>

答:
Is the robot going to have an over-the-water antenna?

If not, then electro-magnetic communication is a no-chance under-water, if the water is salty (seas, oceans) or if the distances are long. The underwater communication is usually done with sound (acoustic waves) - which can travel huge distances, thanks to the higher density of water, compared to air.

Here you can find some more information.

More to-the-point information here:

At 1 megahertz the skin effect depth in wet soil is about 5.0 m, in seawater it's about 0.25 m.

It means that in sea water the EM waves will travel no more than 25cm, at 1MHz. The higher the frequency, the shallower the depth.

More formulas here.

Why EM is not the way: Radio-controlled_submarine, unless you have an aerial antenna for the submarine.

If the water is fresh (no dissolved salts) and if the distances are (relatively) short, then the project might have a chance, depending on the specific details.

ContentLicense: CC BY-SA 4.0


问:
Servo motor torque
I am confused with the torque ratings of servo motors, or I guess it is general while choosing any motor.

For example a servo's torque is rated as 10kg-cm, so does that mean it can handle a 100N force from 1 cm distance to its center or 50N force from 2cm distance?

Am i interpreting it right?

If it is right, then consider a motor mounted to the wall from its back and a rope is wrapped to its tip(the rotating part, i don't what it is called); then how should I calculate the maximum weight the motor will be able to lift upwards?

答:
Yes, you are right. 10kg-cm = 100N force from 1 cm distance.
You can use a servo motor with nominal torque force 10kg-cm to lift up 10 kg-cm, but you will most likely damage gears first.

For example, there is a dependency chart of rotation speed (degree) vs load (kg), for KST Servo x10 v2.0 (9.5 kg, 7.4V, 1.2A) https://www.kstsz.com/kstsz_Product_2042526799.html, so you can estimate lifetime for your servo's motor.

Title: Servo motor torque


问:
Making a tunnel follower robot with 2 IR side sensors and 1 ultrasonic sensor
We have a tunnel and the distance from the walls to the robot is about 30cm when the robot is centered, the tunnel curves to the right. The robot has an infrared sensor on its left and one on its right and has an ultrasonic sensor at its front (so basically its eyes). How can I make the robot turn appropriately while its moving so that it's centered in the tunnel. I just need an idea for this algorithm because I can't find any. All what the infrared sensors can do is measure the distance to the walls.</p>

答:
If I understand correctly, all your sensors look ahead, but you want safety to the sides.

Maybe it would be better to turn the IR sensors 90deg so they check the distance to the side walls, while you keep the ultrasound sensor to look ahead.

Using the data from the three sensors, you should be able to create a limited map of the robot inside the tunnel, which will be the basis for controlling the movement.

ContentLicense: CC BY-SA 3.0


问:
rtk-gps faster (60Hz) and cheaper?
The below rtk-gps measures position to about 1.5inches
for $1500 and an update rate of 5Hz on gps, and it measures
12.6mm x 4.6mm so that it would easily fit inside of
a 20mm-diameter tube-shaped rocket-robot.

https://inertialsense.com/product/ins/
https://inertialsense.com/data-sheet/

Do people sell cheaper ones that are faster, say 60Hz instead of 5Hz,
but still meet the above or similar gps-accuracy and still fit inside
a 20mm-diameter tube?  Something in the vicinity of $200-ish or less.

I apologize in advance if this is a "shopping question".
I don't have 'privilege' to post in the 'chat-section'.

答: Something like this? It's pretty close to the dimensions you are searching for 23.5x24.5</p>

Title: rtk-gps faster (60Hz) and cheaper?


问:
How to implement a wall following controller for a TurtleBot3? (ROS - Python)
I want to implement a wall following controller for my TurtleBot3 (with ROS system).

Sensors which I have on the robot: lidar(360) and optional 2 ultrasonic sensors on the side (one on the left and another one on the right).

Can you recommend me ways the break the mission to tasks and how should I do it? (what's my option to choose from in order to complete the mission)

答: Just check out the bug-algorithms like here</p>


问:
Sensors in Collaborative Robots
I'm currently doing some research on collaborative robotics. One area of interest is the type of sensor(s) used in these kind of machines.

I had a look at some robots by FANUC and Universal Robots and I've noticed that they do not come equipped with sensors; they are sold as an add-on.

Is this inherent with collaborative robots? Do customers need to buy sensors as an add-on - which has advantages and disadvantages.

Thanks for your help.

答: I only just saw your comment above and would like to reply. Baxter is a special case because as you say it relys on elastic drives which simply deform when in contact with a human (or anything else). Force sensors are not the answer. When the robot makes contact with a human hand (as probably the most likely interaction) the robot stops, right? Wrong. It decelerates. Newtons 3rd law says so. And that requires further distance. If the hand is trapped, say between the end effector and the bench injury is possible. Calling it a collaborative robot doesn't mean a thing. A French university measured the force of a UR onto a force plate and it raised over 1500N of force. If that is your hand injury is inevitable. We are currently perfecting a capacitive sensor that fits on the arm (not a new idea). If the human gets near the robot (or vice versa) within the deceleration distance the robot stops just in time. So if a robot is not inherently safe (and in my view none of them are apart from Baxter) then the best answer is to add an external sensor or workspace monitor.</p>

Title: Sensors in Collaborative Robots


问:
Gazebo GUI doesn't show up
I tried Gazebo 9 and 10 on Ubuntu 18.04 MATE and it quits in a few seconds without showing Gazebo GUI. I'm running it on 32-bit Intel CPU with 950 Graphics chipset (pretty old). Here is what I see in the terminal:

```<code>paul@paul-tc4400:~$ gazebo --verbose
Gazebo multi-robot simulator, version 10.1.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Msg] Waiting for master.
Gazebo multi-robot simulator, version 10.1.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 192.168.0.6

</code>```

I would appreciate any ideas how to fix or diagnose this issue.

答:
System requirements

Gazebo is currently best used on Ubuntu, a flavor of Linux. You will
  need a computer that has:

A dedicated GPU,

Nvidia cards tend to work well in Ubuntu

A CPU that is at least an Intel I5, or equivalent,

At least 500MB of free disk space,

Ubuntu Trusty or later installed.

You have an incompatible CPU with Gazebo's requirements.

Title: Gazebo GUI doesn't show up


问:
Any alternative to finding singularity of Puma 560 than differentiating the Jacobian and putting the Det=0?
Any alternative to finding singularity of Puma 560 than putting the Jacob Det=0? Also when it says the axes intersect, which axes do they mean? The z? </p>

答: Mathematically you need to set det(J) = 0.  However, you can also visualize “singular planes” of a manipulator.  Check out papers by Stanisic.  Here is one.</p>


问:
Need suggestions for object recognition
I am tasked with creating a system that will recognize fish pulled out of a lake. The system should be able to identify the type of species of fish. Typically, I turn to Arduino for projects like this. However, based on what I've read about image processing, it's sounding like Arduino doesn't have the processing power. Does anyone have any suggestions for development boards and cameras that can easily interface with the board?

I've look at this option, http://www.finboard.org/videos/introducing-finboard?utm_campaign=Embedded%20Processing%20and%20DSP%20Newsletter%2013-Q3%20NA&utm_medium=email&utm_source=Eloqua. It seems like it would be a nice all in one type of thing. Has anyone used anything like this?

Thanks!

答:
The arduino is a pretty versatile piece of kit that can work alongside pretty much anything. I'd look at the fish identification process and work back to the appropriate hardware.

How many possible species of fish are there in the lake? (The more fish, the more memory you'll need, and the more complex your software will be)

Can these species clearly be told apart by size/weight? (If so, you may not necessarily need computer vision at all)

Can the species be told apart simply by colour? (colour averaging will be significantly easier to process than differentiating finer details, less processing power required)

How fast does this recognition need to occur? (imaging processing can be intensive, pick an appropriately fast system)

Does the system need to be entirely self-contained / on-site? (If not, you could save time by sending the image to a remote computer over wireless/3G for processing)

How small are the distinguishing features? (This will determine what camera resolution / number of cameras / lens you will need)

...etc

In terms of computer vision software, OpenCV should be high on your list.

If you have a good understanding of mobile app development, a smart phone could be appropriate (combined camera & computer, cheap, portable, relatively fast), combined with Google's ADK and you could pass resulting commands to actuators.

The list of hardware capable of running image processing software is rather large. Arduinos, Beaglebone/boards, mbeds, FPGAs, RaspberryPi, fitPC, NUCs, full-sized computers (ATX motherboards etc) and beyond. Up to you what works for your application and budget.

Have a look at some of the HD logitech web cams, for the price and resolution they deliver high frame rates and have support across a good few operating systems.

Good luck!

Title: Need suggestions for object recognition


答:
The determinant of the Jacobian will be zero at singularity.  The $j^{th}$ column of the Jacobian (a 6-vector) is the end-effector Cartesian velocity due to unit-velocity motion of the $j^{th}$ joint.  At singularity these column vectors are not independent, if the $k^{th}$ column is some constant multiple of the $j^{th}$ column then this means that the axes of joints $k$ and $j$ are aligned, that is motion of either joint will cause the same end-effector Cartesian motion.

We can illustrate this using the Robotics Toolbox for MATLAB

```<code>>> mdl_puma560   % create a model of a Puma560 robot
>> J = p560.jacob0([0 0 0 0 0 0])  % compute the Jacobian for world coordinate frame

J =

    0.1500   -0.4318   -0.4318         0         0         0
    0.4521    0.0000    0.0000         0         0         0
         0    0.4521    0.0203         0         0         0
         0         0         0         0         0         0
         0   -1.0000   -1.0000         0   -1.0000         0
    1.0000    0.0000    0.0000    1.0000    0.0000    1.0000

>> det(J)

ans =

     0
</code>```

which we see is singular

```<code>>> jsingu(J)
1 linearly dependent joints:
  q6 depends on: q4
</code>```

tells us that joints 4 and 6 are aligned, and we can easily see that columns 4 and 6 of the Jacobian are linearly related, in fact they are identical.

Since two joints control the same Cartesian DoF, and we have 6 joints, then only 5 Cartesian DoF can be controlled independently – the definition of a singularity.

-- Peter Corke, developer of the Robotics Toolbox for MATLAB

Title: Any alternative to finding singularity of Puma 560 than differentiating the Jacobian and putting the Det=0?

Body: Any alternative to finding singularity of Puma 560 than putting the Jacob Det=0? Also when it says the axes intersect, which axes do they mean? The z? </p>

Body:
The determinant of the Jacobian will be zero at singularity.  The $j^{th}$ column of the Jacobian (a 6-vector) is the end-effector Cartesian velocity due to unit-velocity motion of the $j^{th}$ joint.  At singularity these column vectors are not independent, if the $k^{th}$ column is some constant multiple of the $j^{th}$ column then this means that the axes of joints $k$ and $j$ are aligned, that is motion of either joint will cause the same end-effector Cartesian motion.

We can illustrate this using the Robotics Toolbox for MATLAB

>> mdl_puma560   % create a model of a Puma560 robot
>> J = p560.jacob0([0 0 0 0 0 0])  % compute the Jacobian for world coordinate frame

J =

    0.1500   -0.4318   -0.4318         0         0         0
    0.4521    0.0000    0.0000         0         0         0
         0    0.4521    0.0203         0         0         0
         0         0         0         0         0         0
         0   -1.0000   -1.0000         0   -1.0000         0
    1.0000    0.0000    0.0000    1.0000    0.0000    1.0000

>> det(J)

ans =

     0

which we see is singular

>> jsingu(J)
1 linearly dependent joints:
  q6 depends on: q4

tells us that joints 4 and 6 are aligned, and we can easily see that columns 4 and 6 of the Jacobian are linearly related, in fact they are identical.

Since two joints control the same Cartesian DoF, and we have 6 joints, then only 5 Cartesian DoF can be controlled independently – the definition of a singularity.

-- Peter Corke, developer of the Robotics Toolbox for MATLAB


问:
Fusing Multiple Lidars Into 1 Point Cloud
I have a car with 8 lidars, each with a field of view of 60 degrees. My car looks like this

How can I merge all the lidar readings into 1 point cloud?

答:
Find extrinsic between the sensors using a calibration target or any other methods.

Now that you know the relative locations of the sensors, transform the points in each sensor to the first LiDAR coordinate(e.g top left LiDAR in your figure). All the points are merged into the first LiDAR coordinate now.

You need to learn 1. rigid transformation of 3d points, the transformation matrix 2. LiDAR extrinsic calibration.

2 could be difficult if the lidars do not have enough overlap or if you don't have the base knowledge. Request it to the maker if possible.

Not very accurate but ICP could be used to find out the extrinsic which can be found in a point cloud viewer like meshlab or cloud compare. Save scan from all the sensors and load it to the sw above. By aligning using ICP you will have the extrinsic. Save the found extrinsic and next time when you have new point cloud, just apply the same transformation. This could be used only when the LiDARs have enough overlap.


问:
Complementary filter for gyroscope and accelerometer
I am trying to understand how the complementary filter works. I did some research and i found this:

I am confused about the noise and drift before any filter is applied. I have 2 questions:

In the accelerometer, the noise is high frequency signals which is caused by the environment or maybe within the sensor itself. But in the gyroscope, before it is integrated, it should be low frequency noise? Is this the same as drift? Or is the noise causing the drift or vice-versa?

In the figure above, it shows that the angular velocity is a direct data output from the gyroscope without any computation done. So, this data should contain low frequency signals due to environmental impact but is there any drift present?

答:
First I 'll try to answer to your second question.

So from the gyroscope you get the angular velocity (without any computation). The drift is produced when you integrate. To be more clear in each step you integrate from the angular velocities to find the position/movement and an error is produced, as you keep adding these values the error increases over time and at some point it is really big resulting to wrong heading estimation.

For the first question you are right about the accelerometers. They are sensitive to vibration, high frequency noise. But the gyroscopes' main "problem" is the integration, that's where noise is added to the system. You can check out this site for a bit more detailed explanation.


问:
Rotation matrix sign convention confusion.
In rotation matrix, Why do we rotate the first and third rotation in the opposite direction of the 2nd rotation, this is confusing.
Image is attached with this.

In this image we can note that for x and Z rotation non zero elements are same. But for Y rotation sign of sin(theta) changed.

why is so?

答:
The real dig to the sign convention is direction and the way humans like to perceive things orderly or at least using a reference. clockwise and anti-clockwise directions only exist with 2D planes but the inherent nature of man's stubbornness would lead him to create the right-thumb-rule to support the notion of a 3D or 4D clock existing in the nearest future. other than that there is really nothing to it and I'd argue you can decide either of your sins(no pun intended) gets a minus or not(values along the diagonals are always preserved hence cos for any rotation matrix is always positive) because in higher dimensions there is no up or down, left or right except if assigned(with a bias) which is usually because humans are scared they must always be able to represent rotations in this form e.g. rotating a point from left to right or from bottom to top( where $z$ -> top, $x$ -> bottom(left), $y$ -> bottom(right) )

From the diagrams above 2D-perspective anti-clockwise ($XY,YZ,ZX$) and clockwise($YX,XZ,ZY$) rotations can be seen thus  you can be sure that for your rotation matrix needs Rxy = -Ryx, Ryz = -Rzy and Rxz = -Rzx i.e.

$XY$-$plane$-$rotation = - YX$-$plane$-$rotation$,
 $YZ$-$plane$-$rotation = - ZY$-$plane$-$rotation$,
 $XZ$-$plane$-$rotation = - ZX$-$plane$-$rotation$

 which implies they are opposite in direction and as per your taste you can as well decide you want your set of transformations to be e.g. $XY, YZ, XZ$(Rxy,Ryz,Rxz)  instead of the matrices you provided earlier which corresponds to $XY,YZ,ZX$(Rxy,Ryz,Rzx) or by going even further to break all the rules you may decide $YX,ZY,ZX$(Ryx,Rzy,Rzx) is the most suitable for your maximum satisfaction

N.B When it's said that a 3D object is rotated via the z axis this means its plane of rotation was $XY$. I gave a better explanation here


问:
How to extract the servo motors of a Digital Micromirror Device?
The good news is, that modern DLP projectors are sold for a low price. Each of the projectors is equipped with a so called digital micromirror device, which is an MEMS array. It contains millions of pixels, and each of them is realized with two actuators. The actuators are moving physically back and forth and this brings the mirror into the target position which reflects the light.

A movable mirror is the perfect candidate for building a nanorobot, because it was produced already at a low price and doesn't need much energy. Putting two of the actuators together would result into a DIY BEAM robot which can walk forward.

A normal optical microscope can make the servo motor array visible. The problem is, that a manual driven tweezers is too big for handling the tiny motors. What is the appropriate procedure to extract a single micromirror and utilize the MEMS motor in a robot?

答: Mankind does not have such a delicate technology to extract 0.01mm fragile structure from a silicon wafer especially when it is sticked with the rest of the parts firmly. Even if you do it somehow using nanometer accuracy etching devices(the same technology used to make a mems structure), you cannot wire signals properly. I guess the reason why people are not doing this is because fabricating a new mems structure is cheaper and easier (relatively). </p>


问:
Arc welder for 3d printing
Has anybody experimented with GMAW for additive manufacturing? The thing is, welding wire is so much cheaper than ABS or PLA filaments and, well, it is steel you are printing in, not some flimsy plastic! I imagine the arc deposition printhead would be constructed similarly to one used in plastic filament printers, except there is no need for the heating element (so, even simpler). Welding often requires fast Z speed (to finely control the arc) so i think Delta (DeltaMaker) chassis would work best. GMAW calls for some sort of inert gas to insulate heated metal from oxygen. It would make sense to seal off most of the interior of the printer and fill it with heavier than air inert gas during printing.

I would highly appreciate any pointers on existing 3d printer designs employing this deposition method as well as flaws in design i outlined here.

答:
Look at Electron Beam welding technology.  Businesses like Sciaky's Additive Manufacturing have found a niche market by using 3D printing techniques in metal applications.  They have a 2 min video on Youtube

Specifically with GMAW you will want to use a wire with very little manganese and other "cleaner" elements.  This wire will cause the formation of a silica slag (glass) on the top of the weld.  This slag will act as an insulator and prevent the next successive arc on that spot from establishing.

Read the literature that comes with the wire you select.  Often straight CO2 gas will work more economically that an Argon gas mix.  Also factor in temperature / gas expansion when you design your enclosure or consider pre and post flow gas timing when considering your output speed.

Title: Arc welder for 3d printing


问:
Invoking "cmake" failed
I am unable to solve this problem. I tried to run catkin_make command in catkin_ws directory</p>

```<code>yograj@yograj-Inspiron-5537:~/catkin_ws$ catkin_make
Base path: /home/yograj/catkin_ws
Source space: /home/yograj/catkin_ws/src
Build space: /home/yograj/catkin_ws/build
Devel space: /home/yograj/catkin_ws/devel
Install space: /home/yograj/catkin_ws/install
####
#### Running command: "cmake /home/yograj/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/yograj/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/yograj/catkin_ws/install -G Unix Makefiles" in "/home/yograj/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/yograj/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/kinetic
-- This workspace overlays: /opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /home/yograj/anaconda2/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/yograj/catkin_ws/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
ImportError: "from catkin_pkg.package import parse_package" failed: No module named catkin_pkg.package
Make sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH.
CMake Error at /opt/ros/kinetic/share/catkin/cmake/safe_execute_process.cmake:11 (message):
  execute_process(/home/yograj/anaconda2/bin/python
  "/opt/ros/kinetic/share/catkin/cmake/parse_package_xml.py"
  "/opt/ros/kinetic/share/catkin/cmake/../package.xml"
  "/home/yograj/catkin_ws/build/catkin/catkin_generated/version/package.cmake")
  returned error code 1
Call Stack (most recent call first):
  /opt/ros/kinetic/share/catkin/cmake/catkin_package_xml.cmake:74 (safe_execute_process)
  /opt/ros/kinetic/share/catkin/cmake/all.cmake:151 (_catkin_package_xml)
  /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:20 (include)
  CMakeLists.txt:52 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/yograj/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/yograj/catkin_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
</code>```

答:
Execute the following:

```<code><span class="math-container">$ pip install virtualenv
$</span> virtualenv <your name of choice, call it v>
$ source <your name of choice, that is v>/bin/activate
</code>```

Running catkin_make after doing the above worked for me.

Title: Invoking "cmake" failed

Body:
Execute the following:

$ pip install virtualenv
$ virtualenv <your name of choice, call it v>
$ source <your name of choice, that is v>/bin/activate

Running catkin_make after doing the above worked for me.


问:
Homogenous Transformation Matrix for DH parameters
I'm studying Introduction to robotic and found there is different equations to determine the position and orientation for the end effector of a robot using DH parameters transformation matrix, they are :

Example: Puma 560, All joints are revolute

Forward Kinematics:

Given :The manipulator geometrical parameters.

Specify: The position and orientation of manipulator.

Solution:

For Step 4:

for step 3 :Here I'm confused

Here we should calculate the transformation matrix  for each link  and then multiply them to get the position and orientation for the end effector.

I've seen different articles using one of these equations when they get to this step for the same robot(puma 560)

What is the difference between them? Will the result be different? Which one should I use when calculating the position and orientation?

答:
The paper mentioned by @Ben is a good one, but sadly not well known.

There are two different DH conventions in common use:

Standard DH, used in books by Paul, Siciliano et.al., Spong et.al., Corke etc. is defined by parameters $d_j$, $\theta_j$, $a_j$ and $\alpha_j$

Modified DH, used in the book by Craig (which is where I'm guessing your figures come from) is defined by parameters $d_j$, $\theta_j$, $a_{j-1}$ and $\alpha_{j-1}$

All too often articles/papers don't mention which convention is used, which is a pity because the equation for the link transformation matrix is very different in each case.

You list 3 equations at the top of your question:

The first is correct for modified DH parameters

The second and third are not correct for modified DH.  They are somewhat like the equations for standard DH, expect that they should have $a_j$ and $\alpha_j$ not $a_{j-1}$ and $\alpha_{j-1}$.  Where did these come from?

The second and third are equivalent (even if not correct) since you can change the order of a rotation and translation about the same axis.  In general you cannot change the order of transformations in an expression.


问:
PID control while desiring steady state offset
I have a rather niche application of PID control, and I am looking for ideas on how to solve it.

Design

Temperature sensor is externally mounted on a liquid vessel's body --> T_surface

Goal is to control the liquid temperature to a variable setpoint around 35°C --> T_liquid

There are stick-on heaters mounted to the liquid vessel's body --> ability to heat the liquid --> heater_power

The liquid is cooled by just letting the vessel cool down

PID Set Up

I have a PID control algorithm with:

Feedback: T_surface

Output: heater_power

Setpoint: T_liquid

The vessel wall is thick enough that T_surface != T_liquid.

Temperature Offset

The difference in temperature is: dT = T_liquid - T_surface

Note: dT is a function of T_liquid.  For example, if:

T_liquid = ~30°C --> dT = ~1

T_liquid = ~40°C --> dT = ~2

My Implementation

I roughly mapped dT to be linearly related with T_liquid --> offset_value

I set the feedback sensor's value to be T_surface - offset_value. In other words, my input signal is a biased value of the feedback

I tuned my PID loop based on this and it works okay

Question

I realized I am basically trying to tune a PID algorithm to have a steady state offset.  The offset is a function of T_liquid.  Let's assume I know what I want offset to be.  Here are my questions:

How can I tune a PID algorithm to have a steady state offset?

Can you think of a better way to go about this?  (Assume an inability to change the mechanical design)

答:
Feedback control tries to drive the error, reference minus measured value, to zero. However, in your case the output (the temperature of the outside of the tank, denoted with $T_\text{out}$) does not match the quantity the reference is a desired value for (the temperature of the liquid inside the tank $T_\text{in}$). Since you do have an estimated relation between $T_\text{out}$ and $T_\text{in}$, so $T_\text{in} \approx f(T_\text{out})$, with the function $f(\cdot)$ known.

In order to make the system do what you want (let $T_\text{in}$ go to a desired reference value $r$) it might be easiest to define the error, $e$ as the difference between a "desired value" and "measured value" expressed as the same quantity. When expressing both the "desired value" and "measure value" in terms of the internal temperature you could define the error as

$$
e = r - f(y),
$$

with $y$ the measured value of the temperature of the outside of the tank. And $e$ is the signal that you feed into the PID controller. Similarly when expressing both the "desired value" and "measure value" in terms of the external temperature you could define the error as

$$
e = f^{-1}(r) - y,
$$

with $f^{-1}(\cdot)$ meaning the inverse of $f(\cdot)$, so $T_\text{out} \approx f^{-1}(T_\text{in})$.


问:
Definition of robotics manipulator?
I'm new to robotics, I don't understand the way wikipedia defines robotics manipulator. If there is no any direct contact how could the robot move things within his work envelope.

In robotics a manipulator is a device used to manipulate materials
  without direct contact

source robotics manipulator

答: The original manipulators referred to in that article were through-the-wall pantographs which moved radioactive materials without the human operator having direct contact with those materials.  The end effectors of those manipulators did have direct contact with the materials - just not the human.  Although the article is not specific about this, it seems they carry that concept forward for programmable manipulators - that the person doing (or supervising) the task does not engage the product directly.  </p>

Title: Definition of robotics manipulator?


问:
Why 3DR Power Module has two 5v and GND output
Why are there two 5V and GND output in 3DR Power module (https://www.instructables.com/id/Safetly-use-CLONE-APM-Power-Modules/)
(https://www.youtube.com/watch?v=M6OSp05Y5b8).

Can we power up an APM 2.8 with just one pair of 5V and GND from this module.

Also, I would be most grateful if someone could please provide me the detailed circuit diagram (with explanation) of this module for a better understanding of its working.

Thanks in advance.

答:
Dual power and ground pins are on the power module so that two other modules could be powered without having to  split the power cables.

Also, if the attached module draws significant current from the power module, then all of the power pins could be used to keep connector contacts from being overloaded.

As far as the schematic, you need to study the datasheet for the regulator chip that is used in the device.


问:
how to use ROS navigation stack with 4 wheeled robots
I have a 4 wheeled toy car, with 5 motors, one on each wheel and one is used for steering. How can I use ROS navigation stack with this robot since navigation stack is used with differential drive robot?

Is their a way I can map cmd_vel(x,y and theta) of differential drive into my robot?

Thank you

答:
Yes there is. You need to develop or look for the developed equations of velocities that provides the math that transform from the x y theta velocities to the velocities on each of the motors that you have.

The equations are for each configuration and depends also on the separation of the wheels, radius of the wheels and orientation of them and also if there is any gearbox or transmission mechanism.

If you need more specific information of the equations please provide a schematic of the wheel configuration.


问:
Basic robot that responds to a specific sound?
I'm envisioning a "robot" with a capability as simple as flinching a given part of itself upon hearing a particular sound. As someone with zero experience and no clue of anything regarding robotics (as of right now, am excited to learn), I suppose I am asking for somewhere to start. What are ways to have a robot recognize a sound and react to it? I also suppose it would be a very basic robotic-arm reacting to the sound.

I apologize if this is a very general question.

答:
Trying to build and program a robot with zero experience isn't the exception but it's the normal case. Most robotics projects are started with the aim to learn something which is new and to get detailed knowledge about Artificial Intelligence. For getting the maximum learning experience the project goal should be a little more complicated than the user is able to realize. This is equal to create a demanding quest which makes it likely, that the user needs additional knowledge.

The primary question isn't how to solve an existing robot task, for example to react to an audio signal, but how to formalize the challenge. The problem can become static by providing environmental constraints about the robot hardware, for example a certain Arduino kit, and for defining the software task, for example the robot arm should move 4 centimeter backwards (not more) in reaction to a handclap sound.

Carefully defined requirements for a robotic system will make the project much easier. It reduces the space of potential useful literature, reduces the effort to search for existing examples, and allows to identify missing skills. For example, if the task is that the robotarm should react to a handclap sound, but not to clicker sound produced by a dog training device, it's possible to determine if the project was a success or not.


问:
Angular Velocities of CoM in Global Coordinate

The block diagram of the robot is shown as above. Here, $\phi$ is the angle between $X_v$ and $X_0$ (Yaw angle of the robot), and $\psi$ is the angle between $Z_b$ and $Z_v$ (pitch angle of the robot's CoM).

Angular velocities of CoM in global coordinate $X_0, Y_0, Z_0$ are given as

$\Omega_g = [-\dot \phi sin\psi \  \  \dot \psi \ \ \dot \phi cos\psi]$

Whereas, according to my understanding it should be simply

$\Omega_g = [0 \ \  \ \dot \psi \ \  \dot \phi]$

I am pretty sure I am wrong, but I could not figure out how did the authors come up with $\Omega_g = [-\dot \phi sin\psi \  \  \dot \psi \ \ \dot \phi cos\psi]$.

Any help would be really appreciated.

答:
After some search, I am only able to find the geometric solution which makes sense to me. As $\dot \phi$ is the instantaneous angular velocity about $Z_v$ axis, then it has two components on $Z_b$ and $X_b$ axes. Note that $\dot \phi sin \psi$ component is on the negative $X_b$ axis. Finally I get:

$\Omega_g= [-\dot \phi sin\psi \  \dot \psi \  \dot\phi cos\psi]$

as given in the paper.

P.S: If you have a mathematical solution please contribute here. Also, if my solution is wrong let me know.


问:
setting custom variables on catkin workspace environment
I am developing a package for the ROS, in fact, it is a package of resources/models for the Gazebo, and I need with the presence of this package in the Workspace of Catkin to automatically set the variable GAZEBO_MODEL_PATH for this package.

I could intervene in the file ~/catkin_mygazebo_ws/devel/setup.sh, adding the path to a variable, but first I would like to know if there is any way to do it by another more specialized route to Catkin.

答:
I wanted to do a similar thing to point to a custom Python logging ROS configuration file.

From the way I read the documentation you only need to create a .sh script and it should be run by all of the fancier shell environments (e.g. bash with setup.bash).

So I added the following line to CMakeLists.txt for my package:

```<code>catkin_add_env_hooks(logging_env SHELLS sh DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/env-hooks)
</code>```

In the folder env-hooks in my package I added the following file called logging_env.sh:

```<code>#!/usr/bin/env sh

export ROS_PYTHON_LOG_CONFIG_FILE="${CATKIN_ENV_HOOK_WORKSPACE}/share/my_custom_logging_package/config/python_logging.conf"
</code>```

In this particular instance I also had to make sure the file pointed to by the environment variable was available in the installed share directory by also adding the following to CMakeLists.txt. This command copies the whole config directory into the packages share directory:

```<code>install(DIRECTORY config
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
</code>```

Body:
I wanted to do a similar thing to point to a custom Python logging ROS configuration file.

From the way I read the documentation you only need to create a .sh script and it should be run by all of the fancier shell environments (e.g. bash with setup.bash).

So I added the following line to CMakeLists.txt for my package:

catkin_add_env_hooks(logging_env SHELLS sh DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/env-hooks)

In the folder env-hooks in my package I added the following file called logging_env.sh:

#!/usr/bin/env sh

export ROS_PYTHON_LOG_CONFIG_FILE="${CATKIN_ENV_HOOK_WORKSPACE}/share/my_custom_logging_package/config/python_logging.conf"

In this particular instance I also had to make sure the file pointed to by the environment variable was available in the installed share directory by also adding the following to CMakeLists.txt. This command copies the whole config directory into the packages share directory:

install(DIRECTORY config
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)


问:
SLAM techniques based on contact, odometry and one front camera
Consider a mobile robot provided with a contact sensor that randomly travels in a closed environment, changing direction every time an obstacle is encountered. Is it possible to reconstruct the 2D map of the environment (and the location of the robot) using just the contact sensor, an odometer, a compass and one front camera (no lidar, laser and other depth sensors)? What techniques can be used?</p>

答:
There countless implementations for the camera-only methods. Have a look at the following SLAM codes or demo videos.

EKF-SLAM

ORB-SLAM

LSD-SLAM

Structure from motion

VITAMIN-E https://www.youtube.com/watch?v=yfKccCmmMsM

These are all hand-held SLAMs but can be adapted to your case as well. Feature initialization might be a problem but because odometry is available in your case, it won't be a problem.

Some extra sensors like odometer, compass and etc can be integrated in the pipeline. Just add extra cost function to the already existing optimization code(optimization-based ones) or system model(filtering-based ones).


问:
Madgwick or Kalman filter for sensor fusion?
I was looking for some comparison between these two approaches, but couldn't find any.
I am wondering, what are the actual differences in terms of power consumption, accuracy, convergence speed and complexity of implementation and tuning between them?
Why do most quadcopter firmwares use Kalman filtering for sensor fusion?</p>

答:
Make sure you use your duckduckgoing a little harder...finding comparisons between fusion algorithms is pretty easy.

A comparison between Madgwick, Kalman, and Complimentry filters is easy to find.

Reading individual papers for each fusion method will give you specific answers to each method.

Which one is better is mostly depends what you have for sensor data. Madgwick typically uses 9dof sensors, while Kalman algorithms i‘ve seen with 6dof.

Comp filters I‘ve seen with just 2.

Why quads typically use Kalman is anyones guess besides the persons who implemented, however its likely they arn‘t using 9dof sensors, and don‘t bother with madgwick.


问:
Can knowledge of robot's dynamics help in motion planning?
Some planners assume a kinematic model of the robot for example diff drive or omni directional etc. while generating motion plans for the robot. Can knowledge of the dynamics of the robot help generate better motion plans ? If yes, why is this not typically done apart from the difficulty in identifying or coming up with such models ?</p>

答:
Yes it helps but it definitely adds complexity to the planners. Depending on the wheel configuration, how many wheels, the mass of the robot, the moments of inertia, same as the mass of the wheels, moment of inertia of the wheels, and friction as well. All this parameters add more complexity that is hard to generalize. For this reason all these planners assume a robot that follow the specified velocities to a certain accuracy - the low level controllers take care of this part, while the planner acts as a high level controller. </p>

<p>As an extra you can take a look at this video of Disney that improves the trajectory tracking of its animatronics by knowing their dynamic model.
https://www.youtube.com/watch?v=Z1jgaEO9aRs </p>

Body:
Yes it helps but it definitely adds complexity to the planners. Depending on the wheel configuration, how many wheels, the mass of the robot, the moments of inertia, same as the mass of the wheels, moment of inertia of the wheels, and friction as well. All this parameters add more complexity that is hard to generalize. For this reason all these planners assume a robot that follow the specified velocities to a certain accuracy - the low level controllers take care of this part, while the planner acts as a high level controller.

As an extra you can take a look at this video of Disney that improves the trajectory tracking of its animatronics by knowing their dynamic model.
https://www.youtube.com/watch?v=Z1jgaEO9aRs


问:
Inverted pendulum controller
I had an exam yesterday, and I was asked the following question:

Why PID controller is necessary for stabilizing the inverted pendulum on a cart, why not we just use PI or PD?

Now I've seen some papers taking about using PD to stabilize the inverted pendulum, and I couldn't find any mathematical explanation, any help?

答:
Without going into the details of the underlying equations of motion, I could argue that the D part is needed to damp out the oscillations of the pole while reaching for the (unstable) equilibrium point with no overshoots and guaranteeing at the same time sufficient dynamics.

Now, if we consider the context where the equilibrium point is reached but the cart is still accelerating, the only term capable of counteracting the inertial forces on the pole is the integral I, which indeed is the only part delivering effort when we have 0 error. Besides this, the integral is always desirable to compensate for uncertainties in the plant.

To elaborate more, I've found this quite enlighting reference on the dynamics of the cart-pole system.

Essentially, if we linearize the system we get:
$$
\ddot{\theta}=\frac{g}{L}\theta+\frac{u}{ML},
$$
where $\theta$ is the angular displacement of the pole with respect to the equilibrium, $u$ is the force applied to the cart, $M$ is the mass of the cart, $L$ is the length of the pole, and $g$ the gravity acceleration.

Contrary to what I said above, for $\theta=0$ we can obtain the equilibrium $\ddot{\theta}=0$ with $u=0$, thus the integral I is not strictly required. Anyway, we ought to recap that ours is only an approximated linear model; therefore, the I term can help compensate for the unmodeled quantities.

Let's come to the PD part then.

The system is unstable because of the positive eigenvalue $+\sqrt{g/L}$. Hence, we need to find a suitable control law to stabilize it. A full state-feedback controller is proposed in the reference, which is of the form:
$$
u=h_1\theta+h_2\dot{\theta}.
$$
It's easy to demonstrate that for $h_1=-Mg$ and $h_2<0$, the resulting closed-loop eigenvalues are both stable $\lambda_{1,2}=0,h_2/ML$.

To conclude, $u=-Mg\theta+h_2\dot{\theta}$ is nothing but a PD. Actually, this is more properly called a state-feedback controller, but we can clearly see the contributions of the proportional and the derivative parts, although not specified in terms of the error.

Now, let's go back to the I part.

If we don't know precisely the value of the mass $M$ and also we measure $\theta$ with a certain level of accuracy, then $h_1\theta=-Mg\theta$ won't cancel out exactly the term $\left(g/L\right)\theta$ in the dynamics equation. The mismatch between the designed and the real parameters can be tackled by using the integral part I.

Title: Inverted pendulum controller


问:
Teaching AMCL and SLAM
In trying to explain these important concepts and algorithms it would be super useful to have a video or animation that illustrates through simulation the underlying math. All the videos and articles I can find either are purely conceptual and really simplified (i.e. == magic) or they go deep on the math and go over the heads of most of my students.

Does anyone know of a resource (at the level of a https://www.3blue1brown.com/ to teach AMCL and/or SLAM?

答:
There is no resources like 3blue1brown for SLAM. In general I think you just have to bite the bullet and work through the math and the topics. I recommend the Freiburg videos and notes on robot mapping.

In regards to a simulation that allows you to step through it I recommend PythonRobotics. The code examples are quite small and are a good way to see these topics in action with a simple simulation. Since you are interested in ACML there is a basic particle filter implementation.

Title: Teaching AMCL and SLAM


问:
How to calculate battery capacity for my robot system
I am part of a team and we build a robot. I know how many watts all the subsystems of the robot will need and I also know how much time we want to operate it. Our system will need 323.344 Watt and we want to work for 30 min.

I asked a professor to help me and he gave me this formula :

$$C_{bat} = P_{bat}* 1h / ΔSoc$$

$ΔSoc$ told me that is the maximum acceptable Voltage dipping and that I can find this information in the Datasheets.

We decided to use Li-Po batteries but I cannot find datasheet for any Li-Po.

How do you calculate the needed capacity for your project?
How can I calculate it ? Do you know this formula?

答:
30 minutes is half an hour. 323.344 Watts is approximately 324 Watts.

If you want 324 Watts for half an hour, then you want a (324 * 0.5) Watt-hour battery. This assumes, though, that your battery will go from 100% charge to 0% charge after exactly 30 minutes.

Discharging a battery down to a state of charge of 0% can physically damage batteries, preventing them from ever charging again, and the battery voltage will usually fall quite dramatically as the state of charge approaches 0%, so you might wind up browning out your electronics before you actually hit 0%, leaving the last few percent of state of charge uncaptured and thus falling short of your desired 30 minutes of run time.

What might be a better approach would be to assume that you want your batteries sized such that you can supply the full (324*0.5) Watt-hours of capacity when the batteries are discharged from, for example, 80% of full charge down to 20% of full charge. That is, you want:

$$
(0.80 - 0.20) * \mbox{Capacity} = 324*0.5 \mbox{Watt-hours}\\
$$

The difference between your starting and ending state of charge is called, not surprisingly, the change or delta ($\Delta$) state of charge, and you can solve for capacity by:

$$
\Delta \mbox{SOC} * \mbox{Capacity} = (324 * 0.5) \mbox{Watt-hours}\\
$$

$$
\mbox{Capacity} = \frac{324*0.5}{\Delta\mbox{SOC}} \mbox{Watt-hours} \\
$$

In the example I gave, where you are designing your system to supply your desired capacity between 80 and 20 percent of full state of charge, your $\Delta\mbox{SOC} = 0.8-0.2 \boxed{= 0.6} $, so you wind up with a target battery capacity of:

$$
\mbox{Capacity} = \frac{324*0.5}{0.6} \mbox{Watt-hours} \\
\boxed{\mbox{Capacity} = 270 \mbox{Watt-hours}} \\
$$

Remember that $P = IV$, so 270 Watt-hours could be rewritten 270 volt-amp-hours. You can divide your target capacity by the nominal battery voltage to get the actual battery size in amp-hours.


问:
Building a stationary robot. ROS the right tool for me?
I'm wondering if ROS is the right system for me. I'm currently involved in a project which consists of building a device that has the purpose to take spectroscopic measurements using a laser and a spectrometer, controlling servos and reading outputs of many different sensors.

The project involves

Bring the laser to the right spot using a proximity sensor and a servo

Firing the laser and doing a measurement with the spectrometer

Continuously monitor various temperature, vibration, flow etc sensors

The devices are either ethernet connected or send out voltage/current signals. All devices can be communicated to using Python and libraries.

The software will run on a single Linux PC.

From what I gather then ROS should be great for this. F.x. by creating python scripts for each device, which connect to a "mother" script through the publisher/subscriber method.

But before I dive into coding this, it would be great to get someone's opinion on in ROS is the right system for this?

Cross-Post at answers.ros.org

答: ROS is very complex tool. From your description it sound that ROS is a good choice but keep in mind that a ROS project involves a lot of things that can make your project work properly, but it is difficult to learn. Fortunately there is a big community and many good tutorials.  </p>


问:
How to calculate the right needed Power?
Me and my team are building a robot and I need to calculate the Power of the motors. Through my research I found that I must know the needed torque for every motor and then convert it to electrical power.

Is this method correct?
How can I convert the torque to electrical power ?

The reason I ask this is because I found very large numbers for my motors because I am calculating it with MAX Current.

Edit #1:

For example. For this motor MX-106T/MX-106R
http://support.robotis.com/en/product/actuator/dynamixel/mx_series/mx-106.htm
we can see

for Stall Torque 8.0N.m at 11.1V the current is rated at 4.8A , so I just used

\begin{equation}
 P = I*V
\end{equation}

I followed this method for every Motor on my robotic system.
Is this method correct ?

Thank you in advance for your help.

答:
The maximum (or required) torque alone is not enough for sizing a motor, it is one of the factors.

Motor maximum (sometimes refereed to as peak) torque differs from nominal torque. The maximum torque can be exerted by the motor only for a limited amount of time, whereas the nominal torque can be exerted indefinitely. Nominal torque is proportional to nominal current.

Another important factor is the nominal speed (rotational velocity). This defines the speed of the motor which can be exerted indefinitely. It is assumed that the nominal functioning point of the motor is exerting nominal torque while rotating at nominal velocity (both appear simultaneously)

Mechanically, rotational velocity ($\omega$) multiplied by torque ($M$), given to measurement units, $rad/s$ and $Nm$) gives the nominal power of the motor ($P$) in watts.

$P=M \cdot \omega$

This is an important criteria for the dimensioning. Moreover, the same thing can be done for pear velocity and peak torque to get the peak power of the motor, but care must be taken, since the peak velocity is not always required simultaneously with the peak torque, so there is a danger of overdimensioning if the right requirements of the application are not identified.

Even if the torque and velocity of the motor do not match the requirements, since gears and gearboxes or often used (and sold as accessories to the motors) to get to (or near) the desired velocity and torque, given that the power of the motor is greater (or at least equal) then the power requirements of the application.

Please note that this is a simplified explanation of motor sizing. A more exact guide can be found here. This is a guide for ABB brand motors, but it is relevant regardless of chosen brand. The guide includes also information about selecting the right amplifier for the motor which is also crucial.

Selecting the right motor is crucial for any industrial application and there are many electrical, mechanical, control and design criteria which can make or break an application. Please consult a technical sales representative of the chosen motor brand as soon as possible during the development of the application if no experience and know-how is given in the project team.

Furthermore, for robots, safety requirements might be relevant, which can only come from a proper risk analysis of the planned application.


问:
What is telemetry used for?
I'm pretty new to the world of UAS after a ten year holiday from RC flying.

I'm looking at Ardupilot and am wondering what purpose telemetry serves? Is it just to get in flight data back to a ground station or can it also be used to program the system in flight? Are there other capabilities that I am missing?

答:
Telemetry is used to get in-flight data back to a ground station. For example, attitude (roll, pitch, yaw), altitude, GPS position, speed, battery voltages. It just gives you more feedback.

It can also be used to alert you when battery levels are too low or when a fault occurs.

Title: What is telemetry used for?


问:
What is the Control mixer block that is usually found in control schemes?
There is usually a control mixer block in control schemes in robotics. What is it and what is the functionality and where can I read more about it.

Reference to the paper: https://giuseppesilano.net/publications/smc19.pdf

答:
You've got the outputs of the control loops that are trying to maintain altitude, roll, pitch, and yaw, but you need to have a speed reference for the motors.

The control mixer just takes the outputs for each loop and combines them to get the appropriate speed reference.

For example, if your quadcopter were arranged in an X shape, then maybe increasing speed in motors 1 and 2 make positive roll and increasing speed in 3 and 4 make negative roll. Increasing speed in all motors makes positive altitude, so you might get something like:

```<code>motor1 = 0.25*thrust + 0.25*roll;
motor2 = 0.25*thrust + 0.25*roll;
motor3 = 0.25*thrust - 0.25*roll;
motor4 = 0.25*thrust - 0.25*roll;
</code>```

You'd expand that more as appropriate for pitch and yaw, like 1 and 4 versus 2 and 3 for pitch and 1 and 3 versus 2 and 4 for yaw, to get something like:

```<code>motor1 = 0.25*thrust + 0.25*roll + 0.25*pitch + 0.25*yaw;
motor2 = 0.25*thrust + 0.25*roll - 0.25*pitch - 0.25*yaw;
motor3 = 0.25*thrust - 0.25*roll - 0.25*pitch + 0.25*yaw;
motor4 = 0.25*thrust - 0.25*roll + 0.25*pitch - 0.25*yaw;
</code>```

If your quadcopter were arranged in a + shape instead, then maybe 1 and 3 are the only motors that do anything for roll, 2 and 4 are the only motors that do anything for pitch, but then all motors do thrust and yaw, so you might wind up with something like the below instead:

```<code>motor1 = 0.25*thrust + 0.5*roll  + 0.25*yaw;
motor2 = 0.25*thrust - 0.5*pitch - 0.25*yaw;
motor3 = 0.25*thrust - 0.5*roll  + 0.25*yaw;
motor4 = 0.25*thrust + 0.5*pitch - 0.25*yaw;
</code>```

... and so on. The "control mixer" just combines and maps the control signals to the appropriate motors.

Body:
You've got the outputs of the control loops that are trying to maintain altitude, roll, pitch, and yaw, but you need to have a speed reference for the motors.

The control mixer just takes the outputs for each loop and combines them to get the appropriate speed reference.

For example, if your quadcopter were arranged in an X shape, then maybe increasing speed in motors 1 and 2 make positive roll and increasing speed in 3 and 4 make negative roll. Increasing speed in all motors makes positive altitude, so you might get something like:

motor1 = 0.25*thrust + 0.25*roll;
motor2 = 0.25*thrust + 0.25*roll;
motor3 = 0.25*thrust - 0.25*roll;
motor4 = 0.25*thrust - 0.25*roll;

You'd expand that more as appropriate for pitch and yaw, like 1 and 4 versus 2 and 3 for pitch and 1 and 3 versus 2 and 4 for yaw, to get something like:

motor1 = 0.25*thrust + 0.25*roll + 0.25*pitch + 0.25*yaw;
motor2 = 0.25*thrust + 0.25*roll - 0.25*pitch - 0.25*yaw;
motor3 = 0.25*thrust - 0.25*roll - 0.25*pitch + 0.25*yaw;
motor4 = 0.25*thrust - 0.25*roll + 0.25*pitch - 0.25*yaw;

If your quadcopter were arranged in a + shape instead, then maybe 1 and 3 are the only motors that do anything for roll, 2 and 4 are the only motors that do anything for pitch, but then all motors do thrust and yaw, so you might wind up with something like the below instead:

motor1 = 0.25*thrust + 0.5*roll  + 0.25*yaw;
motor2 = 0.25*thrust - 0.5*pitch - 0.25*yaw;
motor3 = 0.25*thrust - 0.5*roll  + 0.25*yaw;
motor4 = 0.25*thrust + 0.5*pitch - 0.25*yaw;

... and so on. The "control mixer" just combines and maps the control signals to the appropriate motors.


问:
Rotating NED to ENU
I have an IMU in NED of which I need to rotate to ENU to conform with ROS. I know its a roll of pi and a yaw of pi/2 but what does this look like mathematically? Below is an example of what I think so far, however, as you can see I need help with a bit. Thanks everyone :)

```<code>new_roll = roll
new_pitch = -pitch
new_yaw = pi/2 - yaw

new_angular_x = ?
new_angular_y = ?
new_angular_z = ?

new_linear_x = ?
new_linear_y = ?
new_linear_z = ?
</code>```

EDIT

```<code>new_roll = roll
new_pitch = -pitch
new yaw = pi/2 - yaw

new_angular_x = angular_x (roll doesn't change?)
new_angular_y = -angular_y
new_angular_z = -angular_z

new_linear_x = linear_x
new_lianer_y = -linear_y
new_linear_z = -linear_z
</code>```

答:
You can google this pretty easily. One of the first links I found is this.

Anyways to answer your questions.

First thing is that the conventions of roll,pitch yaw don't really mean much in this case cause they are fixed to the vehicle. So your code of
 "new_roll=..." doesn't really make sense cause roll is the same no matter what.

The conversion can be easily seen from the convention names. NED=ENU/ which means

North(Roll/X)=East

East(Pitch/Y)=North

Down(Yaw/Z)=Up

```<code>east_ENU=NORTH_NED
north_ENU=EAST_NED
up_ENU=-DOWN_NED
</code>```

Which means

```<code>new_angular_x(EAST_ENU)=old_angular_y(NED_EAST)
new_angular_y(NORTH_ENU)=old_angular_x(NED_NORTH)
new_angular_z(UP_ENU)=-old_angular_z(NED_DOWN)
</code>```

and same thing for the gyroscope data.

Generally I would say it is easier to think of this with rotation matrices. Which allows you to deal with this via multiplication rather than hand coding the swaps yourself.

Title: Rotating NED to ENU

Body:
You can google this pretty easily. One of the first links I found is this.

Anyways to answer your questions.

First thing is that the conventions of roll,pitch yaw don't really mean much in this case cause they are fixed to the vehicle. So your code of
 "new_roll=..." doesn't really make sense cause roll is the same no matter what.

The conversion can be easily seen from the convention names. NED=ENU/ which means

North(Roll/X)=East

East(Pitch/Y)=North

Down(Yaw/Z)=Up

east_ENU=NORTH_NED
north_ENU=EAST_NED
up_ENU=-DOWN_NED

Which means

new_angular_x(EAST_ENU)=old_angular_y(NED_EAST)
new_angular_y(NORTH_ENU)=old_angular_x(NED_NORTH)
new_angular_z(UP_ENU)=-old_angular_z(NED_DOWN)

and same thing for the gyroscope data.

Generally I would say it is easier to think of this with rotation matrices. Which allows you to deal with this via multiplication rather than hand coding the swaps yourself.


问:
Using an accelerometer for position
I have some accelerometers hanging from strings.  I would like to be able to compute the position of the string from the accelerometer reading.

What I think I need to do is:

Compute a transform from the accelerometer at rest in order to normalize my sensor.  I will have gravity so I should be able to know where the z-axis is.

Move the string in a known direction to set x and y.

Read the sensor and apply the transform to factor out the steady-state reading.

Subtract out the effect of gravity.

Integrate to get a position.

Is the integration necessary for position?  I know that one side is fixed.  I should be able to use the magnitude of gravity to determine where the string is if the string is held at a position with some trigonometry, right?

I realize that this a solved problem, but I'm not sure what it falls into. There are some transforms between coordinate systems, robotics, and also probably some physics.

答:
Is the integration necessary for position?

Typically yes, but if the accelerometer is colinear to the string (NOT as you have drawn it!), then you can find the gravity component in your accelerometer output and use that plus the assumption that the string is taught and find your position that way.

For example, if z points up and x points right, then if gravity is all on the negative z-axis then you know the sensor is oriented such that the z-axis is colinear with gravity, so your position is (0, -stringLength). If the z-axis reading is zero and the x-axis reading is negative gravity, then the position is (stringLength, 0).

The components of gravity on each axis will correspond with the angle of the accelerometer and, again, if your accelerometer is colinear with the string then you can determine the angle of the string and thus the position if you assume the string is taught.

The issue, as always with accelerometers, is that you will not get a yaw/heading fix, so you won't be able to tell where on the "cone" you are located, just the cone angle.

Title: Using an accelerometer for position


问:
Public training data for vehicle detectors in computer vision?
This question is to anyone familiar with object (specifically vehicle) detection research.

I'm new to computer vision and am confused about training object detection classifiers. Specifically, the objective is vehicle detection. I've been reading through vehicle detection literature for weeks now, but I'm still a bit confused.

What I'm confused about is evaluation. For the evaluation of a system, the research community usually has a benchmarked dataset which can be used for testing data. But the performance of a system also depends very much on the data that was used to train it, no?

So aren't there any training datasets out there, too? That would make for far more uniform method comparisons. I seem to keep finding papers using benchmarked datasets for evaluation, but making no mention of where they got their training data from.

答: You typically use the same data set (or, rather, parts of it) for training and testing. I. e. you split the data set into a training set and a test set. A common technique for evaluating classifiers in general is called 10-fold cross validation. You split your data set 10 different ways such that 90% of the data is used for training and 10% of the data is used for testing. This way you get 10 different accuracy results, which you can then use to do statistical significance testing to show that your classifier is better than somebody else's.</p>


问:
How to find inverse kinematic equations for a quadruped robot to make it walk?
I have made a model of quadruped robot (sprawling/spider type and not dog type) in V-rep and now I want to make it walk by using creep gait. (i.e moving 1 leg at a time)

As I understand, I have to solve inverse kinematics equations for each leg to move it from one position to another.
How can I find out the inverse kinematics of my quadruped robot?

Is it possible to make the V-rep model of quadruped robot walk without knowing the inverse kinematics equations?
Please help!

答:
On manipulators, Direct Kinematics is the group of equations where, based on the motor's positions (the joint positions, normally in radians), you'll find the spacial (normally Cartesian) pose of the end effector.

Inverse Kinematics, on the other hand, is the process to find which joint positions are necessary to have the end effector on a specific pose in space. They can be analytic solutions based on the arm configuration, or (most commonly) numeric ones (for example, using Newton-Raphson approximation), and it's normal to have multiple solutions for the same position. Besides that, you'll probably need to control the velocity and trajectory of each leg using a task space controller or something like that, where you'll have to learn differential inverse kinematics.

On mobile robots with arms, each individual leg can be viewed as a separate manipulator, so you can calculate the position of each individual leg with the inverse kinematics of each one, in relation to their base, in relation to the robot origin.

To make the robot move smoothly, however, as in a trajectory, you'll have to study the specific kinematic chain of the type of robot you're working (or develop one). It's not an easy or trivial task if you plan to do it right.

V-Rep has the option to take care of the dynamics to a certain point and has tools for inverse kinematics.

Here are some links that you may find useful:

Inverse Kinematics module on V-Rep

Inverse Kinematics and Motion Masterclass

Video and tutorial of Creeping Gait IK

Some articles:

Kinematics analysis and simulation of quadruped robot by Ni Meng and Wang Xiaodong (2011).

Quadruped Robot Creeping Gait Stability Analysis and Optimization Using PSO by Firas A.Raheem and Murtadha Khudhair Flayyih (2017).


问:
Number of inverse kinematics closed form solutions for ABB IRB 140
I've read that 6 dof manipulators give eight closed form solutions, according to a paper. What is the number of iK solutions for the ABB IRB 140? (last three axes intersect but there is a offset between joint 1-2. Does it affect the number of solutions?)
Thanks

https://search-ext.abb.com/library/Download.aspx?DocumentID=3HAC041346-001&LanguageCode=en&DocumentPartId=&Action=Launch&fbclid=IwAR2atlGRywE3gEGu7Or-LGl5_xKxuD6r_MAAIS5EQxEb7MJwwd2hJRmoi7Q

答: The IRB140 has no horizontal shoulder offset as the classical Puma 560 has.  This means that there are not different "lefty" and "righty" solutions.  There is still a possibility of elbow up/down and wrist flip/noflip solutions.  So I think there are, in general, only 4 solutions for this robot.</p>


问:
Robotic arm servo motor- Not enough torque
I require your help regarding a problem I’m encountering.

I am a beginner in robot modelling. I am designing a robotic arm for agricultural use and I am having issues with the motors. I am using Maxon motors however the calculated load torque (including arm weight is larger than stall torque of all the motors within the Maxon catalog).

The robot arm is approximately 8 kgs and is lifting a weight of 12 grams (reach=1 m).

Does anyone know why there may be an issue and if there are any possible solutions?

Will adding another motor in the base half the loads that are applied to each joint? Or should I use gears to increase the output torque?

答: Use gears, adding second one will increase the torque, but it's better to have 1 motor instead of 2. You can also add a gt2 pulley that increases torque decreasing speed. Replacing this motor with a stronger one will also help. If your motor's max speed is too high, I recommend gears or a pulley, so speed won't be too high.</p>


答:
If I understand correctly, your motors do not have enough torque for the given mass distribution in the robot.

There are a few suggestions to handle the issue

Use two motors at joints closed to the base that observe the maximum torque. (I would suggest doing some calculations about maximum torque requirements doubling up the motors). However, there would be challenges with synchronizing the two motors

You can use gears or pulleys or belt mechanisms and shift the motors towards the base of the robot, but they would have slippage and backlash issues. They might also result in speed reduction.

If you have electronics or other mountings increasing the weight of the links, you could shift them closer to the base to reduce torque requirements.

The best approach would be to use new motors with sufficient torques assumed to be efficient at no more than 80% of the catalog rating.

Title: Robotic arm servo motor- Not enough torque

Body:
I require your help regarding a problem I’m encountering.

I am a beginner in robot modelling. I am designing a robotic arm for agricultural use and I am having issues with the motors. I am using Maxon motors however the calculated load torque (including arm weight is larger than stall torque of all the motors within the Maxon catalog).

The robot arm is approximately 8 kgs and is lifting a weight of 12 grams (reach=1 m).

Does anyone know why there may be an issue and if there are any possible solutions?

Will adding another motor in the base half the loads that are applied to each joint? Or should I use gears to increase the output torque?


答:
The robot arm is approximately 8 kgs and is lifting a weight of 12 grams (reach=1 m).

Another solution would be to design the arm to be much lighter. 12 grams does not require an 8kg arm to hold it one metre away. For example, a 30mm carbon fibre tube one metre long weighs 200g, adding a couple of pivots and rods for actuation should still be under half a kilo.

Also, the highest rating for a maxon gearmotor in this list is 120Nm, which would lift your original arm, but the smaller ones are cheaper.


问:
How to get unix/posix time stamp in header of ROS msg?
I am using two sensors each connected to different machine (each machine separately runs Ubuntu 16.04 and ROS Kinetic). When I echo topic on these two machines, I see the time stamps in header of messages are different. Even though they are running at the same time. So I faced issues in synchronizing topics recorded on different machines.

Machine 1:
sec 4583 | nsec 855689180

Machine 2:
sec 1570727234 | nsec 4864000

It seems that the time stamp on machine 1 is based on sim_time. Machine 2 is showing a Posix/Unix time stamp. So on machine 1, I issued the command rosparam set /use_sim_time false. Still when I fire the node on machine 1, time stamp starts from zero which is sim_time.

What I need is to get all time stamps in unix/posix format (10 digit).

P.S. the node running on Machine 1 is OS-1 Lidar Ros Driver

答: The times in your machines are a bit different. Even if you convert the times it is highly possible that you still have the problem of synchronizing these two topics. One way is that look at one of the topics as the main. On the other topic subscribe to the main one and change its time as the main. Or if you are working by these two in a third machine write an interface node for both and set the time as ros::time::now().


问:
Facial Detection combined with Path Planning using Kinect Sensor
I am planning to use a Kinect Sensor on a mobile robot for path planning based on facial detection.

Assuming I am able to detect the faces of 5 individuals in a room (both the environment and the people are static), can I somehow get the coordinates of said faces, and use those as reference points to draw a path the robot should follow (using a Nearest Neighbor algorithm for example) while stopping at those individual points for 5 seconds? Can you indicate me to any resources, papers, or GitHub repositories explaining it? Also, would I need any odometry or can it all be done through Computer Vision?

Note: once detected, the faces' coordinates need to be memorized as there is no guarantee that they will remain visible throughout the entire process.

答: If I understand your question completely it is easy! You are using Kinect, so you have direct distance between the Kinect mounted on your robot and the faces. If you get the robot starting point as <code>(0,0,0)</code> you can find the coordinates based on the distance and the rotation angle of the robot when it finds each faces. </p>

Body: If I understand your question completely it is easy! You are using Kinect, so you have direct distance between the Kinect mounted on your robot and the faces. If you get the robot starting point as (0,0,0) you can find the coordinates based on the distance and the rotation angle of the robot when it finds each faces.


问:
3-RRP manipulator robot
I'm having some issues with a planar manipulator I have to deal with.

The first two moves are rotational and the third one is a prismatic one. The shoulder and elbow move around the X-axis, while the forearm moves forward and backward a distance "a" (d3).

I did all the direct and inverse kinematics, including the Jacobian. I think the third move around x is not done correctly.

Here is a picture about the x-y-z-axis and the DH Table we made:

I've seen an answer about this subject but I can't even understand that one.
On the image you can see there are my two attempts, but neither of them worked for me.

答:
I answered a similar question DH parameters for a PPP arm, take a look for a detailed answer.

If your first joint is the origin, you start the parameters by looking to the next joint. In this case, the last line of the table will give you the parameters of the transformation between the last joint and the end effector.

For your RRP arm, the DH parameters would be

Link 1: d1 = 0, alpha1 = 0, a1 = a1, theta1 = theta1 (variable) (Parameters between joint 2 and 1)

Link 2: d2 = 0, alpha2 = 0, a2 = a2, theta2 = theta2 (variable) (Parameters between joint 3 and 2)

Link 3: d3 = d3, alpha3 = 0, a3 = 0, theta3 = 0 (Parameters between endeffector and joint 3)

Title: 3-RRP manipulator robot


问:
Will a 2.4ghz controller work with a 5.8ghz video transmitter?
I’m building an fpv racing drone and I accidentally ordered a 2.4ghz controller and a 5.8ghz video transmitter. Will they work together?

I have 5.8ghz fpv goggles so I assume they will work.

答:
I am not sure about the details of your setup, but two devices can communicate to each other only if they use the same frequency band(s) and the same (read: matching) signal encoding.

On the other hand, you can use (as example) 2.4GHz for commands and feedback and 5.8GHz for video transmission.


问:
Localize a Mobile Robot on a Mirror
I am currently busy with a project which requires me to construct a robot capable of cleaning a heliostat (movable mirror used to redirect sunlight). Heliostats are basically large flat mirrors that track and reflect the sun. In order to be cleaned, the heliostats would be stowed in a horizontal position so that the robot may drive over its surface.

My question is then how or what sensors would i use to localize the robot on the mirror. From what i have seen many robotic sensors are unable to effectively detect glass, which seems to be a problem as the systems only real reference is the mirror. I am considering using a type of cliff sensor similar to the ones on robotic vacuum cleaners, but how would i localize the robot when its in the middle region of the mirror? Will the cliff sensors and wheel odometers be enough to fully localize this robot or not? i.e. What sensors would work?

I have attached both a basic image of the robot as well as an image of a typical heliostat the robot will need to clean. Mirror sizes may vary but this size is roughly 1m x 2m Please let me know if i must provide more information to clarify the question.

答: You could attach wires to two corners of the surface and mount two motorized spools on the robot so that the wires can be kept under tension. The distances to the two corners define the position of the robot uniquely. The design is very similar to this plotter bot: https://www.youtube.com/watch?v=T0jwdrgVBBc</p>

Title: Localize a Mobile Robot on a Mirror


问:
Can I use experience in Game AI development to develop autonomous driving robots?
Can I use experience in Game AI development to develop autonomous driving robots? How much similar this areas?</p>

答:
Depending on what you mean by experience...While you have been developing GameAI I assume you gained domain specific and domain independent experience:

Theoretical AI knowledge is key to all applications from Game AI to Autonomous Driving, but the knowledge has to be abstract and not domain dependent. Decision making, reinforcement learning, search, symbolic planning are all AI methods for solving domain problems, some of which can apply to autonomous driving also.

Game design experience can be limitedly reused for simulation environment design for autonomous robots.

Managing large datasets is a common trait for all supervised learning applications, I'd imagine there are some stricter rules for handling large datasets for autonomous driving but this experience should be domain independent.

Deployment: I'd guess not, deployment for GameAI, in my opinion is very different from deployment of autonomous driving

Maintenance same as deployment.

This playlist should give you a good intro on autonomous driving and you can see for yourself what part have you experience with already.

EDIT:
Based on your comment below, Search algorithms using navmesh for path finding does not have much in common with autonomous driving. Steering behaviours might come in handy in for implementing driving simulation environments if they can closely reflect reality. Locomotion...again in simulated environments simulated humans have to move around somehow, but this is not directly related to autonomous driving.


问:
D-H parameters for parallel joint axes
If robot has parallel joint axes,the D-H parameters are not unique.So what can we do to deal with this problem? It is very nice for you to answer or recommend some paper and books.
Thank you~

答:
This is an overview of the DH Convention, there is a piece where they discuss having parallel joint axis.

https://www.youtube.com/watch?v=nuB_7BkYNMk

IMO I believe that it is best to choose your parameters for that axis in the best way to get to the next joint, or one that represents the physical bodies best. If you choose a solution that makes it difficult to make the next set of parameters, you're causing headache for yourself in the future. Let me know if that helps.

Title: D-H parameters for parallel joint axes


问:
What is an effective distribution of grayscale sensors on robot
I'm working on a robotics project, and I am using grayscale sensors to automatically follow a black line: turning 90 degrees, going round in a circle, and passing through gaps in the lines etc.  I was wondering what is an effective way to detect the colours and move it through the lines, with five or six grayscale sensors.

Thank you very much.

答:
I recommend arranging your sensors like the following:

```<code>         Thickness of Line
            <-------->             /\
            |        |            /  \
            | *    * |             ||
            |        |             || moving
         *  |        |  *          || direction
            |        |             ||
            | *    * |             ||
            |        |             ||
</code>```

This allows you to detect many conditions.  Let's say the sensors receives 1 if on black area and 0 if on white. Let's look at some of the configurations that may happen and their interpretations. I will use |, -, / and \ to indicate the borders of the actual line:

You are completely lost:

```<code>          0    0

     0              0

          0    0
</code>```

moving on straight line:

```<code>        |        |
        | 1    1 |
        |        |
     0  |        |  0
        |        |
        | 1    1 |
        |        |
</code>```

The line turns right:

```<code>          0    0
        ------------------
     0  |           1
        |
        | 1    1 |--------
        |        |
</code>```

The line turns left:

```<code>          0    0
------------------
     1           |  0
                 |
--------| 1    1 |
        |        |
</code>```

Gap ahead:

```<code>        |________|
          0    0
         ________
     0  |        |  0
        |        |
        | 1    1 |
        |        |
</code>```

Gap behind:

```<code>        |        |
        | 1    1 |
        |        |
     0  |________|  0

          0    0
         ________
        |        |
</code>```

leaning out of the line from the left:

```<code>            |        |
          0/   1    /
          |         |
     0   /         /0 or 1
         |        |
        / 1    1 /
        |        |
</code>```

you are being teased:

```<code>          1    1

     1              1

          1    1
</code>```

There are many other variations you can think of. As one of the examples shows, this also gives you the ability to detect when you are leaning out of the line so you can come back smoothly (without having to turn back on the line sharply). Given this, following the circle shouldn't be a problem at all regardless of whether it's green or black.

Detecting color with grey-scale sensors is possible, but probably not what you are looking for. In your specific case, a value that is far from both 0 and 1 (say from 0.2 to 0.8 or something like that) would depict your color, which is only one. You should still pay attention that if only one of the sensors is showing such a value, for example 0.5, it is likely that you are just going out of the line and it's measuring a half white/half black location.

If you really want to detect the actual color you have to do the following:

Use three grey-scale sensors instead of one at each location.

On each of the three, mount a color filter; one green, one blue and one red. Color filters are as simple as colored transparent pieces of plastic:

Read the three RGB values and convert them to HSL (Hue-Saturation-Lightness).

Base your decisions on the calculated hue. I say only on the hue because the environment lighting very easily changes your observed saturation and lightness so they are not very reliable.

Body:
I recommend arranging your sensors like the following:

         Thickness of Line
            <-------->             /\
            |        |            /  \
            | *    * |             ||
            |        |             || moving
         *  |        |  *          || direction
            |        |             ||
            | *    * |             ||
            |        |             ||

This allows you to detect many conditions.  Let's say the sensors receives 1 if on black area and 0 if on white. Let's look at some of the configurations that may happen and their interpretations. I will use |, -, / and \ to indicate the borders of the actual line:

You are completely lost:

          0    0

     0              0

          0    0

moving on straight line:

        |        |
        | 1    1 |
        |        |
     0  |        |  0
        |        |
        | 1    1 |
        |        |

The line turns right:

          0    0
        ------------------
     0  |           1
        |
        | 1    1 |--------
        |        |

The line turns left:

          0    0
------------------
     1           |  0
                 |
--------| 1    1 |
        |        |

Gap ahead:

        |________|
          0    0
         ________
     0  |        |  0
        |        |
        | 1    1 |
        |        |

Gap behind:

        |        |
        | 1    1 |
        |        |
     0  |________|  0

          0    0
         ________
        |        |

leaning out of the line from the left:

            |        |
          0/   1    /
          |         |
     0   /         /0 or 1
         |        |
        / 1    1 /
        |        |

you are being teased:

          1    1

     1              1

          1    1

There are many other variations you can think of. As one of the examples shows, this also gives you the ability to detect when you are leaning out of the line so you can come back smoothly (without having to turn back on the line sharply). Given this, following the circle shouldn't be a problem at all regardless of whether it's green or black.

Detecting color with grey-scale sensors is possible, but probably not what you are looking for. In your specific case, a value that is far from both 0 and 1 (say from 0.2 to 0.8 or something like that) would depict your color, which is only one. You should still pay attention that if only one of the sensors is showing such a value, for example 0.5, it is likely that you are just going out of the line and it's measuring a half white/half black location.

If you really want to detect the actual color you have to do the following:

Use three grey-scale sensors instead of one at each location.

On each of the three, mount a color filter; one green, one blue and one red. Color filters are as simple as colored transparent pieces of plastic:

Read the three RGB values and convert them to HSL (Hue-Saturation-Lightness).

Base your decisions on the calculated hue. I say only on the hue because the environment lighting very easily changes your observed saturation and lightness so they are not very reliable.


问:
Number of pixel comparison needed to establish correspondence
I am reading the paper titled Variable Baseline/Resolution Stereo David Gallup, Jan-Michael Frahm, Philippos Mordohai, Marc Pollefeys

Section 3 of the paper talks about the time complexity of the standard stereo, within it, subsection for fixed baseline case says the following

In stereo, each pixel must be tested against the pixels along the corresponding epipolar line within the disparity range of the scene. Because the depthrange is defined by the scene, the disparity range is some fraction of the image width, and thus increases with resolution. Letting $D$ be the ratio of the disparity range to the image width ($w$), the number of pixel comparisons needed is

$$T_{fixed} = D~w^2~h = \frac{D~w^3}{a}$$

Here, symbol $a$ is the aspect ratio and $h$ is the height of the image ($h = {w}/{a}$).

We know that the search for correspondence is restricted to epipolar line and thus actual number of comparisons should be way lower than the number given above.

OR

I am missing something?

答:
I am missing something?

Indeed, the context is standard stereo and (all) pixel comparisons ($w\times h$).

In a rectified image, the epipolar line can be typically be about the width of the image. Thus the search range would be $D\times w$.

Thus total number of comparisons = $D\times w \times wh$.


问:
How to implement a wall following controller for a TurtleBot3? (ROS - Python)
I want to implement a wall following controller for my TurtleBot3 (with ROS system).

Sensors which I have on the robot: lidar(360) and optional 2 ultrasonic sensors on the side (one on the left and another one on the right).

Can you recommend me ways the break the mission to tasks and how should I do it? (what's my option to choose from in order to complete the mission)

答:
You can first map the room using any of the mapping or explorer packages on ros.

Save the map.

Use OpenCV to detect walls and corners in the map.

Extract these pixel coordinates to send navigation goals using move_base on ROS.

You won't necessarily need ultrasonic for the purpose, just having the lidar can do the job, but it might be a good addition to avoid accidentally bumping into the wall.


问:
What are good methods for tuning the process noise on Kalman filters?
Most often tuning the Kalman filter noise matrices is done by trial and error or domain knowledge. Are there more principled ways for tuning all the Kalman filter parameters?</p>

答:
In the field of machine learning, we look at a Kalman filter as an inference algorithm on a latent variable model. The measurements are visible, but the true state is hidden. You now want to infer the true states.

As usual, this method relies on a set of parameters and -- in principle -- the way to obtain the best point-estimate for the parameters is to look at the likelihood for the data (given the parameters) and optimising your parameters to obtain the maximum value. This gives you the maximum likelihood estimate.

Unfortunately, in the case of the Kalman filter, this approach is not so easy and intractable to do in closed form. This is because we do not observe the hidden states. Therefore, one has to apply some tricks. One of them is to use the Expecation Maximisation (EM) Algorithm, which is an iterative approach: In the first step, you calculate the most likely value for your hidden states (the expected value) under your current parameters. In the second step, you keep the hidden states fixed and optimise the parameters to obtain the solution with highest likelihood. These steps are repeated until convergence.

You can read up on the general concept of EM in a whole bunch of text books on machine learning (only one example: "Bayesian Reasoning and Machine Learning" by David Barber). The process of inferring the parameters for linear dynamical systems (which gives you the Kalman filter type of model) is well described in a tech report by Zoubin Ghahramani and Geoffrey Hinton.


问:
Do robots usually have databases?
I am a junior web developer working mainly with Bash, Javascript, and Drupal. I'm more fascinated writing scripts and programs that do certain concrete actions instead of querying and manipulating databases.

I do desire to step into robotics in the future (after completions) and had the following question in my mind:

Do robots usually have databases (similar to these of websites in quality and quantity) and if so, please give a practical example what are they using for? Maybe in the context of machine vision or machine motion.

Update (13/11/19):

All the answers here are good in my opinion. If I could I would accept all of them, I suggest to start by reading the answer of user16549 which makes an introduction to DBs in robots, then continue to the answer by FooTheBar, and then read other answers.

答:
If robots in this case refer to an industrial robot:
An industrial robots are in most cases integrated into a manufacturing cell or manufacturing line. Industrial robots do not have databases in the classical sense, but they do store persistent data (in files) like configuration files, application program. etc. This is data related strictly to the robot and not to the process the robot caries out.

Data related to the (manufacturing) process the robot helps to carry out is end up in a database. Usually a supervisory system (SCADA, MES or ERP) has a database (usually SQL) in which all process related data is stored in a centralized manner. In industrial practice the robot does not directly initiate database transactions, there is at least one other software layer between the robot and any database (as part of the SCADA, MES or ERP systems).

Title: Do robots usually have databases?


问:
Finding center of mass and support polygon for quadruped robot
I intend to find the center of mass of a quadruped robot and find the convex of the CoM inside the support polygon. I want to make a model of this, which is further going to help me develop stable gaits for the robot.

I know of this formula $$x_{cm} = \frac{\sum_{i=1}^{N}m_ix_i}{M}$$

Where $M$ is the total mass, $m_i$ is the mass of each link. I'm confused of what $x_i$ really is. Is this the distance of position of the link on the $x$ axis?
referring to this here.

Can the method of double integrals for solving the center of mass be used to find the convex point in a support polygon? Taking reference to this video here.

There is another post here,  which explains a similar formula, what is the term $P_o^i$? ( I couldn't ask this on comments since I don't have 50 reps. )

答:
I intend to find the center of mass of a quadruped robot and find the
  convex of the CoM inside the support polygon. I want to make a model
  of this, which is further going to help me develop stable gaits for
  the robot.

The question seems wrong to me. What I think you want to do is, find the COM of the robot and convex support polygon of the robot based on the gait. If you know your COM and calculate how your COM shifts based on the gait, you can find a suitable gait. A gait is stable as long as your COM lies inside the support polygon which is the polygon with the vertices described by the position of legs in contact.

I know of this formula $$x_{cm} = \frac{\sum_{i=1}^{N}m_ix_i}{M}$$

Where $M$ is the total mass, $m_i$ is the mass of each link. I'm
  confused of what $x_i$ really is. Is this the distance of position of
  the link on the $x$ axis?

This formula can be used when you have particles with given masses. There, $m_i$ will correspond to the mass of $i^{th}$ particle which is $x_i$ distance away from an origin (either defined by the system or you).

In robotics, we assume links to be particles with their entire mass centered at the Center of Mass (COM).  It is easier to find the center of mass of a simple polygonal object and hence we first start with each link.

Let's say, the leg of the robot is defined by two links, upper and lower. The upper link of the robot is a cuboid (it is sometimes safe to assume even if the robot's leg is not perfectly cuboidal - you can assume a cuboidal hull over it) with all the vertices of the cuboid defined or measured in the world frame or another frame. If you have the robot, you can weigh each of those links or if it is in simulation you can specify the material or the inertia of these links depending on the software you are using to model your robot. Secondly, you can calculate the geometric COM of this cuboid.

Note, this COM position will be in the frame of the link from where you defined the vertices. If all the links' COM was defined in different frames, you will have to find the transformation to go from one frame to another.

Once you do this for all the links of the robot (the legs and the chassis), you can find the overall COM of this robot with the formula you have mentioned above (again, only use it when you have all COMs in the same frame of reference).

There is another post here, which explains a similar formula, what is
  the term Pio? ( I couldn't ask this on comments since I don't have 50
  reps. )

$P_o^i$ is same as $x_i$ and it is defined in the earlier equation which basically finds the position of the COMs of the link in the base frame. You may need to look into transformation of frames if you don't understand that equation.

This was actually a very fundamental question and I would recommend you to take an introductory robotics class to understand these things in depth. A classic start could be "Introduction to Robotics" taught by Prof. Oussama Khatib, Faculty at Stanford. It's available on YouTube for free.


问:
Optical flow inputs
I'm reading how the optical flow of my quadcopter works. The output of the optical flow that interests me is the linear (horizontal) velocity: $v_x$ and $v_y$. Here (page 10) it says that it fuses the IMU information with the camera images to do that, and the algorithm used is Optical Flow.

When I investigate about optical flow, it says that the algorithm uses the angular velocity from the IMU and explains how to fuse it with the camera. But the angular velocity is given by the gyroscope, so why do I need an accelerometer?

Do you know where the fusion between gyroscope, accelerometer to obtain the angular velocity (or whatever the Optical Flow algorithm uses) is better explained?

答:
You are correct, you do not really need an accelerometer for computing optical flow - just the angular velocities along with an altitude estimate will be sufficient for computing velocities in global, metric units. For example, the commercially available PX4Flow optical camera does not contain an accelerometer, only a gyroscope.

But in the case of the slides you linked to, it looks like they are estimating roll and pitch angles both from the gyroscope as well as from the accelerometer just for redundancy purposes (slides 24, 25).

Title: Optical flow inputs