答:
If you place your mechanical arm between rows 4 and 5 or between columns e and d, the furthest point you have to reach would be sqrt(14^2 + (28+6)^2), which evaluates into 36.77cm, and I would say 2 pieces of 20cm would be almost enough, but just to be safe, I'd make 'em both 25cm and you may put it anywhere within 6cm from the board.

Material choice. Acrylic is very fragile and prone to cracking. The weight of the largest chess piece + the weight of all machinery (actuators, magnets, etc.) will easily crack it after a while. Use a more durable plastic instead.

Design choice. The arm you describe would be quite difficult to control, you have to move both joints at the same time with the different speeds, and if you miss and knock another piece off the board -- you lose the game. For speed-independent precise positioning I'd use X-Y table, something like this picture, where X and Y motions can be totally independent, precision is very high and you may easily put a few kilograms of equipment on the top and it will work.

Title: Dimensioning a robotic arm for playing Chess

Body:
The intended purpose of the arm is to pick and place chess pieces.

I am planing to make a 3 DoFs system (only using 2 joints mounted on a revolving turntable), the link structure should be composed of  rectangular pieces of acrylic sheet. My chessboard is 28cm x 28cm.

I don't know how to calculate the length of the 2 links so that the robotic arm end-effector can reach each and every square.


问:
How can I get the distance from a robot to a beacon?
I'm planning to create a Raspberry Pi robot to map a room. I intend to use a particle filtering algorithm as one of the central points of the project, that will allow me to work out my position relative to a 'beacon'. This beacon will be placed near the centre of the room and the robot needs to be able to work out the distance from itself to the beacon, accurate to within <1 metre. The direction to the beacon doesn't matter.

I'm struggling to work out what technology I should use for the beacon. It could be powered by a portable battery, and it needs to work fairly well through table/chair legs (I don't expect it to work through a wall though).

I've considered:

Infra-Red

Ultrasound

Ultra-Wide-Band

Wifi networks

Bluetooth

Image analysis to determine range from known object (won't work through table/chairs)

Is there a way to determine the distance from the robot to a fixed point? If so, what is the best way?

This question is not a duplicate of this question, even though they look similar. I want a distance to an object, the other question is about tracking movement.

答:
There are a lot of ways to do so. But the one which I am more familiar with is by using the Received Signal Strength (RSSI) method. You can use the BLE/WiFi signal strength for the calculation of the distance. Go through this post.

You can also use accelerometer and gyroscope sensors to map the positioning. You can find some reference here:

https://pdfs.semanticscholar.org/cd3d/88d9f942deb245d5797a2135d3dfa757da13.pdf

https://www.diva-portal.org/smash/get/diva2:475619/FULLTEXT02.pdf

ContentLicense: CC BY-SA 4.0


问:
measuring gears for servo motors
I'm quite new to mechanical engineering and not familiar with gears and motors. A few days ago, I bought a second-hand GWS servo motor for my project, and it didn't include gears.

Can someone help me understand the correct measurement of my motor so I can buy the correct gear to fit on my servo motor. Specifically, the measurement of the gear hole:

答:
That servo already has a gear train inside of it.  It's designed to have an arm attached to that output shaft.  The splines on the shaft need to be matched specifically to the servo arm.

You need to find arms that are meant to fit that servo.  If you can't find them at hobby shops, then try eBay or similar.

ContentLicense: CC BY-SA 3.0

Title: measuring gears for servo motors


问:
Can a tablet be slaved to a laptop to act as a wireless usb?
I have built an InMoov Robot. The tablet I got for his controller is too slow. I am currently using a laptop to control him across a usb cable. I want to get rid of the usb cable.

I was thinking of using the embedded tablet as one end of the link (slave), and the laptop as the other. That should give me the speed of the laptop without the usb Cable.

Can this be done?  How?

答:
It should be possible to program the tablet to do this, but you might have to create your own app to do this.

If you're not using the tablet for anything else, it might be easier to use a raspberry pi zero-w to do this. In a Linux environment it is easy to program servers like this in the language of your choice. I'd use rust, but Python, C/C++, Go, or Java will do the job also. And I'm sure that I've only scratched the surface (pun fully intended). There are multiple serial libraries, depending on the language you finally choose.


问:
Robotic Hand Grasp Planning - How do I find the initial contact point for each finger when grasping an object?
I am trying to design a robotic hand that is able to adaptively grasp unfamiliar objects. I am initially thinking that using OpenCV for pose estimation might make doing so easier.

Assuming that I am able to successfully estimate the pose of an object, how might I go about finding the initial contact points for each finger on the object? (or how does each finger know where to go in order to grasp the object?)

答:
This is an excellent question that is currently being explored directly by field experts. Here are some of the latest publications that consider the problem you are encountering:

Robotic Grasping of Novel Objects using Vision

Direct Perception and Action Decision for Unknown Object Grasping

Realtime plane detection for projection Augmented Reality in an unknown environment

Estimation of easily visible position for unknown object grasping

The first item here considers an interesting application of supervised learning. Since we can't rely on our object detection algorithm to classify our object, we can instead seek to learn high probability grasping points.

The other three papers I included may simply be of additional interest, but I won't get into their details here. I do strongly recommend giving them a read.

If you provide more details on your specific problem (i.e. where the camera is in relation to the hand, what is the view angle available by the camera, etc.) and let us know what you have tried/considered in detail, then I would be happy to give the specific problem a go and edit my answer accordingly (This likely should have been a comment, but I don't have that privilege yet).


问:
Drift in Integrating Angular Acceleration to Angular Velocity using two accelerometer data
I am trying to integrate Angular acceleration obtained from a set of accelerometers positioned specifically at opposite corners of a cube, based on "EcoIMU: A Dual Triaxial-Accelerometer Inertial Measurement Unit for Wearable Applications" paper.

I am getting the angular acceleration on each Axis

This signal is quite noisy .

Then after integrating angular acceleration to angular velocity using trapezoidal rule , I get signals which drifts heavily and randomly.

I understand that noise and also numerical integration is causing the effect. Other than low pass filtering the data, is there any other methods to reduce noise.

And the major factor for the drift is numerical integration, how can this be handled.

Please help me out with this.

答:
The authors of the paper you supplied give two reasons (as I see it) for not using gyroscopes. The first is that the gyroscopes are subject to a maximum angular velocity. The second is the power consumption. In regards to both, only you will be able to determine whether or not these two short comings will affect you. That being stated, those two issues will not be a problem in most applications. Assuming that they don't affect your application, then I recommend using an IMU that comes with gyro measurements in addition to the linear acceleration (and if possible magnetometer for more accurate heading).

After the hardware consideration has been sorted out, you need to determine whether or not the noise from your measurements is Gaussian (normally distributed) or not. If so, you should consider, as the other answers have suggested, a Kalman Filter (Use original for linear data, Unscented or Extended for non-linear). If your noise does not follow a normal distribution, then you will need to look into non-parametric approaches such as Particle Filters.

The next issue to consider once that is done, is the numerical integration. This is a very tough problem and unfortunately, there is no true solution. Numerical integration is not just prone to error, but essentially guarantees that the result will not be exact, even when dealing with non-noisy data. When you try performing numerical integration on noisy data, the error that you will see in your system explodes. As a result, we can only hope to reduce our error as much as possible to delay the onset of debilitating drift.

For your numerical integration technique, I suggest switching from using the trap rule to using Simpson's Rule. You typically get more accurate results with Simpson's and so your error from integration won't be quite as bad.

As a side note, an idea that I think is really cool, but didn't seem to really take off anywhere is the use of neural networks in numerical integration (Numerical integration based on a neural network algorithm). I would suggest sticking with Simpson's rule, but if you have the time, you may want to try following what the authors present.


问:
What is the name for the transfer function, GH
What is the name for the transfer function, GH, in a simple feedback control system like

$$y=\frac{G}{1+GH}u$$

What do you call G? What about (G/(1+GH))?

I am confused by the fact that that  "open-loop transfer function" and "Loop transfer function" are used to mean GH by different people. Which is academically correct or widely accepted?

There are several terms: "closed-loop transfer function"
"open-loop transfer function"
"overall transfer function"
"Loop transfer function"
"loop gain"
"loop ratio"

Thanks

答:
G is the open loop transfer function

G*H is the loop transfer function.

The closed loop transfer function is the (open loop) / (1 + loop)

http://en.wikipedia.org/wiki/Closed-loop_transfer_function


问:
CMakeLists.txt vs package.xml
I've read this link: https://answers.ros.org/question/217475/cmakeliststxt-vs-packagexml/

But still, I can't understand very clearly.

When I try to compile ROS project with the command: catkin_make --install, how and when is the package.xml used? how and when is the CMakeLists.txt used? Both of them must be used?

答:
Regarding CMakeLists.txt, it

is the input to the CMake build system for building software packages.

You can think of this file as simply being a list of the cmake build targets and commands for your specific package. It may help to read this to get a general idea.

For package.xml, it

defines properties about the package such as the package name, version numbers, authors, maintainers, and dependencies on other catkin packages.

EDIT: According to an answer in How do I write package.xml? the package.xml is used during the install process to help resolve dependencies.

If you are missing any dependencies and they are not listed in the package.xml file before running catkin_make --install, then your build will either fail or not work as expected.

Title: CMakeLists.txt vs package.xml


问:
Why adding odometry data as control vectors to EKF-Monoslam algorithm fails?
I am working on EKF-MonoSlam (Davson) method for the mere input as a webcam, (it works "fine" if we calibrate and use reasonable sigmas) , and I am trying to add the odometry of some dataset (as rosbag) as in the reference (https://github.com/rrg-polito/mono-slam)

so the odometry (estimated pose) is added so $V_k$ is to make $r_k$ right and so $\Omega_k$ (I know I could use velocity , but I need this working first) , that is supposed to make the camera in the right track as additional measurement, but what happens is:

the camera refuse many matches (as the projection of it is wrong),and soon drift and get lost.

Why is that? and How to fix it?

the dataset site says that odometry data is not calibrated , so I am thinking that it maybe need some scale parameters to make the image estimate of pose match with odometry estimates, if so, how to find that scale

any help or reference ,would be appreciated ,Thank you

Edit:

now I am using velocity of odometry as input and it's better (still there's errors), any link to code or explanation of adding odometrey (as control not measurement) to compare how it goes would be appreciated , this is really a headache in c++...

答:
The Focal length is measured in pixel (in projection equation) and,

the standard unit for length (odometery) in ros is meter ,...so after making sure of the units of your data and the proper initialization of the first frame (of camera and odometrey) noticing that:

Odometrey usually taken as "robot-based" measurement not world-based,

it all came down to solving geometrical transformations.

(after applying this to my problem , the errors are now ok)


问:
Real-time object classification for an indoor autonomous quad-rotor
I am designing an indoor autonomous drone. I am currently writing an object classification program in OpenCV for this purpose. My objects of interests for classification are: ceiling fans; AC units; wall and ceiling lamps, and; wall corners. I am using BoW clustering algorithm along with SVM classifier to achieve this (I'm still in the process of developing the code, and I might try other algorithms when testing).

The primary task of the drone is to successfully scan (what I mean by scanning is moving or hovering over the entire ceiling space) a ceiling space of a given closed region while successfully avoiding any obstacles (like ceiling fans, AC units, ceiling and wall lamps). The drone's navigation, or the scanning process over the ceiling space, should be in an organised pattern, preferably moving in tight zig-zag paths over the entire ceiling space.

Having said that, in order to achieve this goal, I'm trying to implement the following to achieve this:

On take off, fly around the given closed ceiling space and use SLAM to localise and map its environment.

While running SLAM, run the object classier algorithm to classify the objects of interests and track them in real time.

Once obtained a detail map of the environment and classified all objects of interest in the local environment, integrate both data together to form an unified map. Meaning on the SLAM output, label the classified objects obtained from the classifier algorithm. Now we a have fun comprehensive map of the environment with labeled objects of interest and real-time tracking of them (localization).

Now pick random corner on the map and plan a navigation pattern in order to scan the entire ceiling space.

So the question now here is, is using object classification in real-time will yield successful results in multiple environments (the quad should be able to achieve the above mentioned tasks in any given environment)?. I'm using a lot of train image sets to train my classifier and BoW dictionary but I still feel this won't be a robust method since in real-time it will be harder to isolate an object of interest. Or, in order to overcome this, should I use real-situation like train images (currently my train images only contain isolated objects of interests)?

Or in my is using computer vision is redundant? Is my goal completely achievable only using SLAM? If, yes, how can I classify the objects of interest (I don't want my drone to fly into a running ceiling fan mistaking it for a wall corner or edge). Furthermore, is there any kind of other methods or sensors, of any type, to detect objects in motion? (using optical flow computer vision method here is useless because it's not robust enough in real-time).

Any help and advice is much appreciated.

答:
If you choose to use real time object detection, consider the two following:

Deep Drone: Object Detection and Tracking for Smart Drones on Embedded Systems

YOLO: Real-Time Object Detection

The first is a project out of Stanford that is highly relevant to your project. They consider the use of a few different object detection strategies. The strategy I would recommend for your application is listed in the second bullet point. The YOLO object detector (now on version 3) is currently state of the art. Assuming you don't have powerful computing devices available to your UAV, you can use the YOLOv3-tiny. It is very quick, although at the cost of accuracy, but I expect it will be good enough for your application. You will be able to use one of these methods in real-time and in multiple environments if your training data set is robust enough.

Additionally, you can integrate a good object detection strategy within your SLAM technique. As a result, it would not be redundant.

On a side note, practical, real-time object detection wasn't truly first achieved until about two years ago (YOLOv1 and MultiBox SSD). As a result, there are new possibilities that haven't yet been fully explored, so I say have fun with it!


问:
Motorised Stage for laser
The problem

I want to be able to move the direction a laser is pointing.

This means I need to have motorised rotation of the laser head in the x direction and in the y direction. I am unsure of the best way to do this.

Currently 6 axis motorised stages are available from Thorlabs but cost on the order of £7000. This is also overkill for what I need.

Long explanation

I'm a physicist and I'm building an experimental set up. I work on nanoparticles that have implications for optoelectronics & solar cells.

I'm currently making an automated system to test samples which are roughly 15cm by 15cm (and have the nanoparticles on them). I need to scan the laser across the whole sample, taking measurements at specific coordinates on the sample.

The laser is coupled to an optical fibre - we can assume the light is collimated. How best do I raster the laser light around the sample?

Is there some sort of computer controlled jig which might be able do this, are there better solutions?

Hopefully the setup can be entirely robotic - i.e. I place the the sample in, and all the measurements are automated - I'm struggling with automating the laser direction.

Edit:

Some further details

The laser must stay fixed in position i.e. it is only allowed to pan
and tilt. i,e a simple x y stage of the same dimensions of the sample would not be appropriate.

Almost any amount of jitter is allowed when the laser moves.

The speed of operation is not important.

The laser does NOT need to remain perpendicular. All that matters is the spot hits a rough area (say around 2-3 cm by 2-3 cm).

答:
You have several options, and which you select might depend not only on cost, but also on the requirements for your system which you haven’t stated.  For example, how much jitter is allowed while the laser moves?  How fast must it move?  Does the laser need to stay perpendicular to the target sample?

The easiest solution to implement, if the laser does not need to keep its angle to the target constant, would be a pan-tilt mechanism.  You can find these with steppers or servo motor controllers.

Another solution is a two-axis stage.  This would keep the axis of the laser consistent while translating it across the target.  Many stages like this can be found online.  Again, they can come with steppers, servos, or even pneumatic controls.

Finally, you could keep the laser aligned with and translating across the target by implementing a series of piezo-controlled mirrors.  This is pretty common in laser research, but could be complex to implement.

Title: Motorised Stage for laser


问:
Which motors are specifically used for UR3 (Universal robot arm)
I am looking for the specification of UR3, peak torque and rpm.</p>

答: The technical specs sheet publicly provided by Universal Robots doesn't list the RPM or peak torque. When this is the case, I find it beneficial to simply call the manufacturer/developer for more technical information. Fortunately, at the bottom of the technical specs sheet, a phone number is provided.</p>


问:
Lawn mower project
I'm trying to figure out how to make a remote control lawn mower, and I'm stuck questioning one critical part

I'm in the process of buying 2 wheelchair motors that accept both 12 and 24volts which are 60 and 120 rpms which will be wired into a motor controller that also powers a receiver for the transmitter

The question I have is the motor controller, does it have to be a dual motor controller or can I pass with just a general motor controller capable of handling 12volts and can a 12volt car battery be ran to the motor controller or would it need to be regulated down to a lower voltage, I've seen videos on people using the sabre tooth dual motor controller, I'm just wondering why their all limited to one controller

答:
I think you're asking why the Sabertooth motor controllers are popular?

They are very good motor controllers with good manuals. They have an excellent support department.

Another good company that produces similar motor controllers is "RobotClaw."

Title: Lawn mower project


问:
Do multiple LIDAR systems in same area interfere?
LIDARs use a pulse of light to measure distance, usually from the time of flight to reflection and back. With a collection of these measurements they can determine their surroundings in two or three dimensions. LIDARs are used as one of the sensor systems for self-driving cars, in addition to cameras and other radar systems.

Robotic cars are still in the testing phase, but at some point in the future we can expect a busy intersection filled with them, trying to navigate their way through it. With multiple scanners per car, and possibly multiple beams per scanner, interfering signal sources could go over a hundred even in smaller stages.

When time of flight is used to measure the distance to the reflection, the interfering signals would produce multiple "distances", and it would most likely require multiple scans of the same point to average some kind of a reliable value from all the noise.

How do LIDAR systems differentiate their own signals from other sources? With the example of robotic cars, could this interference lead to an error state where traffic could gridlock from lack of valid data? Or is this even a problem?

答:
Based on two different company's sensors for use in autonomous cars - yes they do interfere. And honestly, I am not sure what is going to happen when you have 30 cars in an intersection, the noise will be horrendous and they will not work.

Radar systems from certain makers do not have this problem because they put "squark ids" in their signals which are quite unique and mitigate this issue.I would think you could do similar with the Lidar signal, but they dont.

In my opinion. Lidars are not a good idea for autonomous vehicles. Not just for the above problem, but there are about a dozen unsolved issues with them in the use of moving, high vibration environments.

If you are using Lidars. Test extremely thoroughly, especially on mobile systems. For alternatives: Solid State Lidar, mmWave Radar, and depth sensors (various types).


问:
qt ros tutorial issue
I am working on a robotic application under R.O.S. groovy Galapagos.
I would like to make a tutorial about how create a template app with catkin_create_qt_pkg.
I'm unable to call the script catkin_create_qt_pkg from my catkin workspace.
I found it at the root : _/opt/ros/groovy/qt_ros/qt_create/script_
But even if I try to execute it as sudoer I got an error.

ImportError: No module named qt_create

I'm unable to determine what I have to do to make it work.

Why?

答:
Hi sorry for being so late.

My OS is Linux Ubuntu 13.04.

I already fix that issue.
It was weird I just reuse an ROS exemple, readapt it exactly as I did when post that message, and everything worked ...

Thank you for your help

Jonny

Title: qt ros tutorial issue


问:
GraphSlam doubt about variable elimination technique
I am trying to implement Graph Slam. For tutorial purpose I read the paper "The GraphSlam Algorithm with Application to Large-Scale Mapping of Urban Structures" by Sebastian Thrun. At the beginning of this paper in abstract portion there is a line which arise doubt. "It then reduces this
graph using variable elimination techniques, arriving at a lowerdimensional
problems that is then solved using conventional optimization
techniques". What is that variable elimination technique? Which variable they want to eliminate?

In the same paper "Table 3. Algorithm for Reducing the Size of the Information Representation of the Posterior in GraphSLAM". What is the meaning of this algorithm? What kind of data we calculate here? Paper Link The GraphSLAM Algorithm

I am eagerly looking for the answer of those question because after read this paper it is very difficult to understand the theory of GraphSlam.

答:
The variables being removed are the 'features', i.e.,the observations from the robot. Section 3.4 in the paper discusses the variable elimination in a good amount of detail (especially figure 3).

The reason for this elimination is to reduce the information representation from between poses and features to between poses. After the removal, the information matrix only propagates information between the poses,greatly reducing the size and complexity of the graph.

To put it very simply, imagine there are two poses $x_1$ and $x_2$ from both of which one feature $f$ is being observed. Now you have two links (edges), one between $x_1$ and $f$ and one between $x_2$ and $f$, representing the observation. The variable elimination technique will remove these two links and eliminate $f$ altogether, but whatever changes were being made to $x_1$ and $x_2$ will now instead be stored in the edge between $x_1$ and $x_2$. The way this change is performed inside the information matrix (which encodes these links) is shown in an algorithmic way in table 3. The data computed in table 3, thus, is a smaller information matrix and the corresponding information vector.


问:
Confusion of EKF equations
I read Probabilistic Robotics by Sebastian THRUN (online version). I also read http://ais.informatik.uni-freiburg.de/teaching/ws12/mapping/pdf/slam04-ekf-slam.pdf

Question1 :
What will be the dimension of Matrix $F(x,j)$ below? As per book its dimension is $(3N+3)*5$. So if I have 10 landmark the dimension will be $33*5$. Meaning 33 Rows and 5 column. But as per picture No: 1 $F(x,j)$ has 6 Rows. This is confusing for me.

Picture No1:

Question 2:
  Both references describe  the same approach Extended Kalman filter slam with known correspondence, the only difference between them is the equation to build the matrix $H_i$ (see below, picture 2 and Picture 3).

Now after reading those books I am confused which one is error less?

Picture No2:

Picture No3:

Helpful discussion appreciated.

答:
For your first question, $F(x, j)$ is a $6 * 3N + 3$ dimensional matrix. Why? $F(x, j)$ is a factor of $H_t^i$. The reason $H_t^i$ is a $3 * 3N + 3$ matrix is because of the problem set up. We are concerned with $N$ landmarks and a 3 dimensional state $[x\ \ y\ \ \theta]$. I recommend re-reading over page 319 of the book, especially points 10.18, 10.19, and 10.20 (its too long for me to post here).

For your second question, look on slide 34, second bullet, of EKF SLAM. Low $H_t^i$ is not the same thing as $H_t^i$. In the second bullet, we see that the derivation of $H_t^i$ is exactly the same as Thrun et al. writes in the book (page 314). See that the low $H_t^i * F(x,j)$ is the factorization of the derivative, $H_t^i$ (as mentioned above).

As a side note, the slides you posted come with a recorded lecture that is freely available on YouTube, thanks to the author of this course. The lectures provide more insightful guidance through the material than just a read. If you haven't already taken a look, it will be well worth the time.

Title: Confusion of EKF equations


问:
GraphSlam Matrix Subtraction doubt
I am trying to implement GraphSlam from this paper. I have some doubt regarding the algorithm described in this paper at table2: Algorithm GraphSLAM_linearize.

I have a doubt in line 7. As per my knowledge, Gt is a 3*3 matrix. How could I subtract 1 from a 3*3 matrix? As per matrix subtraction rule both matrices should be in same dimension.

答:
That is not $[1 - G_t]$, it's $[1 \qquad -G_t]$ (exaggerating the space between the two elements. For all intents and purposes, consider $1$ to be the equivalent identity matrix, and $G_t$ is just a submatrix in this. Intuitively, in this case, $1$ would be $I_{3\times3}$.

In equation 7, the multiplication follows this order:

$(6 \times 3) * (3 \times 3) * (3 \times 6)$

Remember that the information matrix is not $(3\times3)$. It's a big, sparse matrix with non-zero submatrices along its diagonal, so adding a $(6\times6)$ matrix to that would mean you need to decompose the resulting matrix from equation 7 into submatrices that correspond to $\Omega$ at $x_t$ and $x_{t-1}$, etc.

Title: GraphSlam Matrix Subtraction doubt


问:
Transformation matrix using DH parameters
I want to write a Matlab function which takes the DH parameters as input and outputs a 4X4 transformation matrix.

The code I have written is :

```<code>function  [A]  = compute_dh_matrix(r, alpha, d, theta)

A = eye(4);

% ROTATION FOR X
A(1,1) = cos((theta));
A(2,1) = sin((theta));

% ROTATION FOR Y
A(1,2) = -(sin(theta))*(cos(alpha))*(1);
A(2,2) = (cos(theta))*(cos(alpha));
A(3,2) = (sin(alpha));

% ROTATION FOR Z
A(1,3) = (sin(theta))*(sin(alpha));
A(2,3) = -(cos(theta))*(sin(alpha))*(1);
A(3,3) = (cos(alpha));

% TRANSLATION VECTOR
A(1,4) = (alpha)*(cos(theta));
A(2,4) = (alpha)*(sin(theta));
A(3,4) = d;

end
</code>```

But when I submit the code for evaluation in an online platform it prompts that variable A has incorrect value.

One of the input data used for evaluation of the code is :

```<code>r = 5;
alpha = 0;
d = 3;
theta = pi/2;
</code>```

The matrix representation I have used to write the code is :

$A =$ \begin{bmatrix}cos(\theta)&&-\sin(\theta)\cos(\alpha)&&\sin(\theta)\sin(\alpha)&&\alpha \cos(\theta)\\\sin(\theta)&&\cos(\theta)\cos(\alpha)&&-\cos(\theta)\sin(\alpha)&&\alpha \sin(\theta)\\0&&\sin(\alpha)&&\cos(\alpha)&&d\\0&&0&&0&&1\end{bmatrix}

A is the transformation matrix generated using DH parameters $\theta$, $\alpha$ and d

$\alpha$ is angle about common normal from old z axis to new z axis

$\theta$ is angle about previous z axis, from old x axis to new x axis

d is offset along previous z axis to the common normal

答:
The multiplication factor in the translation terms should be the link length instead of the angle $\alpha$.

That is, the translation should be $(r\cos\theta, r\sin\theta, d)$.


问:
What good robotics software platforms / operating systems are available?
My company will soon be starting a brand new robotics project, and we are still trying to decide whether we should design and code a robotics software platform from scratch, or if there are any good existing ones.

It would be very useful if there was a software platform which was commonly used among both academics and industry so that our robotic system was generally compatible with others, and so that people were already familiar with it.

We would like the software platform to be able to:

Integrate new robotic hardware components easily.

Already contain a wide array of useful data processing and visualisation tools

Make efficient use of computing hardware

答:
The Robot Construction Kit is an alternative to ROS. It is driven towards model-driven engineering and design/management of complex systems. It also is driven towards "not being tightly dependent on Rock". Most of the algorithms / drivers in Rock are independent of the component layer. See also this page for a quick summary of the differences between Rock and ROS.

As a previous answer points out, ROS is mainly used as a thin communication library. Rock's component layer is thicker, to provide the tools necessary to scale to complex systems.

What you have to understand is this: in this day and age, the only open-source robotic software worth looking at is framework-independent (OpenCV, PCL, OpenRave, Gazebo, ...). Even Willow Garage finally understood this. Therefore, it can be integrated with a minimal amount of work in any framework.

Now: your best pick also depends on your aim. If what you want is sell hardware, then it is well possible that having a ROS node is your best choice (even though having a good driver library that is then integrated into a ROS node is even better).


问:
How to choose a good IMU for a wheeled robot?
At our lab, we have a several "Kurt" type robots (about the size of a Pioneer, six wheels, differential drive). The built-in gyroscopes are by now really outdated; the main problem is that the gyroscopes have a large drift that increases as the gyro heats up (the error is up to 3°/s). We mainly use the IMU (inertial measurement unit) to get initial pose estimates that are later corrected by some localization algorithm, but even doing that the large initial pose error caused by the IMU is often annoying.

We've temporarily used an Android phone (Galaxy S2) as a replacement IMU, and the results are so much better compared to the old IMUs. However, I don't like depending on a WiFi connection between IMU and the control computer (a laptop running ROS/Ubuntu), so we're looking to buy a new IMU.

What IMU should we choose? What criteria are important to consider for our application?

答:
I assume that you are looking for an IMU that provides you with an orientation estimation. The complete package is usually called an Attitude and Heading Reference System (AHRS). What really is the most defining criteria is your budget. Getting above 3 degrees/s should be within reach though.

We have been working with the XSens MTi and had good enough results for navigation of ground vehicles. They have a new line out, which has improved on the accuracy quite a bit.

Budget options are also available, this one looks quite promising as it is a single chip solution. There is also an IMU buyers guide at Sparkfun.

Usually pitch and roll are fine with most IMUs for ground vehicles, as the gravity vector can be used to compensate the drift. Not so with the yaw axis, which is often a problem even when compensated with a magnetometer. For that reason we often use a single fibre optic gyro to minimize the heading drift.


问:
3D Mapping from a quadcopter with KINECT
I have a quadcopter robot that has a KINECT on it and i want to do 3D mapping with it.

Is KINECT reliable on a moving robot (i.e., can it give me stable images and maps with this movement)?

Is there an SDK for producing 3D maps from KINECT data?  Will SLAM algorithms work?

Is the arduino board on the copter (ATmega 2560) powerful enough to handle this?

答:
In answer to your q1 Kinect mapping quadcopter has been done:
http://www.engadget.com/2010/12/06/kinect-used-as-a-quadrocopter-radar-video/

In answer to your q2 you can read from some of the online analyses of the project (http://aeroquad.com/archive/index.php/t-1503.html?s=eb7c86f8f916e82c4d8bb7476a68f608) the onboard computer was a 1.6GHz Intel Atom CPU, which is significantly more powerful than arduino.


问:
Recommendations and Advice - Motor Driver for 12V Gear Motor with Magnetic Encoder
I am building a robotic insect leg that would be actuated by 2 DC motors for pan and tilt motions. Total weight of the leg is about 1.5kg and 1m long (moment arm ~0.5m). Magnetic encoder would be used to determine position.

This could be a very basic question but I have been searching for information regarding the wiring, control and suitable motor drivers to control the DC motors using Arduino to no avail. So any help would be greatly appreciated!

The two motors that I am using are Servocity's DC gearmotors that come with magnetic encoders:

1) https://www.servocity.com/23-rpm-hd-premium-planetary-gear-motor-w-encoder

Will be used for tilt motion

2) https://www.servocity.com/84-rpm-hd-premium-planetary-gear-motor-w-encoder

Will be used for pan motion

The commonly used motor driver L298N supports peak currents up to 2A but both these motors have stall current of 20A. The torque/ speed curve is provided but no additional information about the torque/ current curve is available so not able to straightforwardly determine the max current required when running at lower torque requirements.

What would be a suitable motor drivers/ H-bridge that can be used with these two motors? Have already read up the few motor driver posts but doesn't seem to have that talks about max current of 20A.

Are there wiring diagrams available for these type of gearmotors? The most relevant topic found is this, but I have trouble completely understanding it: Need super-basic help with motor encoder

Thanks!

答:
You would need something like the RoboClaw 2x30 motor controller. This should work.

20 amps is a lot of current, which would cause a simple chip like the L298N to get too hot and then fry. Please do not even try this.

For your second question, if you Google "motor encoder tutorial" you should be able to find a lot of information. You should read the RoboClaw user manual, because I think that it will take care of the encoders for you.

These are also called rotary encoders. The basics is that these are A/B encoders which means that there are two output signals, A and B. These signals are the same, but offset by some amount.

Imagine that A and B are square waves with B pushed forward. So you get states like this:  A,B = LOW; A = HIGH, B = LOW; A,B = HIGH; A = LOW, B=HIGH; then the table repeats itself. By using interrupts you can detect each time one of the signals change and then figure out the angle traveled. From there you can calculate the distance traveled by the robot, theoretically.

One of the many tutorials will explain this better than I can right now. It really is a lot simpler than I have described it, but that's how I think of it.


问:
How to install a CAN port on PC (under Ubuntu)
We are using Ethernet as our current control bus and are considering switching to CAN. Our main computing unit is a PC under Ubuntu which needs to be fitted with a CAN port.

Anyone can recommend a PC to CAN hardware interface?

Any insight and experience feedback on using CAN on Ubuntu?

答:
For low cost, but well designed and well supported in linux,  I can recommend the  USB2CAN from 8Devices.

If you will be booting windows occasionally to set up industrial drives or sensors, or doing real-time,  stick with Peak or Kvasser.

If you will be adding a real-time kernel underneath Linux, check the driver list to confirm support for what you are buying.

CAN under linux with the socketCAN drivers works really nicely.


问:
Original paper of Kalman filter
Recently we've encountered Kalman filter algorithm for state estimation in a course of Probabilistic Robotics.

After taking several days to try to read Kalman's original paper published in 1960, A New Approach to Linear Filtering and Prediction Problems, it firstly feels a bit difficult to read, and it seems the majority is to show the orthogonal projection is the optimal estimation under certain conditions and solutions to Wiener's problem.

But I did not find the exact algorithm in this original paper as the one in the textbook.

For example, is there an explanation of "Kalman gain" in this paper ?

Does Kalman's paper provide a mathematical derivation of Kalman
filter algorithm?

答:
The Kalman Gain term is derived in equation 25 (page 7) of the paper. The paper doesn't explicitly use the term "Kalman Gain" as that term was coined after the fact. However, the paper does refer to the principle as the "optimal filtering" on page 6 (just after equation 19). For details on its derivation, refer to the section titled "Solution to the Wiener Problem".

In the same section, we have the Kalman filter algorithm and its mathematical derivation. Although the discovery is extremely important and ground breaking, the paper hasn't aged well with respect to the computing community in regards to its use of notation and language. As a result, it is understandable that you may have missed it.

If you or anyone else reading this post has trouble with the mathematical derivation of the algorithm in the original paper, there are some good resources posted in the comments of the question.

Title: Original paper of Kalman filter


问:
Is orocos dead?
We are using orocos on the robot we have been developing for 3 years now and I have the feeling that Orocos is no longer maintained and the mailing lists are not only no longer active but also it is no longer possible to subscribe to them.

Do you have more information about the state of orocos? Is it a dead project?

答:
The orocos software is available on github:

https://github.com/orocos

https://github.com/orocos-toolchain

Their KDL repo has been updated as recent as 2 days ago so I would say it's not dead. Try logging an issue using github to contact the developers instead of the mailing lists.

Title: Is orocos dead?


问:
Marginalization in Graph SLAM
I have several questions about the process of marginalization in SLAM algorithms:

0 - What are the mathematic intuition behind marginalization process

1 -  I know marginalization of states or points is related with removing nodes from the graph and keeping the information they have, how this information is kept? I mean, how the information of the marginalized states are passed to the remaining state?

2 - Why in bundle adjustment, the points are set marginalized? (example of ORBSLAM implementation)

Thank you very much!

答:
Seems like you had same question as me.

I wrote my own answer here which will be the answer to your question 0, 1, 2.

Title: Marginalization in Graph SLAM


问:
Math behind trajectory 2d planning
I have a case of a differential drive robot and a control system in a two-dimensional environment:

Now the problem: we would like to make our particle move from point A to point B, and from there to point C (a spline-based path), in the most optimal time and constrain our acceleration, deacceleration, velocity, and angular speed.

How would one do this assuming that our control system allows us to control either velocity or acceleration?

The most important things here are names of mathematical methods behind this task and explanation of how to apply them.

答:
Keywords here are path-paramerization, time-parameterization, etc. Given a geometric path, these path-parameterization algorithms can give you the time-optimal velocity profile such that the robot moves along the path the fastest possible while respecting constraints.

The original paper on this topic is by Bobrow, Dubowsky, and Gibson. This one is, in my opinion, really well written. It explains well the general idea how path-parameterization works.

Nowadays, there are quite a few approaches to solving a time-parameterization problem (convex optimization, numerical integration, reachability analysis, etc.). You may refer to the paper and also references therein for more details on the methods and their corresponding implementation.

Title: Math behind trajectory 2d planning


问:
Is Programming/Coding necessary to pursue a masters degree in robotics?
I am soon going to finish my undergrad in mechatronics engineering and wish to take up robotics for my masters. But I absolutely dislike any form of coding/programming. I am however,interested in the mathematics and physics behind the working of a robot. I'd also love to study about the control systems in a robot. So is coding a requirement if I want to take up robotics?

PS: I couldn't find the right tag for the question. Sorry! Please direct me to the right one if required.

答:
Is coding a requirement if you want to take up robotics? No, but it is strongly recommended.

The field of robotics is highly multidisciplinary. I primarily work on AUVs as a software developer, but my team consists of mechanical (ME), electrical (EE), and computer (CPE) engineers as well as physicists. Most of them don't look or write any of the code, but rather (as needed) assist the software developers in working out the mathematics for our acoustic systems, motor controllers, etc.

If that sounds like what you are interested in, then those opportunities definitely do exist, but they are slim. Most groups that do work with robotics (industry or academia) expect their members to be able to work directly with code to varying degrees. That could be MEs or physicists programming high-level controllers, EEs or CPEs programming microcontrollers, or working directly on the larger code base (architecture, planning, perception, etc.).

With this in mind, I suggest giving programming another chance. Not everyone will enjoy programming, but I think most people who turn away from it just didn't have a good first experience to really be able to appreciate the beauty of computing.


答:
You can study and practice robotics control without dealing with much programming. Look at mechanical engineering or electrical engineering departments with a degree in control systems. Their programming course requirements will be listed in the curriculum.

You will probably spend some time using MATLAB (simulink), Mathematica, or another similar language for numerical analysis.

Title: Is Programming/Coding necessary to pursue a masters degree in robotics?

Body:
I am soon going to finish my undergrad in mechatronics engineering and wish to take up robotics for my masters. But I absolutely dislike any form of coding/programming. I am however,interested in the mathematics and physics behind the working of a robot. I'd also love to study about the control systems in a robot. So is coding a requirement if I want to take up robotics?

PS: I couldn't find the right tag for the question. Sorry! Please direct me to the right one if required.


问:
Bluetooth module HC-05 giving ERROR :(0)
I am working right now with Arduino UNO and HC-05 bluetooth module.I followed the instruction given on this link for wiring. So there are 2 mode of working with this HC-05 module

Simple serial communication

Working in AT command mode so as to change the parameters of HC-05 module

As long as I work in simple serial communication mode, everything works fine but when I tried to change the parameters of module, it didn't work out. For working in At command mode, PIN NO 34 of HC-05 module needs to be high which I had taken care of. Lately I found that in mu module they had knowingly not connected the Berg strip to PIN 34, so I connected the PIN directly, even though I am not able to change the parameters of module and when I write any command on COM port of arduino IDE, I get this response

```<code>Enter AT commands:
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
</code>```

I think that garbage is due to my code

Here is my code:

```<code>#include <SoftwareSerial.h>

SoftwareSerial BTSerial(10, 11); // RX | TX

void setup()
{
  pinMode(9, OUTPUT);
  digitalWrite(9, HIGH);
  Serial.begin(9600);
  Serial.println("Enter AT commands:");
  BTSerial.begin(38400);
}

void loop()
{
  uint8_t x;
  char CommandFromSerial[50]=" ";
  char ResponseFromBluetooth[50]= " ";

  if ((Serial.available())){
    if(Serial.available()>0){
      for(x=0;x<50;x++)
        CommandFromSerial[x]=Serial.read();
      BTSerial.println(CommandFromSerial);
    }
  }

  if ((BTSerial.available())){
    if(BTSerial.available()>0)
      for(x=0;x<50;x++)
        ResponseFromBluetooth[x]=BTSerial.read();
    Serial.println(ResponseFromBluetooth);
  }
}
</code>```

I am not able to figure out what I am doing wrong. I used this command on COM port
AT\r\n and many other commands but every time I get the same response.

Did I mess up with my bluetooth module unknowingly?

答:
https://juangiraldo0.blogspot.com/2018/07/configuracion-modulo-bluetooth-hc-06.html

Probably your error(0) is due to versión firmware problem
version 3.0-20170609 have AT comands differents


问:
Cannot disable sleep in passive mode for iRobot Create 2
I tried to disable sleep by pulsing the BRC pin low for one second every minute as suggested in the OI, but my Create 2 still goes to sleep after 5 minutes.

My firmware is r3_robot/tags/release-3.2.6:4975 CLEAN

The Create 2 is connected to an Arduino, and the BRC is driven by one of the Arduino pins.  I verified on a DMM that the voltage is indeed toggling.  I am able to both send and receive serial data between the Arduino and Create2.

Pseudo-code:

Initialize roomba.  Connect serial at 115200 baud.  Toggle BRC: high for 200 ms, low for 200 ms, then high again.  Leave it high.

Ask roomba to stream sensor data in passive mode.  Wait 1 second after BRC toggle to give some extra time to wake-up.  Then send opcode 7 (reset), wait for reset message to complete by looking for the last few characters, then wait another second for good measure.  Next, send opcode 128 (start into passive mode), wait 100 ms to let opcode stick, then ask for stream of data (opcode 148 followed by number of packet IDs and the packet IDs themselves).

Main loop: Echo data from Create2 to the serial-USB output of the Arduino so that I can view the Create2 data.  The data sent by the Create2 look valid (good checksum) and are sent in the expected time interval of ~15 ms.  The main loop also toggles the BRC low for 1 second every minute.

For the full gory details, the complete Arduino sketch is shown below

```<code>const uint8_t brcPin = 2; // Must keep this low to keep robot awake
long last_minute = 0;
long minute = 0;

// Initialize roomba
void roomba_init()
{
  Serial3.begin(115200); // Default baud rate at power up
  while (!Serial3) {}    // Wait for serial port to connect

  // BRC state change from 1 to 0 = key-wakeup
  // keep BRC low to keep roomba awake
  pinMode(brcPin, OUTPUT);
  Serial.println("BRC HIGH");
  digitalWrite(brcPin, HIGH);
  delay(200);  // 50-500 ms

  Serial.println("BRC LOW");
  digitalWrite(brcPin, LOW);
  delay(200);

  Serial.println("BRC HIGH");
  digitalWrite(brcPin, HIGH);
  last_minute = millis()/60000;

  delay(1000);  // give some extra time to wake up after BRC toggle.

  Serial.println("Opcode 7: reset robot");
  Serial3.write(7);      // Reset robot
  // Discard roomba boot message
  // Last part of reset message has "battery-current-zero 257"
  char c = 'x';
  Serial.println("Gimme a z!");
  while (c != 'z') {
    if (Serial3.available() > 0) {c = Serial3.read(); Serial.write(c);}
  }
  Serial.println("Gimme a e!");
  while (c != 'e') {
    if (Serial3.available() > 0) {c = Serial3.read(); Serial.write(c);}
  }
  Serial.println("Gimme a r!");
  while (c != 'r') {
    if (Serial3.available() > 0) {c = Serial3.read(); Serial.write(c);}
  }
  Serial.println("Gimme a o!");
  while (c != 'o') {
    if (Serial3.available() > 0) {c = Serial3.read(); Serial.write(c);}
  }
  // Flush remaining characters: 32 50 53 54 13 10 or " 257\r\n"
  Serial.println("Gimme a newline!");
  while (c != 10) {
    if (Serial3.available() > 0) {c = Serial3.read(); Serial.write(c);}
  }
  delay(1000);  // allow extra time for opcode 7 to stick

  Serial.println("\nOpcode 128: start OI in passive mode");
  Serial3.write(128);   // Start the Open Interface.  Passive mode.
  delay(100);           // Allow some time for opcode 128 to stick (not sure if this is needed)
  Serial.println("Opcode 148: stream data packets");
  Serial3.write(148);   // Stream data packets (every 15 ms)
  Serial3.write(16);    //   Number of packet IDs
  Serial3.write(8);     //   Packet ID 8 = wall                       1 byte
  Serial3.write(9);     //   Packet ID 9 = cliff left                 1
  Serial3.write(10);    //   Packet ID 10 = cliff front left          1
  Serial3.write(11);    //   Packet ID 11 = cliff front right         1
  Serial3.write(12);    //   Packet ID 12 = cliff right               1
  Serial3.write(13);    //   Packet ID 13 = virtual wall              1
  Serial3.write(27);    //   Packet ID 27 = wall signal               2
  Serial3.write(28);    //   Packet ID 28 = cliff left signal         2
  Serial3.write(29);    //   Packet ID 29 = cliff front left signal   2
  Serial3.write(30);    //   Packet ID 30 = cliff front right signal  2
  Serial3.write(31);    //   Packet ID 31 = cliff right signal        2
  Serial3.write(41);    //   Packet ID 41 = velocity right            2
  Serial3.write(42);    //   Packet ID 42 = velocity left             2
  Serial3.write(43);    //   Packet ID 43 = encoder counts left       2
  Serial3.write(44);    //   Packet ID 44 = encoder counts right      2
  Serial3.write(45);    //   Packet ID 45 = light bumper              1
}

void setup() {
  // Open serial communications (through USB interface)
  // The serial output of the Create 2 is echoed from Serial3 to Serial
  // so that we can observe the Create 2 serial output on a computer.
  Serial.begin(115200);
  while (!Serial) {}   // Wait for serial port to connect
  Serial.println(F("Starting roomba test...\n"));

  // Roomba serial commmunications
  Serial.println(F("Initializing comm to Roomba\n"));
  roomba_init();
}

long low_start_time;
boolean brc_is_low;
void loop() {
  // Read from Serial3 and echo results to Serial
  if (Serial3.available()) {
    uint8_t b = Serial3.read();
    uint8_t checksum = 19;
    if (b==19) { // First byte of reply stream is 19
      Serial.print("\nStart at ");
      Serial.println(millis());
      Serial.print(b); Serial.print(" ");
      while (Serial3.available() < 43) {}  // Wait for rest of data (buffer is 64 bytes)
      for (int I=0; I<43; I++) {
        b = Serial3.read();
        Serial.print(b); Serial.print(" ");
        checksum += b;
      }
      Serial.print("Chksum ");
      Serial.println(checksum);  // 0 is good
    } else {
      // Probably an ascii message
      //Serial.write(b);
      Serial.print(b); Serial.print(" ");
    }
  }

  // Pulse BRC low every minute for 1 second
  long now = millis();
  long minute = now/60000;
  if (minute != last_minute) {
    Serial.println("\n\nBRC LOW");
    Serial.println(millis());
    digitalWrite(brcPin, LOW);

    last_minute = minute;
    low_start_time = now;
    brc_is_low = true;
  }

  // 1 s low pulse width
  if ((now > low_start_time + 1000) && brc_is_low) {
      Serial.println("\n\nBRC HIGH");
      Serial.println(millis());
      digitalWrite(brcPin, HIGH);
      brc_is_low = false;
  }
}
</code>```

答:
I'm having the exact same issue with a Roomba 635.

I'm also using an Arduino (an esp8266 specifically) and pulse the BRC port low for 100ms every 15 seconds.

I get:

```<code>Running sendInfoRoomba()...
ERROR: Incomplete packet recieved 0 bytes.
Pulsing awake pin & sending 128...
</code>```

The commands I send every 10 seconds are:
128, 149, 3, 21, 25, 26

Yet I get no reply in numerous occasions. The only 'fix' is to press the power button on the top - then everything magically works - until it doesn't again.

EDIT: My bit of code that you may want to hijack :)

```<code>  // Get the following sensors:
  // 21 (1 byte reply) - charge state
  // 25 (2 byte reply) - battery charge
  // 26 (2 byte reply) - battery capacity
  unsigned int command[] = { 128, 149, 3, 21, 25, 26 };
  byte numOfCommands = (sizeof(command) / sizeof(command[0]));
  for ( int i = 0; i < numOfCommands; i++ ) {
    Serial.print("TX: "); Serial.println(command[i], DEC);
    RoombaSerial.write(command[i]);
    delay(10);
  }
</code>```

Note that I have two serials, Serial is the USB adapter to my PC, RoombaSerial is a SoftwareSerial for two pins to the Roomba.

Body:
I'm having the exact same issue with a Roomba 635.

I'm also using an Arduino (an esp8266 specifically) and pulse the BRC port low for 100ms every 15 seconds.

I get:

Running sendInfoRoomba()...
ERROR: Incomplete packet recieved 0 bytes.
Pulsing awake pin & sending 128...

The commands I send every 10 seconds are:
128, 149, 3, 21, 25, 26

Yet I get no reply in numerous occasions. The only 'fix' is to press the power button on the top - then everything magically works - until it doesn't again.

EDIT: My bit of code that you may want to hijack :)

  // Get the following sensors:
  // 21 (1 byte reply) - charge state
  // 25 (2 byte reply) - battery charge
  // 26 (2 byte reply) - battery capacity
  unsigned int command[] = { 128, 149, 3, 21, 25, 26 };
  byte numOfCommands = (sizeof(command) / sizeof(command[0]));
  for ( int i = 0; i < numOfCommands; i++ ) {
    Serial.print("TX: "); Serial.println(command[i], DEC);
    RoombaSerial.write(command[i]);
    delay(10);
  }

Note that I have two serials, Serial is the USB adapter to my PC, RoombaSerial is a SoftwareSerial for two pins to the Roomba.


问:
Solving Inverse Kinematics for ABB IRB 120
I am working on an ABB IRB120 simulation using MATLAB Simulink. I use the decoupling method to solve the inverse kinematic of the robot. However, I have some questions related to the computation of the last three joints (spherical wrist).

I have read many books and I found that the solutions for the last 3 joints are not the same for theta 5,theta 4, theta 6 consequently. My question is that: Those formulas that I found in books or in the INTERNET, aren't they the same, or dependent on the D-H parameters of the robot (how we choose alpha, adding special angles 0,pi,pi/2 to Theta...). If they are dependent on the D-H parameters, then how could I choose the easiest posture to solve the robot.

a. In the book Robot modeling and control (Siciliano), he chose the the final coordinate frame for the anthromopophic arm’s end-effector with X pointing upward (No special angle added to Theta6).

b. However, in RoKiSim, X points downward (Pi is added to Theta6). Thus, I have looked at other papers and I saw different formulas. The question is: Why they choose these postures, and how they got those formulas.

When I run the simulation, I saw that there are some points, the Theta 4 and Theta 5 rotate 180 degrees (change of signs), however, the end-effector is the same. Is there anyway for me to know if my code is correct (sample codes/ papers/ softwares…) so I can know I’m still on the right track.

I have built the robot and ready to implement the code at any time. I have built the controller and the only thing left is the kinematic itself. Should I keep enhancing my decoupling method inverse kinematic or move to analytical solutions, or any method that suit me. Please give me advice on this (I use 32bit ARM chip for the controller).

答:
To choose the best posture:

If you have absolute encoders: compare which is the closest compared to your current position

if you use incremental encoders: You need a reference at the beginning (e.g. start the system always in the same posture). After that you can compare the next possible postures with your current posture (and look for the closest again)

this issue with the x axis. I don't understand your problem completely. Usually your robot can rotate around the z-axis of your tool frame. So you can choose x completely free. It is just a definition. You have just adapt your coordinates later to your chosen convention. So I wouldn't wonder when even robot manufacturer vary. You should now that DH parameters are not completely defined. Several correct solutions can exist.

A decoupled kinematic is always better for calculation and a analytical solution is faster than a numeric. So I would go on with this, if I were you. Do you know already this paper? It is from the proceedings of the Austrian Robotics Workshop - the implementation is open source here.

For checking your inverse kinematic: just calculate the forward kinematic. If the difference equals zero your implementation is consistant. That helps a lot but of course you could have the same mistake in forward and inverse transformation. So there is no guarantee.


问:
Which motor to use for self-balancing-bot?
I am building a self balancing bot using

MPU-6050

Arduino Mea 2560

100 rpm 12V DC motors

Currently I have used two 100 rpm DC motors in the bot. The pwm signal is given to the bot on the basis of the angle which the bot makes with the vertical(i-e angle of inclination).

Currently the bot isn't able to recover when tilted to about 40 degrees or when pushed hard.

As far as I understand the problem lies with the motors used.So, to make the bot more stable and to make it prevent on falling when pushed hard, what motors should be ued ?

Using stepper motors will be better or a DC motor with higher rpm rating (say 300 rpm) will be better ?

Stepper motors will provide certain advantages like rotations in it will be less affected by the variations in the voltage supply. Also stepper motors will provide more torque to balance the bot when tilted by larger angles.

But the stepper motors will cause mechancial vibrations, will this cause the bot to disbalance and hence making high rpm DC motors a better choice for it or still the stepper motors will be better (i-e the mechanical vibrations due to stepper motor won't have significant effects)

Please help me to select better motors for the bot,
300 rpm DC motors OR Stepper motors

答:
40 degrees is pretty good. I believe that you need motors with more torque as well as more speed. Which means that you may also need a new motor controller.

The motors

I don't have the information about the motors that you're using. There are a couple factors involved in balancing a balancing robot.

The motor's torque: Torque is a rotational force, measured in units of force times length, such as newton-meters or n-m or pound-feet lb-ft. This is a measure of the strength of the motor. At some point, the motor will not be able to lift the robot.

The motor's speed: In order to balance the robot, the motor needs to react very quickly. If you've ever tried to balance a yard-stick on its end with one finger, then you'll have an idea of the problems. Once the stick starts falling, you need to move your finger quickly, and the more you've let the stick fall, the faster you'll need to react.

You can improve a motor's torque and speed by increasing the voltage, but that risks the motor unless you stay within the limits.

If the motors are running at full speed most of the time, then you'll need more powerful motors.

There is nothing wrong with using a DC Brushed Motor with this type of robot. It's what I've seen.

I haven't seen stepper motors used for this type of robot, but if they have the speed, they might be ideal. They usually have excellent torque at low speeds and less torque at higher speeds, which is exactly what you need for a balancing robot.

Another type of motor that could be used is the BLDC (Brushless DC) motor. This needs a different type of motor controller.

PID Control

Another factor is programming. While I have heard of using just a proportional motor controller for setting the PWM for the motor, it works better with a full tuned PID controller. There are many tutorials on how to do this on YouTube.

To do this, you'll need to know the angle between the floor and the robot. The easiest way to get this is to use both motor encoders and a gyroscope/acceleromter such at the MPU 6050.


问:
RViz: How to Visualize a Voxblox Mesh as a MarkerArray?
I am currently trying to run the test cow and lady dataset with Voxblox.  The process appears to execute properly in the terminal, but I cannot view the mesh in RViz.

When I try to add the topic voxblox_node/mesh to RViz, the topic name is greyed out and I cannot add the topic.  This topic is listed under "unvisualizable topics".

In Rviz, I tried creating a topic of type MarkerArray and manually typing in the topic name to add it.  This does not work and I get the following error:

```<code>process[voxblox_node-2]: started with pid [18452]
[ INFO] [1523646547.806476760]: Opening /media/ubuntu/jetsontx2b/data/voxblox/data.bag
[ INFO] [1523646548.104770697]: Static transforms loaded from file.
T_B_D:
    0.971048      0.15701    -0.180038 -0.000432202
   -0.120915     0.973037     0.196415   -0.0522007
    0.206023    -0.168959      0.96385   -0.0341353
           0            0            0            1
T_B_C:1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
[ERROR] [1523646548.172363508]: Client [/rviz_1523646021870801813] wants topic /voxblox_node/mesh to have datatype/md5sum [visualization_msgs/MarkerArray/d155b9ce5188fbaf89745847fd5882d7], but our version has [voxblox_msgs/Mesh/ca70fabcc211b61f795cb5e7c8210eb6]. Dropping connection.
[ INFO] [1523646549.056998208]: Updating mesh.
</code>```

The Voxblox documentation states that the node voxblox_node publishes:

mesh of type visualization_msgs::MarkerArray. A visualization topic showing the mesh produced from the tsdf in a form that can be seen in RViz.

Why doesn't Rviz recognize mesh as a MarkerArray? What do I need to do to get Rviz to visualize /voxblox_node/mesh?

Thanks.

答: I had this problem too. You just have to source the corresponding setup.bash for the terminal that runs rviz and the /voxblox_node/mesh topic will be available to show in rviz.</p>


答:
So the doc's were out of date. I just updated them as the mesh is actually of type voxblox_msgs::MeshBlock. Voxblox use to output a standard MarkerArray, however this form of visualization means you have to output the entire mesh every time any part of it changes. This meant when running on a robot and visualizing on a laptop we were saturating our wifi connection to display even relatively small areas.

To correct this issue we made a custom message that supports partial updates only changing the mesh where needed. To use this custom message you have to build voxblox_rviz_plugin and have it in your workspace when running rviz.

Title: RViz: How to Visualize a Voxblox Mesh as a MarkerArray?

Body:
I am currently trying to run the test cow and lady dataset with Voxblox.  The process appears to execute properly in the terminal, but I cannot view the mesh in RViz.

When I try to add the topic voxblox_node/mesh to RViz, the topic name is greyed out and I cannot add the topic.  This topic is listed under "unvisualizable topics".

In Rviz, I tried creating a topic of type MarkerArray and manually typing in the topic name to add it.  This does not work and I get the following error:

```<code>process[voxblox_node-2]: started with pid [18452]
[ INFO] [1523646547.806476760]: Opening /media/ubuntu/jetsontx2b/data/voxblox/data.bag
[ INFO] [1523646548.104770697]: Static transforms loaded from file.
T_B_D:
    0.971048      0.15701    -0.180038 -0.000432202
   -0.120915     0.973037     0.196415   -0.0522007
    0.206023    -0.168959      0.96385   -0.0341353
           0            0            0            1
T_B_C:1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
[ERROR] [1523646548.172363508]: Client [/rviz_1523646021870801813] wants topic /voxblox_node/mesh to have datatype/md5sum [visualization_msgs/MarkerArray/d155b9ce5188fbaf89745847fd5882d7], but our version has [voxblox_msgs/Mesh/ca70fabcc211b61f795cb5e7c8210eb6]. Dropping connection.
[ INFO] [1523646549.056998208]: Updating mesh.
</code>```

The Voxblox documentation states that the node voxblox_node publishes:

mesh of type visualization_msgs::MarkerArray. A visualization topic showing the mesh produced from the tsdf in a form that can be seen in RViz.

Why doesn't Rviz recognize mesh as a MarkerArray? What do I need to do to get Rviz to visualize /voxblox_node/mesh?

Thanks.


问:
GraphSLAM data accumulation problem
I try to implement GraphSLAM from this tutorial, The GraphSLAM Algorithm with Applications to Large-Scale Mapping of Urban Structures. I have some doubt while studying this paper. I hope people who research on same field may solve my query.

As I don't know how to input notation in StackExchange editor I have uploaded a picture with my queries:

I have some questions, which are written in the images, at line numbers 11, 14, 19:

What is the dimension of this noise covariance matrix? If it is 3*3 then the dimension of the matrix is mismatched at line numbers 18 and 19

How to calculate $µ(j,x)$ and $µ(j,y)$?

What is the value of $z_t^i$?

I have some other doubts:

What is the need to use two for loop one line number 10 and another one at line number 12?

Is that use to change the value of $Q(t)$ in each iteration? How can all measurements and observed features be different from each other?

I am using this dataset, UTIAS Multi-Robot Cooperative Localization and Mapping Dataset, where there is a sensor measurement data set and odometry measurement dataset. They are two separate files. Their timestamp is also different. Their dataset is like that after 100 odometer data there is a data which observed a features. Then how could I relate these datasets with this algorithm?

答:
No:11 -> it is 3x3

No:19 -> $i_{th}$ measurement of $z_t$

What is the need to use two forloop one lineNo:10 and another one LineNo:1
-> Each feature $z_t$ have multiple observations $z_t^i$. First loop is for each feature and the other one for each observation of that feature.

Title: GraphSLAM data accumulation problem


问:
Vısual sensor.camera lenses with a field of view of more than 180 degree
What kind of camera models can be used for lenses with a field of view of more than 180 degree ?
Is ıt possible if not why?
Are fisheye lenses suitable for this purpose?</p>

答: Consider the alternate approach of using a parabolic mirror.  The advantage clearly bing cost and possibly operating under lower light conditions. The disadvantages include more distortion, seeing the camera in the mirror and larger over all space.</p>


答: Simple fisheye lens model will cover angles over 180 degrees. Fisheye lens model maps the incident angles into x,y coordinate on the image using a polynomial function. Thus, whatever the fov is, it does not matter, whereas the most common pinhole camera model cannot cover any lens around and over 180. A perfect solution for what you said.</p>

Title: Vısual sensor.camera lenses with a field of view of more than 180 degree

Body:
What kind of camera models can be used for lenses with a field of view of more than 180 degree ?
Is ıt possible if not why?
Are fisheye lenses suitable for this purpose?</p>


问:
MSP (Multiwii Serial Protocol) receiving data with pyMultiWii issue
I want to get telemetry data from my flight controller (Matek F405-CTR) and send control commands to it via MSP protocol.

I've already configured UART3 port on Matek in Inav configurator (look at pic).

Then I connected usb-serial converter (CP2102) to Matek on UART3 port for testing. So that, Matek controller is defined as COM3 on my PC and CP2102 as COM4

But when I'am trying to run simple test from pyMultiWii lib I get nothing from Matek controller neither from CP2102. I've tried this test for COM3 and COM4 ports as well.

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

"""show-attitude.py: Script to ask the MultiWii Board attitude and print it."""

from pymultiwii import MultiWii
from sys import stdout

if __name__ == "__main__":

    board = MultiWii("COM4")
    #board = MultiWii("COM3")
    try:
        while True:
            board.getData(MultiWii.ATTITUDE)
            #print board.attitude #uncomment for regular printing

            # Fancy printing (might not work on windows...)
            message = "angx = {:+.2f} \t angy = {:+.2f} \t heading = {:+.2f} \t elapsed = {:+.4f} \t".format(float(board.attitude['angx']),float(board.attitude['angy']),float(board.attitude['heading']),float(board.attitude['elapsed']))
            stdout.write("\r%s" % message )
            stdout.flush()
            # End of fancy printing
    except Exception as error:
        print("Error on Main: "+str(error))
</code>```

May be I'am doing something wrong? I've already read this post, but it dosn't help me. Any advice will be appreciated!

答:
Not exactly an answer, but I am unable to post a comment here.

Firstly, verify your baud rates (for Windows, make sure you have set the right baud rate in your device manager/properties window as well). Try using the MultiWiiConf, which is a GUI to monitor your flight data and check if it is able to establish communication with your flight controller board.

Coming back to your code, what happens when you try to retrieve the MSP_IDENT frame as mentioned here? I have written an alternate simple script here for Python, use the requestFrame method with the frame ID and see if it helps.

EDIT: It looks like the pyMultiWii library you are currently using supports only MSPv1. If your board uses MSPv2, the protocol is slightly different as in the link you have already posted in the question. You can use my library as refernece mentioned above to make changes as per MSPv2 protocol and give it a try.


问:
iRobot Create 2 - How did I get weird data from the serial port?
I'm new to Roomba Create2.

I just want the program to send and receive data of the bumper sensor only.

I tried this code on an Arduino Uno:

```<code>#include <SoftwareSerial.h>
#include "roombaDefines.h"
int rxPin = 10;
int txPin = 11;
int sensorbytes;
SoftwareSerial Roomba(rxPin, txPin);
void setup()
{
  Roomba.begin(19200);
  Serial.begin(9600);
  pinMode(ddPin, OUTPUT);
  wakeUp ();   // Wake-up Roomba
  startSafe(); // Start Roomba in Safe Mode
  setPowerLED(128, 255);
  delay(1000);
  setPowerLED(128, 0);
  delay(1000);
}
void loop()
{
  Roomba.write(142);
  Roomba.write(7);
  delay(100);
  sensorbytes = Roomba.read();

   if (sensorbytes!=0 )
   {
    setPowerLED(255,255);
    Serial.println(sensorbytes);
   }
   else
   {
    setPowerLED(255,0);
    Serial.println("not_Press");
   }
   delay(100);
}
</code>```

The robot code works fine for a period of time but after about two minutes I got some weird data from the robot (it shows in my serial monitor) and it makes my program seem to delay and crash.

So I tried to check where it comes from

```<code>void loop()
{

int i = 0;

  while(Roomba.available() ) {
    byte c = Roomba.read();
    sensorbytes = c;
    Serial.println(sensorbytes);
    i++;
  }
  delay(150);
}
</code>```

to check that the robot sends data via the serial port or not. Even if I don't command it, I get a packet of data, maybe every two minutes:

```<code>32
32
32
32
70
108
97
115
104
32
67
82
67
32
115
117
99
148
205
205
233
32
48
120
48
32
40
48
120
48
41
10
13
</code>```

and it is the same.  So I think that the Roomba Create2 will send data via the serial port every two minutes.

Can I avoid that data?

答:
You might want to take a look at the iRobot Create 2 OI spec
https://www.irobotweb.com/~/media/MainSite/PDFs/About/STEM/Create/iRobot_Roomba_600_Open_Interface_Spec.pdf

I'm using a different controller so I can't test your code. Just be sure you are set for 115,200 baud.

You might also want to try sending a 128,7 command to fully reset the Create 2 before starting to send your 142,7 sensor read command which should only return a single byte on every command

You might also want to send the recommended "start" command


问:
measuring gears for servo motors
I'm quite new to mechanical engineering and not familiar with gears and motors. A few days ago, I bought a second-hand GWS servo motor for my project, and it didn't include gears.

Can someone help me understand the correct measurement of my motor so I can buy the correct gear to fit on my servo motor. Specifically, the measurement of the gear hole:

答:
The output spline is generally proprietary, and will vary by manufacturer.

Measuring the diameter is generally not useful, although counting the teeth can help.  Really all you need to do is type the servo model number into google and see what arms match.

I did the legwork and the S35 uses the futuba spline, so any arm designed for a futuba servo in that size range will fit.

Title: measuring gears for servo motors


问:
What's the main difference between different motion capture systems (Vicon, Optitrack, etc)?
Last month I visited a quadrotor laboratory ($ 20m^2$ approx). They used both Optitrack and Vicon systems. However, they told me that Vicon cost 10 times as much as Optitrack. Considering that any system of motion capture relies on the same principles of IR markers, which might be the reason for this difference in price?</p>

答:
This comes mostly from two things, the hardware and the software composing these systems.

The hardware, mostly what are capable of the 'cameras' used.

The second one is the software, that include calibration algorithms (different speed of calibration and accuracy), reconstruction algorithms (how many marker per object, accuracy of the body reconstruction), exportation format (how many bodies, single markers, in which format).

It boils down that Optitrack is good enough for UAV flight, but that over activities have different requirement which are met best by Vicon.


问:
Create 2 losing serial communication after toggling full to passive while charging
We are having an issue where after toggling the create 2 from passive to active, then waiting a few seconds and toggling back to passive while on the charger, all serial communication fails a certain percentage of the time. (Links to images of current and serial communication down below illustrating it).

Detail

We are working to have the Create 2 power a NUC, auto-charge and stay alive for long (multi-month) periods of time.

Because we are taking power directly off of the battery (Need higher current), we found that we have to toggle the mode from passive to full and back so that it checks the voltage and goes back from trickle charge to full charging if it has been a few hours and the computer has discharged the battery. This is because the trickle charge algorithm does not check voltage as it assumes the load on the roomba is not high enough to discharge.

We started with it failing this way and have now verified that if we just plug a laptop into the create through the usb serial cable with nothing else plugged in and then toggle passive/full/wait/passive, a percent of the time we also get comm failures without any separate hardware.

Because the create 2 turns off after 5 minutes of no communication, we have tried toggling it every 4 minutes and see that reliably happening, so this is not an issue where the create 2 is just going into sleep mode.

Reproducibility

We are seeing a very repeatable issue where the serial communication (Using current generation USB serial cable from iRobot) loses serial communication with the robot some percentage of the time exactly at the point where it starts charging the robot again. After that, no packets come in from the robot for a long while. Some time later, when we have repeatedly tried to toggle from passive to full and back, communication re-appears.

We have verified this using the ROS stack (create_autonomy) and also by directly echoing characters on the command line echo -e "\x07" > /dev/ttyUSB0 to reset things.

When it is in this state, no software resets work, unplugging and replugging the serial cable does not work, etc. We have to take it off the charger physically (or wait for a long time until our system toggles it again and it does work.

We have verified that this occurs (When the create 2 is on its charger) on:

Mac only plugged in over the create cable with no power taken from the system.

NUC taking power directly off the battery through a dc/dc converter.

NUC taking power off an intermediate battery charging from the create.

Mitigating it

We have added ferrite beads on all the cables to mitigate any high frequency noise and that does not seem to solve it either.

We have also tried 3 different create cables w/ different serial/usb chips and even built our own from scratch and not fixed it.

We have tried separately powered usb hubs, unpowered ones and plugging directly in to the computer.

We have tried it on 3 separate create 2's.

I have attached links below with graphs of the output data when it fails. When there is a straight line on current/voltage, that is repeated data, showing that it was stuck and not updating. It always happens right when the system steps up the current to start charging again, so it seems to be linked to a current spike - but only breaks it 1 / 5 or 10 times - it just happens that once broken, it stays that way for a very long time.

Communication fails after multiple successful toggles

Detail showing exactly when communication fails

After many minutes, it is working again

When it has been broken, I have tried turning off our software and addressing the system by echoing data to it directly for OI to turn off, on, reset, etc and do not see communication resume correctly.

If we unplug the roomba from the charger by hand (pull it off), then many times it does work, but not always. If we then reset everything by holding down the buttons, it does seem to work 95% of the time and sometimes we have even had to pull the battery itself to make it work.

If someone has encountered this before, advice would be helpful. We had thought that it was ground loop issues, but given it is on so many different cables, roombas, power situations and compute devices, we are trying to figure out what is fundementally wrong with our setup.

Thanks!

答:
There is a bug in the implementation of sleep/wakeup on Create 2 which was fixed in release-3.8.2 for robots with an older processor, or release-stm32-3.7.7 for robots with a newer processor. To receive a code update that will (hopefully) fix your issue, please e-mail create@irobot.com, referencing this post.

Please note that while I'm an iRobot employee, the postings on this site are my own and don't necessarily represent iRobot's positions, strategies, or opinions.


问:
How can I get the right sample in RRT star Dubins?
I am trying to find a solution in S(1)*R^2 (x,y, orientation) with obstacles (refer to image) using RRT star and Dubins Model.

The code takes a lot of time to find a suitable random sample with x,y, theta such that a successful Dubins path can be connected between the two points without the vehicle (a rectangle colliding any of the obstacles). The fact that the random sample needs to be at the correct angle so that the vehicle's path is collision free is 1 out of 100,000 random samples. This makes the code very slow even when my computer is at its full processing power. None of my internal codes take much time. I timed all of them, only the fact of achieving that 1 out of 100,000 sample causes the code to take so much time. I tried decreasing my discretization space by half but the problem still exists.

答:
Apart from the fact that the collision-free region looks pretty tight, one of the main reasons why you got very few usable samples is that a connection attempt is made directly between a node in the tree and the sampled configuration. Due to that, in order for a sampled configuration to have any chance at all of a successful connection, it has to have its x and y coordinates being on the gray area, which is already relatively small compared to the whole map. Even when you have a sampled configuration falling in the gray area, you still need to take care of the rotation as well as making sure that those configurations can be connected by a relatively constrained Dubin path.

A better approach would be making use of a steering function. (Actually the RRT$^*$ paper also describes this a bit.) To make the point, let's consider when we use a straight line to connect two configurations. Let's say a sampled configuration is $q_\text{rand}$ and its nearest neighbor on the tree is $q_\text{near}$. Instead of connecting $q_\text{near}$ directly to $q_\text{rand}$, you try to connect $q_\text{near}$ to some $q'$ that lies on the straight line connecting $q_\text{near}$ and $q_\text{rand}$ but is closer to $q_\text{near}$. This is kind of steering a configuration from $q_\text{near}$ towards $q_\text{rand}$. It will increase the chance of success as it is not too greedy to always try to go all the way to a sampled configuration.

Of course, with Dubin paths, the actual implementation details are definitely going to be different. But the core idea stays the same: limit the RRT extension to be some step size from existing nodes on the tree.


问:
How to design a differential steering mechanism?
I want to give my robot a differential mechanism for the system of turning and steering. Considering the case of turning a right-angled corner, the robot will achieve this by following a gradual circular arc through the intersection while maintaining a steady speed. To accomplish this end, we increase the speed of the outer wheel while slowing that of the inner. But supposing i want the turn to be within a definite radius, how do i calculate what ratio the 2 speeds have to be in? Can someone give me an insight into this?

What Ive done is this, although I have my doubts.

If the speed of the right wheel is $V_r$ and the speed of the left wheel is $V_l$, then the ratio of their speeds while turning will be equal to the ratio of the circumferences of their corresponding quadrants.

Therefore
$$V_r :V_l =\frac{r+A}{r}$$

Is this right? I have a sinister feeling Im missing something out..

答:
Your intuition is correct.  We can look at the difference in arc length that each wheel will roll for a given sector (specified by $\theta$ in degrees).

$$d_l = \frac{\theta*2\pi{r}}{360}$$
$$d_r = \frac{\theta*2\pi(r+A)}{360}$$

This simplifies to:

$$ \frac{d_r}{d_l} = \frac{\frac{\theta*2\pi(r+A)}{360}}{\frac{\theta*2\pi{r}}{360}} = \frac{r+A}{r}$$

Speed is just distance over time:

$$ \frac{V_r}{V_l} = \frac{d_r/t}{d_l/t} = \frac{r+A}{r}$$

OwnerDisplayName: Ghost


问:
ROS: Human to Robot Mapping (Baxter)
I'm having some difficulties understanding the concept of teleoperation in ROS so hoping someone can clear some things up.

I am trying to control a Baxter robot (in simulation) using a HTC Vive device. I have a node (publisher) which successfully extracts PoseStamped data (containing pose data in reference to the lighthouse base stations) from the controllers and publishes this on separate topics for right and left controllers.

So now I wish to create the subscribers which receive the pose data from controllers and converts it to a pose for the robot. What I'm confused about is the mapping... after reading documentation regarding Baxter and robotics transformation, I don't really understand how to map human poses to Baxter. I know I need to use IK services which essentially calculate the co-ordinates required to achieve a pose (given the desired location of the end effector). But it isn't as simple as just plugging in the PoseStamped data from the node publishing controller data to the ik_service right?

Like a human and robot anatomy is quite different so I'm not sure if I'm missing a vital step in this.

Seeing other people's example codes of trying to do the same thing, I see that some people have created a 'base'/'human' pose which hard codes co-ordinates for the limbs to mimic a human. Is this essentially what I need? Any insight is very much appreciated!

答:
I answered your question on stack overflow: https://stackoverflow.com/questions/51385737/ros-human-robot-mapping-baxter

You might find my former student's work on motion mapping using a kinect sensor with a pr2 informative.  It shows two methods:

Direct joint angle mapping  (eg if the human has the arm in a right angle then the robot should also have the arm in a right angle).

An IK method that controls the robot's end effector based on the human's hand position.

I know I need to use IK services which essentially calculate the
  co-ordinates required to achieve a pose (given the desired location of
  the end effector). But it isn't as simple as just plugging in the
  PoseStamped data from the node publishing controller data to the
  ik_service right?

Yes, indeed, this is a fairly involved process!  In both cases, we took advantage of the kinects api to access the human's joint angle values and the position of the hand.  You can read about how Microsoft research implemented the human skeleton tracking algorithm here:

https://www.microsoft.com/en-us/research/publication/real-time-human-pose-recognition-in-parts-from-a-single-depth-image/?from=http%3A%2F%2Fresearch.microsoft.com%2Fapps%2Fpubs%2F%3Fid%3D145347

I am not familiar with the Vive device. You should see if it offers a similar api for accessing skeleton tracking information since reverse engineering Microsoft's algorithm will be challenging.

Title: ROS: Human to Robot Mapping (Baxter)


问:
Understanding MoveIt! and OMPL more deeply
I wanted to know the actual mathematics behind the path planners MoveIt! uses for manipulators from OMPL. I tried to look into source codes but couldn't get enough details.

I wish to know:

How cost function is implemented, i.e., how path cost is calculated in configuration space. It can't be Euclidean distance I guess?! So what is it.

How Sampling is done. A sampler is called in the src files but i couldn't get the details. Is it done in configuration space or workspace or both can be done?

What is the exact pipeline? Like after sampling(depending on state space), is inverse kinematics implemented to get into configuration space or foward-kinematics is implemented to get into work space and such details. Which is the better option?

Actually I wish to implement my own algorithm (like some variation of RRT) without MoveIt!/OMPL hence it is important for me to know all the details.

I am really confused about this. Any explanations or links where I can find the details and understand them would be really helpful.

答:
Actually I wish to implement my own algorithm (like some variation of
  RRT) without MoveIt!/OMPL hence it is important for me to know all the
  details.

I am really confused about this. Any explanations or links where I can
  find the details and understand them would be really helpful.

OMPL and MoveIt have a ton of features that are already implemented so you don't have to do that.  However, that has made the software too large to quickly comprehend if you don't know about the underlying algorithms.  Instead of learning more about their implementation and methods, I recommend you go directly to the original source!

Check out the textbook Planning Algorithms by Steven LaValle.  The whole text is available online for free, but I have my own copy and it's literally sitting on my desk right now (lol).  http://planning.cs.uiuc.edu/

Simple RRT in python

On LaValle's website he has very simple RRT code that you can run in python right away.
http://msl.cs.uiuc.edu/~lavalle/code.html
http://msl.cs.uiuc.edu/~lavalle/sub/rrt.py


问:
6 motors with TB6612 driver + power requirements
I am looking at the ServoCity Bogie platform - it comes with 6 motors.

The motor listed specs are:

Suggested Voltage: 4.5 VDC

No Load Current: 190 mA

Max. Load Current: 250 mA

I was planning on using Adafruit's TB6612 based solution - it can handle "Power Supply current VM=15V max;  Output current - IOUT=1.2 A(ave) / 3.2 A (peak)"

My questions are:

Can I combine each side's 3 motors into 1 H-Bridge?

I assume so, and I would wire it in parallel. Is it then simply 3x250 mA = 750 mA draw?

How do I calculate the battery voltage requirement?

A bonus question - The Feather board linked above has two of these chips; can I bridge the H-Bridge outputs to allow for a double amperage output?

H-Bridge => 2 outputs parallel => 3 motors in parallel.

If so, this would allow for slightly more powerful motors in the future.

答:
Yes, You can combine each side's motors.

Yes, a parallel connection is proper one. Therefore, Your calculation of current drawn is also correct.

I don't see any strong need for calculation of the battery voltage. I'd rather consider calculation of battery capacity, as it will affect your working time, thus changing possible range of Your robot. I'd suggest using LiPo or LiIon batteries - these types of batteries offer slightly lower voltage than 4.5V, but have great energy density.

Bonus question: Yes, You can double Your H-bridge current by bridging its outputs. This is often used in minisumo category robots to drive more powerful motors. To do this, you should also bridge correct input pins: A_PWM with B_PWM, A_IN1 with B_IN1 and A_IN2 with B_IN2.


问:
How can I get Windows Kinect working on Angstrom on Beaglebone?
I have tried following a number of guides on the internet but most of them fall down as libfreenect does not exist in opkg, which is the apt-get of Angstrom. Has anyone got it working and if so what is the method?</p>

答: If someone gets an error relating to missing GLUT_Xmu_LIBRARY stuff after running "cmake .." using Tom Bamber's instructions just install "sudo apt-get install libxmu-dev libxi-dev" and then cmake should work now.</p>


问:
Matrix is singular error in GraphSLAM
I have gone through The GraphSLAM Algorithm with Applications to Large-Scale Mapping of Urban Structures. I implemented the code for GraphSLAM. The fundamental formula of GraphSLAM is

$$\mu = \Omega^{-1}\xi$$

When I inverse $\Omega$ it gives me an error that Matrix is singular.

In the above document there are some hints how to avoid this error. But I failed to understand that. On the eighth page of the above document - on page 410 - they discuss it in section 4. The GraphSLAM Algorithm portion. If anybody can understand it, please help me to understand.

From the text:

In particular, line 2 in GraphSLAM_linearize initializes
  the information elements. The “infinite” information entry in
  line 3 fixes the initial pose $x_0$ to (0 0 0)$^T$ . It is necessary, since
  otherwise the resulting matrix becomes singular, reflecting the
  fact that from relative information alone we cannot recover
  absolute estimates.

I added my code here for better understanding

```<code>import java.io.IOException;
import org.ujmp.core.SparseMatrix;
import org.ujmp.core.Matrix;

import java.io.File;
import java.util.Scanner;

public class Test1 {
public static void main(String args[]) throws IOException {
    Matrix omega = SparseMatrix.Factory.zeros(5, 5);
    Matrix Xi=SparseMatrix.Factory.zeros(5,1);
    int i = 0, i1 = 0, k1 = 0, k2 = 0,l=0,l1=0;
    double[] timex = new double[5];
    double[] forwardx = new double[5];
    double[] angularx = new double[5];
    double[]x1=new double[5];
    double[]y1=new double[5];
    double[]theta1=new double[5];
    double []landx=new double[2];
    double[]landy=new double[2];
    double[] timeya = new double[2];
    double[] codea = new double[2];
    double[] rangea = new double[2];
    double[] bearinga = new double[2];
    Scanner x = new Scanner(new File("/home/froboticscse/IdeaProjects/UJMPtest/src/main/java/a.txt"));
    Scanner y = new Scanner(new File("/home/froboticscse/IdeaProjects/UJMPtest/src/main/java/b.txt"));
    while (x.hasNext()) {

        double time = x.nextDouble();
        double forward = x.nextDouble();
        double angular = x.nextDouble();
        timex[i] = time;
        forwardx[i] = forward;
        angularx[i] = angular;
        x1[i]=((forwardx[i]*0.006+Math.cos(0+(angularx[i]*0.006)/2)));
        y1[i]=((forwardx[i]*0.006+Math.sin(0+(angularx[i]*0.006)/2)));
        theta1[i]=(angularx[i]*0.006);
        i++;
    }

    while (y.hasNext()) {
        double timey = y.nextDouble();
        double code = y.nextDouble();
        double range = y.nextDouble();
        double bearing = y.nextDouble();
        timeya[i1] = timey;
        codea[i1] = code;
        rangea[i1] = range;
        bearinga[i1] = bearing;

        i1++;

    }
    while (k1 < timex.length && k2 < timeya.length) {
        if (timex[k1] < timeya[k2]) {
            omega.setAsDouble(1, k1, k1);
            omega.setAsDouble(1, k1, k1 + 1);
            Xi.setAsDouble(x1[l],k1,0);
            k1++;
            l++;
        } else if (timex[k1] == timeya[k2]) {
            landx[l1]=x1[k1]+rangea[k2]*(Math.cos(bearinga[k2]+theta1[k1]));
            omega.setAsDouble(1, k1, k2);
            omega.setAsDouble(1, k2, k1);
            Xi.setAsDouble((landx[l1]+x1[l1]),k1,0);
            k2++;
            l1++;
        } else {
            System.out.println("Nothing to add");
        }
       // System.out.println(Xi);
    }
    System.out.println(omega);
   /* Matrix mu=omega.inv().mtimes(Xi);
    System.out.println(mu);*/
}
</code>```

}

答:
Due to singularity in matrix (i.e. the condition of matrix during which determinant of matrix becomes zero), matrix cannot be inverted.

So you can possibly try pseudo-inverse. It gives most approximated form of inverse matrix. For more information visit this link: https://en.wikipedia.org/wiki/Moore%E2%80%93Penrose_inverse

Title: Matrix is singular error in GraphSLAM