答:
The question makes you reflects on the meaning of the transform matrix (which construction process w.r.t. DH parameter is given).

A transformation matrix denotes the transformation from one frame to the next, by mean of both a rotation matrix ($R$) of the second frame w.r.t the first frame expressed in the first frame, and a position vector ($p$) of the second frame origin expressed in the first frame.

The transformation matrix is constructed as follows:
$T=\begin{bmatrix} R & p \\ 0~0~0 & 1 \end{bmatrix}$

Thenn what I would do, although it is bit unclear from the formulation, I would suspect that the information given relative to the distance between link 2 and 5 (is 5 the end effector?) are given in the base frame (0), otherwise the information relative to $^2_5T$ are not useful.
From there using the transformation matrix at hand and considering the suggested vector you get a system of equations.

That gives you relationships between all the mentioned quantities, but there I am blocked by the information concerning the the $y$ component of the position of end-effector w.r.t 2 expressed in 0, as it didn't match my result and left me with $d_5$ unknown (same if I make the assumption that the information about the vector are expressed in 2). Although if the vector component information concerns $x$ than it is possible to get a numerical evaluation of $d_3$.

NOTE: done during my coffee break

Title: Denavit-Hartenberg Exam Question

Body:
I am having a bit of trouble with the pictured question:

I am able to do part a and b, however c is proving very difficult. My lecturer never really explained much beyond what is asked in a and b. Any hints about how to do it would be greatly appreciated. I have looked at inverse kinematics but that seems to be for determining the angles of the joints, not the length of links and distances.

Thanks in advance for any help!

Paul

Here is the diagram of the robot also:


问:
Radio triangulation with Raspberry Pi
Currently, I am thinking that since electromagnetic waves loose energy over distance, you might be able to figure out the relative distance to each of three radio "beacons" and use this information to triangulate the position of a Raspberry Pi robot with a radio sensor on-board.

What kind of radio receiver may I need to use, and what information about the radio signal could I use to calculate the distance to the beacon? Amplitude, perhaps? The entire system would be running indoors as an Indoor Positioning System.

In short, my question is what specific type of radio receiver would be adequate for using radio signal strength for triangulation. If amplitude contains the information of the strength of the signal, then I need a sensor that is sensitive enough to pick that up, and can provide amplitude readings in the first place.

答:
I believe there has been some research done on robot localization based on Wifi signal strength.  For example: http://robotics.usc.edu/~ahoward/projects_wifi.php and http://www.cs.cmu.edu/~mmv/papers/10icra-joydeep.pdf.  But I believe accuracy is very rough (maybe meters of error).

For more precise radio localization (cm level), you can use ultrawideband (UWB) radios which can measure the time of flight between endpoints.  Yes, there are multipath issues indoors, but there are ways to mitigate this.  There are two main players here: https://www.decawave.com/ and http://bespoon.com/.

Also FYI, triangulation is when you know the angle to the fixed beacons, trilateration is when you know the range.  See: https://en.wikipedia.org/wiki/Trilateration.  Your proposed application would be trilateration.

ContentLicense: CC BY-SA 4.0

Title: Radio triangulation with Raspberry Pi


问:
Finding relative location of Raspberry Pi robot indoors
I would like to have a Raspberry Pi robot that can find its location in a room relative to an origin point.

What methods would be cheapest?

What would the most accurate be?

Are there any others that might be in a sweet spot between the two that I should look into?

答:
For high cost and high accuracy, you can use motion capture systems such as https://www.vicon.com/, https://optitrack.com/, or http://phasespace.com/.  These systems will typically have a dedicated (Windows) computer driving the cameras.  You will have some code to write to pull this data out and transmit to the robot (if that is where you want it).  On the plus side, the hardware on the robot is minimal, just a few retro-reflector spheres or LEDs.

For even higher cost and higher accuracy, you can use a laser based metrology system such as: https://www.nikonmetrology.com/en-us/product/igps or http://www.hexagonmi.com/products/laser-tracker-systems.

A camera and known-location fiducials like ARTags is another option.  Accuracy depends on the number and size of fiducials, and how much effort you put into to calibrating your camera and locations of landmarks.

UWB radios which can measure the time of flight between endpoints is another option. There are two main players here: https://www.decawave.com/ and http://bespoon.com/.  Accuracy will depend on number and placement of beacons.


问:
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 have used a VN-100 IMU to replace an old one (which could be quite inaccurate).

My experience with the VN-100 is quite good. It includes an internal Kalman filter to estimate pitch, roll and yaw (using magnetic sensors), and you can tune the gains on the Kalman filter yourself. How they should be tuned will depend on your application (eg. vibration, usual rates of rotation and acceleration).

My experience is that it is easily within 1 degree accuracy, and if tuned well, can be almost 0.1 degree accuracy. Having said that, it requires the use of the active tuning parameter (depending on how far acceleration differs from gravity). While I have looked closely at the angular position data, I have not specifically investigated the accuracy of the acceleration or angular rate data (although I have some data, but I used encoders as a ground truth, and differentiation makes the encoder data too noisy to compare).

Things you might want to consider:

It is definitely a bonus to be able to tune the Kalman filter gains. If the gains are not well tuned, even good raw data can result in inferior filtered data.

Other than that, sampling time may be important (if you want samples at a high frequency - the VN-100 has a maximum frequency of 200Hz).

Consider the communication protocol (the VN-100 supports RS-232, or SPI with the SMD package). With RS-232, you will want to consider the maximum rate available on your DAQ system, eg. 460kHz baud rate is required to get data at 200Hz, otherwise you will not get all the data at such a high frequency

Size? Our old IMU was quite large (5cm), but the VN-100 is tiny.

Magnetic sensors - if you want yaw position data, but be aware that motors in close proximity (depends on the size of motors, but perhaps within 10cm or more) will stop them working.

Kalman filter - unless you want to process the data yourself

ContentLicense: CC BY-SA 3.0


问:
Extrinsic Calibration Target Depth Camera
What's a good calibration object for the extrinsic calibration (rotation + translation) of a depth camera (no color sensor, only depth)? With RGB, people seem to typically use chessboard pattern or some kind of markers. Is there something similar that would work without RGB?

答:
You can use a 3d Marker, e.g. a cube or a another arrangement of three planes. Finding these planes in the Pointcloud/Depth Image is not hard and provides a 6D Pose (if you can distinguish the planes which can be done by using non-90-deg angles). </p>

<p>If you also add visual markers (e.g. checkerboard pattern) to the planes, you can first use a 2d Camera to measure the relative poses of the planes. </p>

Body:
You can use a 3d Marker, e.g. a cube or a another arrangement of three planes. Finding these planes in the Pointcloud/Depth Image is not hard and provides a 6D Pose (if you can distinguish the planes which can be done by using non-90-deg angles).

If you also add visual markers (e.g. checkerboard pattern) to the planes, you can first use a 2d Camera to measure the relative poses of the planes.


问:
How to transfer motion between these two parts?
I'm trying to model this arm and I'm having a problem knowing what way could I use to make the red part always parallel to the surface of the table

答: I believe what you are looking for is a 4 bar linkage.  When opposite links are equal in length, they stay parallel.  </p>


问:
How can i connect two adafruit 16-channel 12-bit PWM/Servo Driver I2C interface (pac9685) to Raspberry or Arduino
I need to control 24 servos but I do not know how to do with I2C.
I saw some componentes that do it with USB, but I need to do it with I2c.

I am working in a robot with 8 legs and 3 degree of freedom in each leg, so i need to connect and control 24 servos to any arduino board, could be possible with an arduino mega and a sensor shield like that show in https://arduino-info.wikispaces.com/SensorShield but I want to do it using two "16-channel servo  drive" like this https://www.adafruit.com/product/1411, each of these can control 16 servos using only 2 pins from the board and it is “Chain-able” design so i could connect 2 of this to an Arduino Uno board or Raspberry but I do not know how to do.
Any one can help me with I2C chains connections.

答:
Adafruit has versions for both the Pi and the Arduino. Right in the web page describing each product they state you can stack up to 62 shields (or hats). Nobody would really do that, but it is obviously made for such abuse.

You'd have to either use right-hand headers or else solder the ends of the servo wires to the board.

I do with they'd been able to get 18 on a board because hexapods require 18. But then I'd always want another one. They're like Lays potato chips. :)

And Adafruit has the libraries for this.


问:
Pole placement of the observer closed loop system (A-LC) in discrete system
*I'm rewriting the question after I deleted the previous one because I wasn't clear enough. Hope it's fair

Given a system of the general form:

\begin{align}
x_{[k+1]} &= A\,x_{[k]} + B\,u_{[k]} \\
y_{[k]} &= C\,x_{[k]} + D\,u_{[k]}
\end{align}

I would like to know how I should place the poles for the closed-loop observer system $A−L\,C$.
I know that the observer has to be faster than the real system poles so the poles of $A-LC$ should be more close to zero than $A+B\,K$. But I don't know about any other constraint of the position. If there isn't any other bound why we don't place the poles at 0 and make $A-L\,C$ converge in one step?

答:
For LTI systems you can design the observer and state feedback separately, due to certainty equivalence. So the observer does not have to be faster then the state feedback in order to ensure stability.

Often a system will have input constraints (such as saturation), which will indirectly place constraints on $K$. However for your observer model there are no such constraints, so it is possible to place the observer poles closer to the origin then the state feedback poles.

However placing the observer poles much closer to the origin gives less and less performance gains, since the error dynamics will eventually be dominated by the slowest pole (usually from the state feedback). Another side effect of placing the observer poles closer to the origin is that the start up transient often has a bigger overshoot compared with slower observer poles.

Another important aspect which can be taken into consideration is the effects of noise/disturbances on the system, because a fast observer might amplify those more than a slower observer.


问:
What materials can I put in front of a RGB camera and LED IR lights to hide the sensors as much as possible?
I'm making a consumer camera prototype and want to make the front look as clean as possible. Right now I use a completely transparent material and the camera and the IR Lights (with their red hue) are clearly visible. I'd like to move to a dark (as black as possible) material that makes the cover look flush and hides the sensors as much as possible.

What materials should I consider, if I want to minimize the impact on what the sensors perceive?

答:
How about a cloth mesh. It won't cover up things as well as a dark plastic would, but it might be a good compromise between hiding things and still allowing the camera to work.

It will, however, block some of the light.


问:
Arduino RC Kids Ride-On car: wiring help needed
I am wiring up a kids ride-on toy (Powerwheels) to control both speed and steering with an Arduino. The ultimate goal is to have the Arduino take analog inputs from the driver (steering and acceleration) as well as digital inputs from a Radio Control source. The Arduino will combine these inputs such that the Radio inputs override the driver, but otherwise the driver is free to operate the vehicle.

The vehicle is driven by 2 motors, Fisher Price part 00968-9015. From what I can find on the internet they are 12v DC brushed motors that run @ 1.25amps with no load, and supposedly hit 70 amps during stall.

I plan to drive the motors with the Actobotics Dual Motor Controller in split mode. Channel 1 will operate Steering with a 4" Stroke 25 lb Thrust Heavy Duty Linear Actuator from #ServoCity. Channel 2 would operate the above mentioned set of Fisher Price motors.

I have 2 SLA batteries that are connected in parallel for longer run time while maintaining a 12v output. The positive(+) terminal goes through a 30Amp DC circuit breaker before going to the rest of the system.

I'm a software engineer so programming the Arduino isn't a concern, but the I have to admit I'm out of my comfort zone with wiring and electronics. I could use any input on the wiring of this project. If I'm wiring something wrong, or should be using other/different components - suggestions are welcome!

Question 1: Can I run two 12v motors in parallel on channel 2 of the Actobotics Dual Motor Controller from #ServoCity? (can Channel 2 handle that load)

Question 2: Will the parallel 12v SLA batteries (as shown) be sufficient to run both motors, the Linear Actuator and an Arduino without any problem or is there a more appropriate power configuration? I would like to avoid making the worlds slowest Powerwheels car.

Thanks!

#Actobotics
 #ServoCity

答:
I suspect that you will need a more powerful motor controller. This one is a 10 amp controller, and I suspect that the motors will have a higher stall amperage than that.

The RoboClaw 2x30 amp motor controller is the minimum I'd use, and can be bought from the same place (I use ServoCity as well). I might go up to the 45 amp version. I build robots that are much lighter than this car (with kid) and i use the 45 amp version. But I often over-build so that my bot's don't set themselves on fire.

For steering I think I'd use a small electric motor like this one for the steering. I'd either use a belt that could slip or a 3d-printed gear that would break if there was too much resistance. Or I'd find the plans for a slip-clutch to make sure that the motor won't use more torque than X, where X is an experimentally determined value. I'd put the steering motor behind the dash panel so that the kids can't get their fingers caught in the belt or gear.


问:
Help to get robot jacobian from system of implicit equations
I have system of two equations that describes position of robot end-effector ($X_C, Y_C, Z_C$), in accordance to prismatic joints position ($S_A, S_B$):

$S^2_A - \sqrt3(S_A + S_B)X_C = S^2_B + (S_A - S_B)Y_C$

$X^2_C + Y^2_C + Z^2_C = L^2 - S^2_A + S_A(\sqrt3X_C + Y_C)+M(S^2_A+S_BS_A + S^2_B)$

where M and L are constants.

In paper, author states that differentiating this system at
given point ($X_C, Y_C, Z_C$) gives the "differential relationship" in form:

$a_{11}\Delta S_A + a_{12}\Delta S_B = b_{11}\Delta X_C + b_{12}\Delta Y_C + b_{13}\Delta Z_C$

$a_{21}\Delta S_A + a_{22}\Delta S_B = b_{21}\Delta X_C + b_{22}\Delta Y_C + b_{23}\Delta Z_C$

Later on, author uses those parameters ($a_{11}, a_{12}, b_{11}...$)
to construct matrices, and by multiplying those he obtains Jacobian
of the system.

Im aware of partial differentiation, but I have never done this for system of equations, neither I understand how to get those delta parameters.

Can anyone explain what are the proper steps to perform partial differentiation
on this system, and how to calculate delta parameters?

EDIT

Following advice given by N. Staub, I differentiated equations w.r.t time.

First equation:

$S^2_A - \sqrt3(S_A + S_B)X_C = S^2_B + (S_A - S_B)Y_C$
$=>$

$2S_A \frac{\partial S_A}{\partial t} -\sqrt3S_A \frac{\partial X_C}{\partial t} -\sqrt3X_C \frac{\partial S_A}{\partial t} -\sqrt3S_B \frac{\partial X_C}{\partial t} -\sqrt3X_C \frac{\partial S_B}{\partial t} = 2S_B\frac{\partial S_B}{\partial t} + S_A\frac{\partial Y_C}{\partial t} + Y_C\frac{\partial S_A}{\partial t} - S_B\frac{\partial Y_C}{\partial t} - Y_C\frac{\partial S_B}{\partial t}$

Second equation:

$X^2_C + Y^2_C + Z^2_C = L^2 - S^2_A + S_A(\sqrt3X_C + Y_C)+M(S^2_A+S_BS_A + S^2_B)$ $=>$

$2X_C \frac{\partial X_C}{\partial t} + 2Y_C \frac{\partial Y_C}{\partial t} + 2Z_C \frac{\partial Z_C}{\partial t} = -2S_A \frac{\partial S_A}{\partial t} + \sqrt3S_A \frac{\partial X_C}{\partial t} +\sqrt3X_C \frac{\partial S_A}{\partial t} + S_A \frac{\partial Y_C}{\partial t} + Y_C \frac{\partial S_A}{\partial t} + 2MS_A \frac{\partial S_A}{\partial t} + MS_B \frac{\partial S_A}{\partial t} + MS_A \frac{\partial S_B}{\partial t} + 2MS_B \frac{\partial S_B}{\partial t}$

then, I multiplied by $\partial t$, and grouped variables:

First equation:

$(2S_A -\sqrt3X_C - Y_C)\partial S_A +(-2S_B -\sqrt3X_C + Y_C)\partial S_B =  (\sqrt3S_A +\sqrt3S_B)\partial X_C + (S_A - S_B)\partial Y_C$

Second equation:

$(-2S_A+\sqrt3X_C+Y_C+2MS_A + MS_B)\partial S_A + (MS_A + 2MS_B)\partial S_B = (2X_C-\sqrt3S_A)\partial X_C + (2Y_C-S_A)\partial Y_C + (2Z_C)\partial Z_C$

therefore I assume that required parameters are:

$a_{11} = 2S_A -\sqrt3X_C - Y_C$

$a_{12} = -2S_B -\sqrt3X_C + Y_C$

$a_{21} = -2S_A + \sqrt3X_C + Y_C + 2MS_A + MS_B$

$a_{22} = MS_A + 2MS_B$

$b_{11} = \sqrt3S_A +\sqrt3S_B$

$b_{12} = S_A - S_B$

$b_{13} = 0$

$b_{21} = 2X_C - \sqrt3S_A$

$b_{22} = 2Y_C - S_A$

$b_{23} = 2Z_C$

Now. According to paper, jacobian of the system can be calculated as:

$J = A^{-1} B$,
where

$A=(a_{ij})$

$B=(b_{ij})$

so I im thinking right, it means:

$$
A =
    \begin{matrix}
    a_{11} & a_{12} \\
    a_{21} & a_{22} \\
    \end{matrix}
$$

$$
B =
    \begin{matrix}
    b_{11} & b_{12} & b_{13} \\
    b_{21} & b_{22} & b_{23} \\
    \end{matrix}
$$

and Jacobian is multiplication of reverse A matrix and B matrix.

Next, author states that Jacobian at given point, where

$X_C = 0$

$S_A=S_B=S$

$Y_C = l_t-\Delta\gamma$

is equal to:

$$
J =
    \begin{matrix}
    \frac{\sqrt3S}{2S-l_t+\Delta\gamma} & -\frac{\sqrt3S}{2S-l_t+\Delta\gamma}\\
    \frac{2(l_t-\Delta\gamma)-S}{6cS-2S+l_t-\Delta\gamma} & \frac{2(l_t-\Delta\gamma)-S}{6cS-2S+l_t-\Delta\gamma} \\
    \frac{2Z_C}{6cS-2S+l_t-\Delta\gamma} & \frac{2Z_C}{6cS-2S+l_t-\Delta\gamma} \\
    \end{matrix} ^T
$$

Everything seems fine. BUT! After multiplicating my A and B matrices I get some monster matrix, that I am unable to paste here, becouse it is so frickin large!
Substituting variables for values given by author does not give me proper jacobian (i tried substitution before multiplying matrices (on parameters), and after multiplication (on final matrix)).
So clearly Im still missing something. Either Ive done error in differentiation, or Ive done error in matrix multiplication (I used maple) or I dont understand how to subsititue those values. Can anyone point me in to right direction?

EDIT
Problem solved! Parameters that I calculated were proper, I just messed up simplification of equations in final matrix. Using snippet from Petch Puttichai I was able to obtain full Jacobian of system. Thanks for help!

答:
Recall that the Jacobian can be interpreted as the matrix which maps the joint velocity to end-effector velocity.

$ \dot{x} = J(\theta)~\dot{\theta} $

In your case $x = [x_c,y_c,z_c] $ (prefer lower case for vectors and scalar) and $\theta = [s_A,s_B] $.

If you differentiate the system as suggested you should get the second set of equations with $\Delta s_A, s_A, \Delta s_B, s_B, ...$.
To do so you can do the partial time differentiation and multiply your result by $\Delta t$ as for any time dependent variable $u$, $\frac{\partial u}{ \partial t } = \frac{\Delta u }{\Delta t}$.

NOTE : your first equation can be rewritten

$ (\sqrt{3} x_c +y_x ) (s_A+s_B) = {s_A}^2 + {s_B}^2 - 2s_A$

which make the distance (the second equation) expressed only from the system ($L,M$)  and joint ($s_A,s_B$) parameters.


问:
More than 6 cameras in Nvidia Jetson boards
A recent startup named Skydio develops autonomous drones for photography. The drone is named as R1 and utilizes 13 cameras to map its surroundings for localization and motion planning. The brain of this drone is Nvidia Jetson TX1. While the number of cameras that a TX1 board can support is 6. I'm wondering how did they manage to use 13 cameras.
Can anyone know the answer to this question?</p>

答:
From the Nvidia Jetson datasheet , it seems that 12 cameras are supported. The bandwith per camera is just smaller when you have more cameras as there is a limitation in the number of lanes and you get more cameras per lane.

I suspect that the 13th camera is the one actually filming the subjects but it's a bit unclear from Skydio  website, which is legitimate for a high-tech product.


问:
Two 4 bar mechanism vs stepper motor on each linkage in a 4 DOF robotic arm
I am planning to make a 4 Degree of Freedom(DOF) robotic arm. I have a confusion in mechanical design of the robot. Shall I use two 4 bar mechanisms to reduce the number of actuators? or a stepper motor on every linkage? Also, a gripper will be attached. So which will have higher payload?  </p>

答:
Since a four-bar mechanism is a one dof device, you couldn’t get by with just two four-bars (or else you would end up with a two dof robot).

Four bars can be implemented to reduce the moving mass for a robot.  The parallelogram mechanisms that Fanuc made so popular for controlling the elbow rotation are a good example.   But you still only get one dof for each four bar.

Regarding payload, etc, there are too many design options to consider to be able to answer.  Start with the requirements for your design, including payload, weight, size, cost, accuracy, and allowable controllers, then you can start to address how to implement the design.


问:
How to raise/drop a spider?
For Halloween, I'd like to build a spider that drops from the ceiling when it detects motion and then rewinds itself back up to scare the next kids. I already have a lightweight foamish spider from Hobby Lobby that I'd like to use, but I need help adding the smarts to it to scare the kids.

Ideally, it'd be able to detect how tall/far away the kid is to drop to a custom height each time, but I'd settle for a standard dropping height if that's too much. I even had an idea of having a motion sensor and having it shoot Silly String webs in front of people.

I have a very technical background, but I'm a total noob when it comes to robotics, so ideas as to what components and considerations I'd need would be greatly appreciated!

答:
It sounds like you want some sort of winch that moves faster in one direction (for the release) than the other.  There are heavy-duty winches that accomplish this by having a clutch in addition to the winch motor, so that when the clutch is disengaged the cable can unspool freely.  EDIT: Fishing reels are a more appropriate example (+1 JoeFromOzarks).

To achieve custom drop distance with such a setup, you'd have to rely on disengaging the clutch for a very specific interval -- you should be able to find the relationship between drop time and drop distance (considering gravity, spool momentum, and string friction).

When rewinding, you'd need a sensor to detect when the string is all the way back in.  There are several ways you might do this, from electrical measurement of the motor load to physical measurements on the string/spider position.

You may want to check out this other question for a list of ways to detect motion: What is the cheapest / easiest way of detecting a person?

Title: How to raise/drop a spider?


问:
Dynamic model using identification for control
I'm currently working of a 5 DOF robot, for which i'd like to compute the dynamic model through identification. I have experimental data representing torques (inputs) and positions (outputs). How can i obtain the closest dynamic model to the structure? and how to validate the obtained model. The objective is to design some non linear control using the obtained model. Could you help me out. Thank you so much. Regards  </p>

答:
Before identification of dynamic parameters, you need to know the kinematic parameters with reasonable accuracy either from kinematic calibration or CAD design.
As dynamic identification concerned, you need to develop the dynamic model either from energy of the system or recursive modelling all in all torque dynamic parameters(link center of gravity,mass, and inertia) relation is given as:

\begin{equation}
\tau = Y(q,q^{.},q^{..})\pi
\end{equation}
Y is called Regressor matrix and computed from Lagrangian L = T - V and its a function of joint configuration and $1^{st}$ and $2^{nd}$ derivative of the same.
$\tau$ is the measured joint torque vector,$\pi$ is the parameter vector you intend to determine. So you may need to have $n$ equation of the above relation for the number of measurements(M) you have(different joint configurations).further $M>> p$ where p is number of parameters you need to determine.


问:
Raspberry Pi operating system for robotics
Is there an operating system for the Raspberry Pi that is specifically made for running robotics applications? Or an operating system whose purpose is to optimized just to run a few specific programs?

I've been working with an Arduino for a while now. As far as efficiency goes, it makes sense to me to just upload a specific set of commands and have the hardware only need to handle that, and not have to worry about running a full fledged operating system. Is something like this possible to do on a Raspberry Pi?

答:
You could use a simplified Linux (without the X-Windowing and other graphics utilities that a robot may not need). Raspian-Lite is one such OS.

Then there are a number of robot frameworks that will run on the Raspberry Pi. They run under the Linux OS.

ROS (the Robot Operating System) is one of the most popular frameworks, but also the most complicated to learn. As Peter Parker learned: With Great Power Comes a Great Learning Curve. :)

ROS is written in C++, but can be accessed in a number of languages including Java and Python.

Gobot. This is a framework written in the language Go. It has a number of sensors and boards that the framework knows about. You can put the main intelligence onto a large computer and use a smaller board with a wireless connection on the robot. Gobot has sister projects (Artoo - uses Ruby, and Cylon.js - uses JavaScript).

Go is a C-like language that is fairly easy to use, created by Google. I think of it as C's BASIC (Go is to C like BASIC is to Fortran). It compiles very quickly.

I am thinking of starting a Rust port of Gobot (Rust is yet another C-like language similar to Go, but it was designed to be as type-safe as possible. Many pointer errors common to C/C++ are caught by the Rust compiler.


问:
The reason(s)/benefit(s) to use realtime operating system instead of while-loop on MCU
I'm working on a wheeled-robot platform. My team is implementing some algorithms on MCU to

keep getting sensors reading (sonar array, IR array, motor encoders,
IMU)

receive user command (via a serial port connected to a tablet)

control actuators (motors) to execute user commands.

keep sending sensor readings to the tablet for more complicated algorithms.

We currently implement everything inside a global while-loop, while I know most of the other use-cases do the very same things with a real-time operating system.

Please tell me the benefits and reasons to use a real-time os instead of a simple while-loop.

Thanks.

答:
IT all depends on the complexity of your system.

Typically micro-controller can handle, under hard real time constraint, simple computations related to one pr two peripheral (actuator, sensor) and communication. So  they are well suited for low-level interfaces.

But if you want to have more complex, i.e. computational intensive, process, like path planning, action planning, ...
You will need to switch to CPU or GPU based boards.
At that point if you still want to met real time constraint you need to have a real time OS.

Note that for some application the real time constraints for high level algorithms are soft, hence there is no necessity to have a real time OS/system.


问:
How can I access the cliff sensors on an iRobot Create 2 via ROS/ Python?
I have an iRobot Create 2 and am currently using the create_autonomy package. Currently, they have cliff sensors as a "planned" feature. I see in the documentation that there are 4 cliff sensors (which can return 0 (no cliff) and 1 (yes cliff)) and their "Packet ID" numbers.

It also mentions this note for each sensor: "NOTE: This packet is a binary version of the “Cliff Front Left Signal” (ID: 29) packet." I don't understand what this means or if it's relevant to what I'm doing.

How can I read this cliff sensor data (in order to publish a topic with it)?

答:
It is possible to subscribe to the cliff state using ROS. The topic is /cliff_state, and it is of type Int16. Below is what I used in my code, where callback_cliff is my callback function.

rospy.Subscriber('/cliff_state', Int16, callback_cliff)

However, I'm still not sure what the packet ID numbers are.


问:
Accelerometer bias removal
I found a good explanation on how to remove accelerometer bias (when on flat table only one axis should show values, the other two should be 0). I've calculated S and B factors (page 3):

Record $B_x^{0g}$, $B_y^{0g}$, $B_z^{0g}$, $S_{xx}$, $S_{yy}$, and $S_{zz}$ in EEPROM or flash memory
  and use these values in all subsequent calculations of acceleration to
  get the corrected outputs.

I don't know how to incorporate these into the final calculation of accelerations. I guess the bias should be substracted from my sensor reading. What about sensitivities (S)?

答:
As noted at the top of the second page:

$B_z^{0g} = a_{z1}-S_{zz}*1g$

The "ground truth" z-axis acceleration (of an accelerometer sitting flat on the table) is $1g$, which is affected by the sensitivity of the accelerometer along that axis.  You could rewrite it as follows:

$$Bias = a_{measured} - Sensitivity * a_{actual}$$

Since you want to calculate the actual acceleration from the measured acceleration, you'd rewrite it like this:

$$a_{actual}=\frac{a_{measured}-Bias}{Sensitivity}$$

Or in terms of the original variables,

$$a_{z1}^{corrected}=\frac{a_{z1}-B_z^{0g}}{S_{zz}}$$

Title: Accelerometer bias removal


问:
What is the difference between active and passive sensors?
Apparently, there are active and passive sensors. An infrared proximity sensors should be an active sensor, whereas a gyroscope should be a passive sensor. Why is that the case? In general, what is the difference between an active and a passive sensor? Multiple examples (with appropriate explanations) may be helpful to clarify the distinction.

答:
Let's recall that sensors are used to measure a physical quantity.

The distinction between passive and active sensor characterize the sensor ability to retrieve a measurement without or with inputing energy (mechanic or electromagnetic or else) in the environment.

For example, an infrared proximity sensor is active because the sensor needs to actively emit infrared waves in order to retrieve the measurement of the distance. So, any sensor which requires to input energy to the environment in order to retrieve the measurement is active (laser range finder, ultrasound range finder, sonar, lidar, time of flight camera, etc.).

On the other hand, sensors like gyroscope or accelerometers are named passive because they are able to retrieve a measurement without actively interacting with the environment. Other examples are: encoder, switch, camera, magnetometer, barometer, etc.

More complex sensor like microsoft kinect or intel euclide are composed of several sensors both passive (visible camera, IMU) and active (IR camera and lighting), thus making the full sensor an active sensor.

EDIT: added sensors based on comment


问:
How can I measure latency in a CAN bus?
Given a CAN bus with one master and any number of motor drivers, is there a way to measure the time between sending a command from the master (e.g. a PC running ROS) and the execution of the said command (e.g. the motor starting to move)?

This matters since it affects the maximum update rate of the robot's control loop.

答:
Use an oscilloscope.

Place oscilloscope probes on an i/o line on the master and a motor phase line on the slave. Toggle the i/o line just before sending the can bus command for a step change in the motor control. Measure the time difference between i/o trigger and pwm step change. Blocking the motor so it's angle does not change makes it easier to see the pwm change.

There are many variations on this depending on your system. For some pc's (new laptops) getting access to an i/o line is not trivial.

Measurement of latency using code only by capturing time stamps and sending messages is less accurate because you start making assumptions about what the latency in the controller is.

Title: How can I measure latency in a CAN bus?


答:
Using an RTOS on a microcontroller is for reducing the complexity of developing your solution, and reduces the need for programmer expertise for device drivers, at cost of increasing the complexity of your code base and often a reduction in the efficiency of your code.

Bare metal code (your while loop) is usually cleaner and more efficient for small solutions.

If you have a bare metal solution that works, keep it!

If you find that your complexity grows to the point where you are writing something that looks like scheduler code or inter process communications code to solve your problems, your are writing your own RTOS and should consider using and existing one.

You should read the documentation and code of a small RTOS for your own education as soon as you can. It will help you make this choice easier in the future.

Title: The reason(s)/benefit(s) to use realtime operating system instead of while-loop on MCU

Body:
I'm working on a wheeled-robot platform. My team is implementing some algorithms on MCU to

keep getting sensors reading (sonar array, IR array, motor encoders,
IMU)

receive user command (via a serial port connected to a tablet)

control actuators (motors) to execute user commands.

keep sending sensor readings to the tablet for more complicated algorithms.

We currently implement everything inside a global while-loop, while I know most of the other use-cases do the very same things with a real-time operating system.

Please tell me the benefits and reasons to use a real-time os instead of a simple while-loop.

Thanks.


答: In addition to the other answers, I would add that determinism provides a large benefit with an RTOS.   Your while loop may execute faster sometimes, and slower other times, depending on the computations and conditional results.  An RTOS can guarantee a minimum loop execution rate, or a fixed rate (which I usually prefer), given that deterministic programming practices are followed.   You can do this with bare metal code, but in my experience it is not done and you just try to execute the loop as fast as possible.  </p>


问:
Turtlebot3 Burger - XBOX360 Controller
I am using ROS on the Turtlebot3 and try to teleop the robot with an XBOX 360 controller without success. I'm already able to teleop the robot via keyboard.

Setup:

Ubuntu 16.04

ROS Kinetic

What I've already tried:

Console 1:

```<code>[Remote]-$ roscore
</code>```

Console 2:

```<code>[Remote]-$ rosrun joy joy_node
</code>```

Console 3:

```<code>[Remote]-$ roslaunch teleop_twist_joy teleop.launch
</code>```

Console 4:

```<code>[Pi]-$ roslaunch turtlebot3_bringup turtlebot3_robot.launch
</code>```

Console 5:

```<code>[Pi]-$ rostopic echo joy
</code>```

I can already see, that the Raspberry receives the command messages from the controller.

But the robot doesn't move. Any ideas?

答:
It is now running. The problem was, that I didn't know, that I should hold the Windows Logo Button while using the joystick to move the bot. Alternativly you can push the joystick on the right down to activate the left joystick.

This works with the Xbox 360 and the Xbox One S controller :)

Title: Turtlebot3 Burger - XBOX360 Controller


答:
Ian's answer is mathematically correct.  However, on most processors division takes longer than multiplication.  So if you're at all pressed for processor resources you would want to precalculate a gain and offset for each channel, and apply it:

$k_{zz} = \frac{1}{S_{zz}}$

$b_{zz} = -\frac{B_z^{0g}}{S_{zz}}$

$a_{z1}^{corrected} = k_{zz} a_{z1} + b_{zz}$

Title: Accelerometer bias removal

Body:
I found a good explanation on how to remove accelerometer bias (when on flat table only one axis should show values, the other two should be 0). I've calculated S and B factors (page 3):

Record $B_x^{0g}$, $B_y^{0g}$, $B_z^{0g}$, $S_{xx}$, $S_{yy}$, and $S_{zz}$ in EEPROM or flash memory
  and use these values in all subsequent calculations of acceleration to
  get the corrected outputs.

I don't know how to incorporate these into the final calculation of accelerations. I guess the bias should be substracted from my sensor reading. What about sensitivities (S)?


问:
What knowledge should I have if I want to establish a robotics company?
I know, robotics may refer to many things and it's extremely large field today. But if I can narrow the topic to something like Aldebaran(the company makes Nao robots), what knowledge should I have as a founder and manager of this company?

I really love to have a company like that, and know somethings from OpenCV to ARM-microcontrollers programming, and few experience in Solidworks and Altium designer!

But as you know this is a very big field and the more I read/learn, the more I'm disappointed! I think I can't to reach a point that I can say tomorrow I will create a team and start my first robot project, Cause I think there are many many things that I don't know and many skills that I don't have!

So it made me to ask this question here to know, what knowledge or skills really needed to establish some company like Aldebaran or similar companies?

NOTE: I don't talk about simple robot projects like line following robots, I am talking about Humanoid intelligent robots with Machine Vision, Listening/Speaking abilities and good mechanical ability(icub robot for another example)

Who with what knowledge can make such company and lead a great engineering team of computer/electronics/mechanics/others?

答:
You need enough domain knowledge to be able to tell if someone is bullshitting you or not, to be able to determine when someone has an achievable or unachievable project idea, to be able to determine who has talent and who doesn't, etc.

And money. A lot of money. Quality engineers don't work for free.


问:
H-bridges and stall current
For a DC motor with a stall current of 950 mA, what should the H-bridge's current rating be?  What will happen if we use our H-bridge L293D whose max. output current is 600 mA?</p>

答:
What Brendan said.

However, there is an out if you want to reach for it: once you have determined the actual stall current for your situation, from the motor armature resistance, supply voltage, and the whopping 1.4V drop in the L293, if you pulse the drive to the motor such that the average current through the L293 is the rated 600mA or less, then it shouldn't burn up.

You'll need to pay attention to switching speed, and where the current goes on the back side of the PWM, and all those other pesky details, and if your PWM generator stalls at the wrong portion of the cycle things will get toasty, but that doesn't mean there isn't a path to success with that part.

(Personally, I'd figure out how to deal with surface-mount parts and put in the DRV8801 -- it looks far superior.  Or, if I never needed to generate top torque at top speed, and if efficiency wasn't a concern, I'd just put a resistor in series with the motor).

Title: H-bridges and stall current


答:
If having a company is more important to you than working in robotics for someone else, business skills and people skills are more important than technical skills.

Being successful requires experience, acquired over a lot of time with a lot of learning opportunities (failure). It also requires a good network of people you can draw on for knowledge, resources, and mentorship.

One leads with the passion and big idea that is so compelling that others will come with for you or invest in you. You don't lead and guide experts. You point then towards a problem and then listen to their advice. To check if their advice is good, you use multiple experts and compare their advice.

Title: What knowledge should I have if I want to establish a robotics company?

Body:
I know, robotics may refer to many things and it's extremely large field today. But if I can narrow the topic to something like Aldebaran(the company makes Nao robots), what knowledge should I have as a founder and manager of this company?

I really love to have a company like that, and know somethings from OpenCV to ARM-microcontrollers programming, and few experience in Solidworks and Altium designer!

But as you know this is a very big field and the more I read/learn, the more I'm disappointed! I think I can't to reach a point that I can say tomorrow I will create a team and start my first robot project, Cause I think there are many many things that I don't know and many skills that I don't have!

So it made me to ask this question here to know, what knowledge or skills really needed to establish some company like Aldebaran or similar companies?

NOTE: I don't talk about simple robot projects like line following robots, I am talking about Humanoid intelligent robots with Machine Vision, Listening/Speaking abilities and good mechanical ability(icub robot for another example)

Who with what knowledge can make such company and lead a great engineering team of computer/electronics/mechanics/others?


答:
To create a company of any kind you need both business skills and interpersonal skills. The main domain knowledge should come from your CTO (Chief Technical Officer) and your engineers.

Your main job will be to secure funding for the company.

If the company is small enough that you are the CTO also, then you need to be able to impress the engineers. You don't have to be better than they are, but you have to know robotics. If the company specializes in humanoid robotics, then you should have built a human robot that does some of what your company is planning to do.

I would even go so far as to say that if you haven't built a complicated autonomous robot then you don't have the passion to create a robotics company like you are describing. Even a hexapod with vision capabilities would be a good start. This would give you some of the background knowledge that you need to evaluate the engineers' recommendations.

It doesn't sound like you've built any kind of robot. Start small and eventually get to something more complex. You'll know when you're ready.


问:
using motor controllers with Raspberry instead of Arduno. Is it just me or is everyone ok with bad sofftware support?
I bought a Roboclaw controller. Since then, have looked around for other.  The software support seems to be the same (to me:sad) state.

They all seem to provide Arduino code examples, however, then I guess it's up to me to find / guess about the headers?

If I don't want to use python, and instead I want to use C / C++, how to best go about doing so for a Raspberry Pi?

It would just seem to me that if I spent maybe several hundred dollars on some hardware, it shouldn't be this hard to get some use out of it.

Am I missing something here?

答:
I looked fast Roboclaw on Pololu and there was libraries for C++. For Rapsbery you just need the underlying Wiring level (or the part which is actually used)  modified to connect to RPi to its GPIO pins.

(Arduino anything is C++ with Wiring library and all sources are able to download for free on Arduino site, libraries for special HW are provided by HW suppliers.)

BTW: about hunderds dollars HW usability - did you try get source for basic libraries for some smartphone? Not mentioned for modern PC with not obsolete graphic card ... the Arduino support is light years  more opened and accessible.


答:
Every sensor is used (or meant to) sense something about its environment, so it needs to "listen" to something (sound, light, magnetic field, ... ) generally be somehow affected by its environment to have some idea, what is around.

Pasive sensors just use, what came and do not actively emit that, what they are measuring. (well nearly anything emits some kind of energy (wires with electricity emits some small electromagnetic fields around, mechanical parts make noise when working, etc ...), but here the emited energy is not used for the detection)

Active sensors on the other hand DO emit something and then measure, how the environment is interacting with that emited energy (like ultrasound emits high frequency sound and then listen how it is reflected back, to measure distance)

Take example from horror movie:

So if you are just sitting on ground, silently hear to incoming steps, looking, if you can see someone comming, then you are pasive sensor (both for sound and light). You can then found, that hear some steps, thats are heavy and slow and increase in volume over time and have big echo, so probably it is huge man comming to you and you are in some big cave or extra large room. Then you see small red light approaching and smell smoke and deside, that he is probably smoking cigarette, is about 2m high and 10m away this direction (deciding from the burning point of cigarette and its movements) and you are still passive sensor, as you do not send anything out to get this informations.

Then you scream with fear and echo tells you, that the place, where are you is really huge, like 50m around you (as the echo of your scream take some time to reflect from walls and go back to your ears) and now you are active sensoring (with emiting scream to know the size of the cave) and he can simply listen to your signal and decide, that you are really there and you are scared (from sound of your voice) - he is passively sensoring you on sound. As you already given your presence, you light a torch and see, that it is big man in black suit with big gun in hand - you see it in light of your own light source, so now you are active sensoring on visible light too.

Should that happen on day, say in forrest, you would not need yor torch to see him in detail, so you will be pasivelly sensoring him on visible light and will not give out your position.

Well, you are still heavy braething and your heart pounds fast, but as you are not using this sounds for detecting anything, then it does not count as active sensoring (even when you are trying to hear his steps), just as a noise produced by you. Still he can sense that (pasively hearing) and find you in your hiding.

Lot of pasive sensors use something already existing around - light sensors use the light from sun and detect shadow cast by someone in proximity, or can detect burning torch in dark. Heat sensors can detect any heat source near and decide, that it is aproching (or appeared now) and react on that, press sensors use weight of item to measure it (kichen scale eq.), normal camera use daily light to get photo (camera with flash/lamp attached is active, ofc.), switch use the force of your finger to connect wires (the electricity there is not emited out for measuring, so it is passive), proximity sensors may sence difference in capacity and increased static and be passive, or may send out some signals and detect echo and be active and so on ...

Title: What is the difference between active and passive sensors?

Body: Apparently, there are active and passive sensors. An infrared proximity sensors should be an active sensor, whereas a gyroscope should be a passive sensor. Why is that the case? In general, what is the difference between an active and a passive sensor? Multiple examples (with appropriate explanations) may be helpful to clarify the distinction.


答:
Actually you only got some errors when computing matrix elements.

The matrices A and B should be
$$
A = \begin{bmatrix}2S_A - \sqrt{3}X - Y & -2S_B - \sqrt{3}X + Y\\
-2S_A + \sqrt{3}X + Y + 2MS_A + MS_B & MS_A + 2MS_B\end{bmatrix}
$$
and
$$
B = \begin{bmatrix}\sqrt{3}S_A + \sqrt{3}S_B & S_A - S_B & 0\\
2X - \sqrt{3}S_A & 2Y - \sqrt{3}S_A & 2Z\end{bmatrix}.
$$
Using the above two matrices should give you the desired result, which can be verified by the following python snippet.

```<code>import sympy as sp
# Declare symbolic variables. (I also use r for sqrt(3))
x, y, z, s, sa, sb, m, r = sp.symbols('x, y, z, s, sa, sb, m, r')
A = sp.Matrix([[2*sa - r*x - y, -2*sb - r*x + y],
               [-2*sa + r*x + y + 2*m*sa + m*sb, m*sa + 2*m*sb]])
B = sp.Matrix([[r*sa + r*sb, sa - sb, 0],
               [2*x - r*sa, 2*y - r*sb, 2*z]])
Ainv = sp.Matrix.inv(A)
res = Ainv.multiply(B)
J = res.subs({sa: s, sb: s, x: 0}) # do the substitution
</code>```

To print out the element $(i, j)$ of $J$ (indices start from 0), do

```<code>print sp.simplify(J[3*i + j])
</code>```

Title: Help to get robot jacobian from system of implicit equations

Body:
I have system of two equations that describes position of robot end-effector ($X_C, Y_C, Z_C$), in accordance to prismatic joints position ($S_A, S_B$):

$S^2_A - \sqrt3(S_A + S_B)X_C = S^2_B + (S_A - S_B)Y_C$

$X^2_C + Y^2_C + Z^2_C = L^2 - S^2_A + S_A(\sqrt3X_C + Y_C)+M(S^2_A+S_BS_A + S^2_B)$

where M and L are constants.

In paper, author states that differentiating this system at
given point ($X_C, Y_C, Z_C$) gives the "differential relationship" in form:

$a_{11}\Delta S_A + a_{12}\Delta S_B = b_{11}\Delta X_C + b_{12}\Delta Y_C + b_{13}\Delta Z_C$

$a_{21}\Delta S_A + a_{22}\Delta S_B = b_{21}\Delta X_C + b_{22}\Delta Y_C + b_{23}\Delta Z_C$

Later on, author uses those parameters ($a_{11}, a_{12}, b_{11}...$)
to construct matrices, and by multiplying those he obtains Jacobian
of the system.

Im aware of partial differentiation, but I have never done this for system of equations, neither I understand how to get those delta parameters.

Can anyone explain what are the proper steps to perform partial differentiation
on this system, and how to calculate delta parameters?

EDIT

Following advice given by N. Staub, I differentiated equations w.r.t time.

First equation:

$S^2_A - \sqrt3(S_A + S_B)X_C = S^2_B + (S_A - S_B)Y_C$
$=>$

$2S_A \frac{\partial S_A}{\partial t} -\sqrt3S_A \frac{\partial X_C}{\partial t} -\sqrt3X_C \frac{\partial S_A}{\partial t} -\sqrt3S_B \frac{\partial X_C}{\partial t} -\sqrt3X_C \frac{\partial S_B}{\partial t} = 2S_B\frac{\partial S_B}{\partial t} + S_A\frac{\partial Y_C}{\partial t} + Y_C\frac{\partial S_A}{\partial t} - S_B\frac{\partial Y_C}{\partial t} - Y_C\frac{\partial S_B}{\partial t}$

Second equation:

$X^2_C + Y^2_C + Z^2_C = L^2 - S^2_A + S_A(\sqrt3X_C + Y_C)+M(S^2_A+S_BS_A + S^2_B)$ $=>$

$2X_C \frac{\partial X_C}{\partial t} + 2Y_C \frac{\partial Y_C}{\partial t} + 2Z_C \frac{\partial Z_C}{\partial t} = -2S_A \frac{\partial S_A}{\partial t} + \sqrt3S_A \frac{\partial X_C}{\partial t} +\sqrt3X_C \frac{\partial S_A}{\partial t} + S_A \frac{\partial Y_C}{\partial t} + Y_C \frac{\partial S_A}{\partial t} + 2MS_A \frac{\partial S_A}{\partial t} + MS_B \frac{\partial S_A}{\partial t} + MS_A \frac{\partial S_B}{\partial t} + 2MS_B \frac{\partial S_B}{\partial t}$

then, I multiplied by $\partial t$, and grouped variables:

First equation:

$(2S_A -\sqrt3X_C - Y_C)\partial S_A +(-2S_B -\sqrt3X_C + Y_C)\partial S_B =  (\sqrt3S_A +\sqrt3S_B)\partial X_C + (S_A - S_B)\partial Y_C$

Second equation:

$(-2S_A+\sqrt3X_C+Y_C+2MS_A + MS_B)\partial S_A + (MS_A + 2MS_B)\partial S_B = (2X_C-\sqrt3S_A)\partial X_C + (2Y_C-S_A)\partial Y_C + (2Z_C)\partial Z_C$

therefore I assume that required parameters are:

$a_{11} = 2S_A -\sqrt3X_C - Y_C$

$a_{12} = -2S_B -\sqrt3X_C + Y_C$

$a_{21} = -2S_A + \sqrt3X_C + Y_C + 2MS_A + MS_B$

$a_{22} = MS_A + 2MS_B$

$b_{11} = \sqrt3S_A +\sqrt3S_B$

$b_{12} = S_A - S_B$

$b_{13} = 0$

$b_{21} = 2X_C - \sqrt3S_A$

$b_{22} = 2Y_C - S_A$

$b_{23} = 2Z_C$

Now. According to paper, jacobian of the system can be calculated as:

$J = A^{-1} B$,
where

$A=(a_{ij})$

$B=(b_{ij})$

so I im thinking right, it means:

$$
A =
    \begin{matrix}
    a_{11} & a_{12} \\
    a_{21} & a_{22} \\
    \end{matrix}
$$

$$
B =
    \begin{matrix}
    b_{11} & b_{12} & b_{13} \\
    b_{21} & b_{22} & b_{23} \\
    \end{matrix}
$$

and Jacobian is multiplication of reverse A matrix and B matrix.

Next, author states that Jacobian at given point, where

$X_C = 0$

$S_A=S_B=S$

$Y_C = l_t-\Delta\gamma$

is equal to:

$$
J =
    \begin{matrix}
    \frac{\sqrt3S}{2S-l_t+\Delta\gamma} & -\frac{\sqrt3S}{2S-l_t+\Delta\gamma}\\
    \frac{2(l_t-\Delta\gamma)-S}{6cS-2S+l_t-\Delta\gamma} & \frac{2(l_t-\Delta\gamma)-S}{6cS-2S+l_t-\Delta\gamma} \\
    \frac{2Z_C}{6cS-2S+l_t-\Delta\gamma} & \frac{2Z_C}{6cS-2S+l_t-\Delta\gamma} \\
    \end{matrix} ^T
$$

Everything seems fine. BUT! After multiplicating my A and B matrices I get some monster matrix, that I am unable to paste here, becouse it is so frickin large!
Substituting variables for values given by author does not give me proper jacobian (i tried substitution before multiplying matrices (on parameters), and after multiplication (on final matrix)).
So clearly Im still missing something. Either Ive done error in differentiation, or Ive done error in matrix multiplication (I used maple) or I dont understand how to subsititue those values. Can anyone point me in to right direction?

EDIT
Problem solved! Parameters that I calculated were proper, I just messed up simplification of equations in final matrix. Using snippet from Petch Puttichai I was able to obtain full Jacobian of system. Thanks for help!

Body:
Actually you only got some errors when computing matrix elements.

The matrices A and B should be
$$
A = \begin{bmatrix}2S_A - \sqrt{3}X - Y & -2S_B - \sqrt{3}X + Y\\
-2S_A + \sqrt{3}X + Y + 2MS_A + MS_B & MS_A + 2MS_B\end{bmatrix}
$$
and
$$
B = \begin{bmatrix}\sqrt{3}S_A + \sqrt{3}S_B & S_A - S_B & 0\\
2X - \sqrt{3}S_A & 2Y - \sqrt{3}S_A & 2Z\end{bmatrix}.
$$
Using the above two matrices should give you the desired result, which can be verified by the following python snippet.

import sympy as sp
# Declare symbolic variables. (I also use r for sqrt(3))
x, y, z, s, sa, sb, m, r = sp.symbols('x, y, z, s, sa, sb, m, r')
A = sp.Matrix([[2*sa - r*x - y, -2*sb - r*x + y],
               [-2*sa + r*x + y + 2*m*sa + m*sb, m*sa + 2*m*sb]])
B = sp.Matrix([[r*sa + r*sb, sa - sb, 0],
               [2*x - r*sa, 2*y - r*sb, 2*z]])
Ainv = sp.Matrix.inv(A)
res = Ainv.multiply(B)
J = res.subs({sa: s, sb: s, x: 0}) # do the substitution

To print out the element $(i, j)$ of $J$ (indices start from 0), do

print sp.simplify(J[3*i + j])


问:
Are both of C++ and Python necessary in ROS
I'm a newbie on ROS and I'm trying to figure out how ROS works so I'm installing ROS from source.

I've found that most of ROS packages contains two kinds of codes: C++ and Python. For example, here is the architecture of src of the ROS package actionlib:

```<code>src/
├── actionlib
│   ├── action_client.py
│   ├── action_server.py
│   ├── exceptions.py
│   ├── goal_id_generator.py
│   ├── handle_tracker_deleter.py
│   ├── __init__.py
│   ├── server_goal_handle.py
│   ├── simple_action_client.py
│   ├── simple_action_server.py
│   └── status_tracker.py
├── connection_monitor.cpp
└── goal_id_generator.cpp
</code>```

I'm thinking if I can remove all of python scripts and only cmake && make the c++ files to use the ROS package actionlib?

答:
You can program in ROS using either ROS or Python. It just depends on your preferences. Actually, it is very common to mix both languages to create some programs that run C++ and others that run Python, since they can talk to each other using only the ROS environment (topics, services, messages...).

My advice is that you do not uninstall anything that comes with the default installation unless you are sure that you are not going to use it. For instance, you may have later the problem that you install a third party code that do uses Python.

If you are a newbie to ROS, I recommend you to start learning ROS with Python until you grasp how it works. Then you can move to ROS with C++.
Also I recommend you our online academy where you learn ROS in an already setup environment with simulations of robots running. You only need a web browser. Here the link: http://robotignite.academy


问:
Add image onto box in URDF file
I'm trying to display an image on top of a box in a .urdf file. How could I achieve this?</p>

答:
I recomend you to watch this ROS Developers Live Class where it is explained how to build a URDF model of a robot: https://youtu.be/q01dDxeHTMs

The key point here is that you understand what is the difference between the collision and visual of the model, as well as the pose of those.

Title: Add image onto box in URDF file


答:
Take a look at a kids "spincast" fishing reel and rod.

We built one in 2008 (still works, rain, snow and all!) using a automobile door lock solenoid to operate the "thumb release" and an automobile power window motor (PWM & MOSFET) via rubber hose driveline to operate the retract.  Choice of MCU is yours, but we've since added spooky lights, MP3 with speaker, "beam break" and IR detectors just to "juice it up."

Title: How to raise/drop a spider?

Body:
For Halloween, I'd like to build a spider that drops from the ceiling when it detects motion and then rewinds itself back up to scare the next kids. I already have a lightweight foamish spider from Hobby Lobby that I'd like to use, but I need help adding the smarts to it to scare the kids.

Ideally, it'd be able to detect how tall/far away the kid is to drop to a custom height each time, but I'd settle for a standard dropping height if that's too much. I even had an idea of having a motion sensor and having it shoot Silly String webs in front of people.

I have a very technical background, but I'm a total noob when it comes to robotics, so ideas as to what components and considerations I'd need would be greatly appreciated!


问:
What motor features should I consider for automated blinds?
Not sure if this is the proper community, apologies if not. I'm wanting to start a DIY project at home to automate my blinds through Alexa. I'm comfortable with the tech from the microcontroller up, but it's been quite a while since I've interfaced with any motors.

I'm leaning towards brushless motors, mostly because I'm somewhat familiar with them. I need something that can spin several rotations, something that I can keep track of position (or better, power required for rotation so that if it gets > some value, I know the blinds are fully shut or closed due to that resistance), and ultimately something somewhat energy efficient so I don't have to change the AA batteries every week.

Any suggestions to get me going would be greatly appreciated.

答: You will probably need a motor with lots of torque to run your blinds. Factoring in that you also want to track position, a brushless motor is not the best solution for this problem. You are best off using a stepper motor. They have lots of torque and can continuously rotate and track position. </p>


问:
Sensor fusion with gyroscope and motor rotations
I am building a robot (2 powered wheels and one ball bearing). The problem is that I can't seem to make it drive straight. I literally find it impossible, I have been trying for weeks.

I have two gyro sensors (on each wheel) and the current motor rotations.

The end result would be to have the gyros at 0 degrees, I do not really care for motor rotations.

I tried to search on Google but most results are GPS related. Is there a way I can do this?

答: If you’re using your gyros to measure the direction your bot is moving, you will need to use a PID system to adjust your direction based on the feedback your bot provides. This type of system continuously measures the state of your gyro and applies it to the speed of each wheel. This should keep your bot running straight. If you are using the gyros to measure the rotation of each wheel, then you should be using a rotary encoder instead. Two rotary encoded motors and a gyro will solve your problem completely </p>


答:
The Roboclaw documentation is excellent.

The PDF is available for download. I never even looked at a library for something that I could just use by following the manual. The RoboClaw is an extremely powerful motor controller. It isn't just an inexpensive board where you put PWM in and get voltage out. You can use many methods for controlling the motor. This is part of the reason for the expense.

I've almost always used control by usb or serial because I'm lazy. It worked just as the manual said it would. Unfortunately this was a few years ago and the computer I used is gone. In the next few months I'm going to have to do this again, and I'll probably publish a library for Gobot (a framework for robotics written in Go). Perhaps I'll write one in Java also.

There is Colin's library in C++ for ROS. It's freely available on Github, but it says it hasn't been fully tested.

SorcererX has a C library for Linux using serial. It's also on Github.

However, there are a lot of other libraries available for the RoboClaw. Ion Motion Control (the sellers of the RoboClaw) have multiple libaries. These are meant as examples. If you don't want to use python, then just translate it into c++. Or write your own given the information in the manual.

The biggest mistake I've seen with these modules is that people will often buy the controller based on normal motor current rather than stall current. This leads to melted controllers eventually.

Title: using motor controllers with Raspberry instead of Arduno. Is it just me or is everyone ok with bad sofftware support?

Body:
I bought a Roboclaw controller. Since then, have looked around for other.  The software support seems to be the same (to me:sad) state.

They all seem to provide Arduino code examples, however, then I guess it's up to me to find / guess about the headers?

If I don't want to use python, and instead I want to use C / C++, how to best go about doing so for a Raspberry Pi?

It would just seem to me that if I spent maybe several hundred dollars on some hardware, it shouldn't be this hard to get some use out of it.

Am I missing something here?


问:
Developing a Quadrotor using ROS
I
 suppose who know ROS and how it works (at least most of you)
I have some question regarding the implementation of a quadrotor in that
 framework.

3D movements: A quadrotor has 6DOF and moves in a 3D
environment. Looking at the various ROS packages I could not find any
package that allows to drive a "robot" in the 3D space. The package
/move_base for instance allows only 2D. Make sense to use this
package for such a project? I thought to use 2D navigation projecting
the "shadow" of a quadrotor on the ground...

MoveIt: it seems a real interesting and promising package, but I
read that it is for robotic arms and not expressly indicate for
quadrotor. Maybe one can use the possibility to create a virtual
floating joints in MoveIt to let the quadrotor any movement in a 3D
environment...that's ok, but I cannot understand whether is "too much"
and not useful for a flying robot.

Trajectories: The possibility to create a 3D trajectory in the
space seems to be not a standard package of ROS. I found Octomap
which allows the creation of 3D maps from sensor datas. Very interesting
and for sure very useful. But...I don't think it could be useful for
creating 3D trajectories.  Should I in that case create an extra package
to compute 3D trajectories to be feed into the quadrotor? Or there
already something like that?

There is already an existing project hector_quadrotor which seems to
acclaim a good success ans it is very considered in the field. Most
people refer to that project when speaking or answering question
regarding quadrotors in ROS. I saw many times that project...since
weeks. And due to the total lack of documentation I didn't try anymore
to understand how it works. Really too difficult.
Another interesting project, ArDrone, has comments in the source
code...in Russian!!! @_@

Could you me give any good suggestions? Or point me in the right direction
please?
It would help me to understand how to focus my searches and which
package I can/cannot use.

UPDATE: my goal is to let the quadrotor flying and using gmapping to localize itself. I've heard and read al lot of stuff about that but I found all this tutorials very hard to understand. I cannot get a global vision of the software and sometime I run in problems like: "is there a package for this task, or should I invent it from scratch?"

Thanks!

答:
You can use the tum_ardrone ROS package to do visual navigation.

Another option is to use MoveIt! to generate the trajectories for your drone and then apply them to the drone movement. Check out eYSIP-2017_Navigation-in-Indoor-Environments-using-drone for how to do it.

In case you find it complex, I recommend you an online course we created that teaches how to make drones navigate using that PTAM-visualization package and also how to use MoveIt! to navigate in a 3D environment. We use simulations to make you practice on the spot how everything works.

Title: Developing a Quadrotor using ROS


问:
How to raise/drop a spider?
For Halloween, I'd like to build a spider that drops from the ceiling when it detects motion and then rewinds itself back up to scare the next kids. I already have a lightweight foamish spider from Hobby Lobby that I'd like to use, but I need help adding the smarts to it to scare the kids.

Ideally, it'd be able to detect how tall/far away the kid is to drop to a custom height each time, but I'd settle for a standard dropping height if that's too much. I even had an idea of having a motion sensor and having it shoot Silly String webs in front of people.

I have a very technical background, but I'm a total noob when it comes to robotics, so ideas as to what components and considerations I'd need would be greatly appreciated!

答:
If you want to detect how tall your target is and tailor the drop height to suit, then you are going to need more precise sensors and control than the other (excellent) answers here.

One option might be to use a Sonar Range Finder as suggested in this answer to What is the cheapest / easiest way of detecting a person? (Thanks Ian)

Basic idea

While the SRF is detecting a distance of more than your maximum drop distance, the 'spider' would lie in wait. If the SRF detects anything closer, you immediately start the motor unspooling the cord and the spider will start dropping.

As the spider is dropping you continue monitoring the SRF and stop unspooling when the length of cord you've unspooled is approximately the same as the minimum distance measured by the SRF since it started dropping. This should place the spider right at eye level of the tallest person there, for maximum effect.

Finally, after a short delay, start the motor slowly returning to it's rest position by spooling the cord back in and resetting for the next attack.

Complications

You will need to be careful about the weight of the spider. It needs to be heavy enough that drag (air resistance) does not significantly impede it's acceleration due to gravity, but not so heavy that it could harm anyone or overload your motor.

Even if your spider isn't too heavy, you will want to make sure that there is 1.5 to 2" of foam between the heavy centre and anything that might touch anyone. You will also need to make sure that there are no stiffening wires or springs which can end up protruding out of the spider as it wears. All basic health and safety stuff really.

If the spider is dropping into the SRF sensor beam area, then obviously you will not be able to improve your initial estimate of drop distance, and will just have to drop to that first range measured. This might mean that you end up dropping to teh height of someone's hand rather than to the level of their head though.

If you want to be clever, you can arrange your drop trajectory to be controlled so that you never have too much loose cord, this will minimise the risk of the cord getting tangled and snagging on anything. In this case you will want to ramp up the speed of the motor such that the cord is being spooled out at the same rate as the acceleration of the spider due to gravity, i.e. $9.8 ms^{-2}$.

You may or may not also want to control the deceleration rate as you approach the desired drop length. The faster you stop it, the more dramatically the spider will bounce and jump around, but the more stress you will put your system under.

Finally, you will want to size your motor such that it can move relatively quickly under light load (when dropping) but still have the torque to stop the spider at the end of travel (and winch the spider back up).

Some calculations

The formulae for uniform acceleration is $s=ut+\frac{1}{2}at^2$ where $s$ is displacement, $u$ is initial velocity (zero in our case), $a$ is uniform acceleration and $t$ is time.

Assuming that you have a spool of 10cm in circumference, and want to drop the spider at most 2m then $s=2$, $u=0$, $a=9.8$ and $t$ is unknown: $t=\sqrt{\frac{2}{\frac{9.8}{2}}}=0.638$. To spool 2m in that time seconds would require the spool to turn at almost 2000 rpm on average ($200/10/0.638*60=1881$).

This seems a little unreasonable, so doubling the spool to 20cm circumference would drop the motor speed to under 1000rpm on average, but we are now looking at quite a bulky bit of mechanics.

Conclusion

If you get the design right, you might even be able to fit all of the components needed (spider, spool, motor, drive electronics, control electronics, sensor and power supply) into something which you can screw into a light fitting and thus hide in a (large) lamp shade.

Title: How to raise/drop a spider?


问:
install ROS on ubuntu 17
which distribution of ROS should I install on Ubuntu 17
I have searched in ros distributions wiki but couldn't find any specification
and I also found that ROS Kinetic Kame is not suitable for ubuntu 17 </p>

答:
I would suggest to have a look to  ros wiki on target platfrom for each ROS distro, which was linked too in the page you cited. In your case it seems that you have a choice between Lunar and Morenia.

Then it is up to you to choose between the two based on your requirements on stability and maintainability.

Note that ubuntu 17.04 and 17.10 are not LTS, so that means that they wont' have long time support from the community and your are more likely to have to update them to a newer release in some near future to get proper support. This is usually breaking parts of your application and time consuming. That's the reason why people developing complex robotics solutions tend to stick to LTS as much as possible, so that they can do distro update every 2 years if they want the new features or keep their systems for 5 year with support.

Title: install ROS on ubuntu 17


问:
Pictures coordinates to robot coordinates
I have a picture on my C# software and the corresponding object in real world on 2d plane of motorized XY axis table. What I want is when I select a pixel on my picture, the motorized table should be moving to the exact same point of the real world object.
The real world object and its picture may have distortion and rotation differences and the picture on the software is not perfect too.

I use 4 points on each to map all the points in between, example:

Normal picture (x,y): [250, 25] , [250, 287] , [399, 287] , [400, 28] (in pixels)

Table coordinates (x,y): [0, 0] , [2098, 29538] , [19127, 28164] , [17097, -1200] (in microsteps)

I tried using OpenCV's homography:

I used FindHomography() to get the H matrix and I transform the picture point choosed using PerspectiveTransform() which give me the corresponding point in microsteps on the real world to move the motorized XY axis table.

```<code>OpenCvSharp.Mat hCv = OpenCvSharp.Cv2.FindHomography(srcPoints, dstPoints);
OpenCvSharp.Point2d[] resultCv = OpenCvSharp.Cv2.PerspectiveTransform(targetCv, hCv);
</code>```

I also manualy calculated the homography matrix using this anwser : https://math.stackexchange.com/a/2619023
But I both cases I always get an error when transforming one of the four reference point like for [250, 25] the corresponding point should be [0, 0] but instead I get something like [-25, 245].

Question : I there a different way to link pictures coordinates to real world coordinates accuratly ?

Edit, more explanations:

To get my 8 points I select four points of the picture and then in real world I move my table to the four corresponding points manually. Let say I took a picture of my smartphone. I will get my points on the four edges of the phone. Then if I choose the X, Y pixel position corresponding to the front camera of my phone, my motorized table should move to get a landmark above the front camera of my real phone.

答:
First note that for px =250 (picture x) you get two different table values tx=0 and tx=2098, then for a difference of 1 unit in px you get a difference of around 2000 in tx (table x). From that it seems that your measurement is not super reliable. I would suggest you to center the table reading on the center of the equivalent pixels.
For py=287 you get two values separated by approx. 1500 units on the table.

If you know that the mapping is linear you should just find the coefficients such that $px = \alpha ~tx$  and $py = \beta ~ty$.
To do so, consider $n_{px}$ the number of pixel along x-direction and $n_{tx}$ the number of motor counts from the center of the first pixel to the center of the last one. Then $\alpha = (n_{px} -1 ) / n_{tx}$. Doing that on the full length of the table should give you better accuracy than doing it for two adjacent pixels. Then you just need to determine the offset between the two set of coordinate (i.e. put one set at [0,0] an see the value of the other).

At that point you have everything to construct the affine relation between your set of coordinates. You might want to watch carefully your sign and offset based on what you define as origins on both the table and picture (if both are the same corner it is easier).

If you want you can write this affine relation in matrix form.

$\begin{bmatrix} px \\ py \end{bmatrix} = \begin{bmatrix} \alpha  & 0 \\ 0 & \beta \end{bmatrix} \begin{bmatrix} tx \\ ty \end{bmatrix} + offset $


问:
What part do I need to bypass the gearbox of a hoveround motor? Helical splined hub?
I have an old powered wheelchair motor from a Hoveround.  I have removed the gearbox and I would like to attach a lawnmower blade directly to the shaft.

As you can see from the photo, it has 7 helical splines.  Am I correct in assuming that I need a helical splined hub to mesh with it, which would either have a threaded shaft on the other side to hold the mower blade, or a method by which a threaded shaft can be connected?

If that's not the name of the part I need, what would it be?  I've looked at many stores (McMaster, Servo City, etc) but can't seem to find something like this, which makes me think I am calling it the wrong thing.

FYI, the motor specs are:

Brand: Shihlin

Type: A9Y1X02872

Part #: M19004442

24V DC

Thanks for any help.

ServoCity

答:
That looks like a helical pinion to me, rather than a splined shaft.  It should mesh with a helical gear in the gearbox.

So either you mesh it with a suitable gear (I can't tell enough from a photo to specify what, but the corresponding gearbox will obviously contain one), or hard-turn it down in a lathe and key it to take something else.


答:
I did this exact same project 6 years back. I used two servos. The first was a continuous rotation servo with a spool the pull the spider up. The spool did not have an end on it so that when the spool turned parallel to the string it all came loose and the spider fell. It was simple and effective, although the CR servo that I used was under powered.

I have a write up in this thread on the Parallax forums.

Title: How to raise/drop a spider?


问:
Gyro Yaw Drift Compensation With The Aid of Magnetomer
I'm getting data From an IMU and a Magnetometer synchronously, my roll and pitch drifts are corrected with accelerometer inside IMU and now I have the DCM matrix during my sensor reading i also have the true heading from Magnetometer  as a simple H degrees from north. what is the most straightforward way of correcting the my DCM with this H angle, i don't want to go through kalman filtering, just i want the  formulation to simply compensate my yaw angles from this H value.

Based on the answered and comment i think my question was not clear so i try to clarify it more

more detail:

I have an IMU witch has an accelerometer and gyroscope that internally compensates for pitch and roll drift; this IMU not only provides me compensated pitch and roll angles as well as uncompensated yaw angle but also provides all raw data of accelerometer and gyroscope. by roll, pitch and yaw angle i mean three Euler angles as φ, θ, ψ (witch are result of 3->2->1 Rotation).

now i have added a magnetometer sensor to my system. i read raw data from magnetometer and using atan2 i convert it to heading. now i want to use  a simple complementary filter to compensate for yaw drift and i ask here for it's formulation. my main problem arises from the fact that the ψ (yaw) angle from the IMU is not directly only related to Heading. i mean for instance i cannot replace the yaw angle (ψ) with the heading value! so i want to know witch witch formulation i can simply relate this heading to yaw angle.

答:
my roll and pitch drifts are corrected with accelerometer inside IMU

You mean they're being correct by the IMU, or you're correcting the readings yourself using the accelerometer from the IMU?

i want the formulation to simply compensate my yaw angles from this H value.

If you're correcting the other angles yourself, just use the same method to correct headings.

i don't want to go through kalman filtering

Well, you're going to have to do something if you want better results. Madgwick filter would be the best, the Kalman, then you could even try complementary filtering. The Madgwick filter is freely available (bottom of page) - highly recommended.


问:
Can quadcopters save energy by flying in formation?
If two or more quadcopters are aligned, would the effect of drag due to the lead quadcopter's slipstream lead to measurable energy savings? And if so, how would one determine the optimal distance between the quadcopters?</p>

答:
My intuition would be no, as the rotor wake will be choppy and downward flowing.

Unlike slipstreaming in ground vehicles which reduces body drag, bird and some aircraft formations rely on the effect of wing-tip vortices to gain lift, hence reducing lift induced drag. Not having wings†, 'copters lack wing-tip vortices, so would not experience this effect, but instead the flow from the rotors will probably cause a following 'copter to lose lift.

†there probably will be vortices shed from the rotors if not ducted, but they will process with the rotor tips so not be in a stable relative position that can be flown through.


问:
How can I measure the torque a servo motor is applying very precisely?
Is there any cheap way to measure how hard a servo is turning?

I am looking to measure changes of about 0.1 oz-in.

What are the common ways to measure servo torque, how much do they cost, and how precise are they?

Edit for clarification: I am looking to turn the servo at a constant speed, and measure how much the object it is turning is "fighting back."

答: One thing you could experiment with is a load cell. Mount the servo so it can rotate about its axle but is stopped from rotating by the force on the load cell, so that the torque the servo is transferring to its axle will be proportional to the force on the cell. Calibrate with a known torque, or calibrate the cell before fitting with known weights and measure the distance. A cheap kitchen scale has a cell that will give 10kg by 1g increments, so it should be mountable to read your range of torques.</p>


答: A magnetometer in my experience is not a reliable source of heading. They are effected by local magnetic fields caused by large metal objects and electrical currents. Using it as a simple offset will probably make your heading worse. You will definately need some type of filter.</p>

Title: Gyro Yaw Drift Compensation With The Aid of Magnetomer

Body:
I'm getting data From an IMU and a Magnetometer synchronously, my roll and pitch drifts are corrected with accelerometer inside IMU and now I have the DCM matrix during my sensor reading i also have the true heading from Magnetometer  as a simple H degrees from north. what is the most straightforward way of correcting the my DCM with this H angle, i don't want to go through kalman filtering, just i want the  formulation to simply compensate my yaw angles from this H value.

Based on the answered and comment i think my question was not clear so i try to clarify it more

more detail:

I have an IMU witch has an accelerometer and gyroscope that internally compensates for pitch and roll drift; this IMU not only provides me compensated pitch and roll angles as well as uncompensated yaw angle but also provides all raw data of accelerometer and gyroscope. by roll, pitch and yaw angle i mean three Euler angles as φ, θ, ψ (witch are result of 3->2->1 Rotation).

now i have added a magnetometer sensor to my system. i read raw data from magnetometer and using atan2 i convert it to heading. now i want to use  a simple complementary filter to compensate for yaw drift and i ask here for it's formulation. my main problem arises from the fact that the ψ (yaw) angle from the IMU is not directly only related to Heading. i mean for instance i cannot replace the yaw angle (ψ) with the heading value! so i want to know witch witch formulation i can simply relate this heading to yaw angle.


问:
are mg996r servo failures common?
I am new to the small servo area.

I bought a eBay 6DOF Robotic Arm, and 12 mg996r servos to go with it.

Using an arduino and I2C PCA9685 16 X PWM board, with the example code from adafruit, I set up 5 of the servos with conservative values for an overnight test.

2 of the servos died, and individually, zero response from voltage applied to them (no hum, no increase or decrease in mechanical moving, no heat).

Since then, I've had another one die.

Is this common on buying "bottom feeder" prices on ebay?

I was wanting to get into this area without spending a bundle, but 25% failure rates seems excessive even for ebay.

Thanks for any guidance.

答: You must drive servos at 25hz or you'll fry them. I ran mine at 300hz until they melted internally.</p>

Title: are mg996r servo failures common?


问:
raspberry pi operating a unipolar stepper motor with a L293D IC
I need some help with a project where I am trying to operate a unipolar stepper motor with a raspberry pi's using the 4 GPIO pins and using a L293D IC as an amp to get it to the operating 12V of the stepper motor. The problem is that to use the method I have which is choose the + or - pairs of each coil on the stepper and switch between them whilst using the 5th wire as a common ground, I need the GPIO pins that are not set to HIGH to not become a ground connection. Any help would be appreciated or another method that I haven't thought of would be good to.</p>

答:
I need the GPIO pins that are not set to HIGH to not become a ground connection.

No you don't. There always needs to be something between your motor and the GPIO, as the GPIO cannot handle motor currents, and in your case either you want a unipolar motor driver or your L293 and a different stepper motor.

If you do use your L293, you don't need to supply a high impedance to it.

If you only drive one coil at a time, you should be able to ignore the common connection. Alternatively, you might be able to connect common to one of the four half bridges, and two of the other four coils to the two opposite sides (I don't currently have time to work out whether this would give you all the states required but I think it will as L293 allows setting each half bridge to be the same or different to each other).


问:
Not understanting the result of a relative transformation
I have the following set of coordinate frames (translations are not important in this case):

$w$, the reference frame.

$l$, a "left" reference frame. Rotated $-20\deg$ around $Y_l$ (axes $Y$ of frame $l$), rotated $-12\deg$ around $X_l$, and translated along $-X_w$.

$r$, a "right" reference frame, similar to left. Rotated $20\deg$ around $Y_r$, rotated $-12\deg$ around $X_r$, and translated along $X_w$.

I hope the diagram makes it more clear:

The rotation matrices that describe the orientations are ($R_{w,l}$ represents rotation from $w$ to $l$, values are rounded):

$R_{w,l} = \left[ \begin{array}{{c}}
0.94&0&-0.34\\
0.07&0.98&0.2\\
0.33&-0.21&0.92
\end{array}\right]$, $R_{w,r} = \left[ \begin{array}{{c}}
0.94&0&0.34\\
-0.07&0.98&0.2\\
-0.33&-0.21&0.92
\end{array}\right]$

The problem comes when I want to know the relative rotation between $l$ and $r$: $R_{l,r}$. If I am not mistaken, this rotation can be computed from the ones I have:

$R_{l,r} = R_{l,w}R_{w,r} = R^T_{w,l}R_{w,r}$.

When I do this, I get the following result:

$R_{l,r} = \left[ \begin{array}{{c}}
0.77&0&0.64\\
0&1&0\\
-0.64&0&0.77
\end{array}\right]$

Which in Euler angles to just a rotation of $40\deg$ around $Y$ (not sure which $Y$!). However, this does not make sense to me, because the only $Y$ I can use for this to make sense is $Y_w$.

What am I missing?

Expected result

I tried directly with the Euler angles. To convert from $l$ to $r$, one should do (starting in $l$):

$R_x(12\deg) \rightarrow R_y(20\deg) \rightarrow R_y(20\deg) \rightarrow R_x(-12\deg)$

Which are computed as matrices as follows:

$R_{l,r} = R_x(12\deg)R_y(40\deg)R_x(-12\deg)$

And this provides the following result:

$R_{l,r} = \left[ \begin{array}{{c}}
0.77&-0.13&0.63\\
0.13&0.99&0.05\\
-0.63&0.05&0.77
\end{array}\right]$

Which makes way more sense, and actually represents the rotation from $l$ to $r$.

答:
Wow, this is a spectacularly detailed question, so thanks for that, welcome to Robotics, and I'm sorry you're having trouble with this.

The trouble that you're having is that you're inverting the wrong matrix! Allow me to explain.

You have two matrices, $R_r$ and $R_{\ell}$. To be more specific, as you have, these are the matrices that convert world coordinates to the right or left frames, respectively. I understand the notation is generally understood to be $R_{w, r}$, etc., but this might be easier if you use an arrow:

$$
R_{w\: \rightarrow \:r} \\
$$

Now, if you put this in an equation, you might see how the notation is a little "backwards," if you will:

$$
s_r = \left(R_{w\: \rightarrow \:r}\right) s_w
$$

To get a point $s$ converted from world coordinates to the right frame, you multiply the world point, $s_w$, by the transform $R_{w\: \rightarrow \:r}$. But maybe you can see how the arrow points in the wrong direction - matrix multiplication happens right to left! It would be a little clearer still to reverse the arrow:

$$
R_{r\: \leftarrow \:w} \\
$$

There! Now consider:

$$
s_r = \left(R_{r\: \leftarrow \:w}\right) s_w \\
$$

Hopefully, you see that this is still converting world coordinates to right coordinates. The matrix itself doesn't change (yet), I'm just altering the way I'm displaying it to help illustrate where the problem lies.

Now, recall that you have a left and right transform, which can now be represented as:

$$
s_{\ell} = \left(R_{\ell \: \leftarrow \:w} \right) s_w \\
s_r = \left(R_{r \: \leftarrow \:w} \right) s_w \\
$$

Now you want the full transform from the right frame to the left frame. You can't just apply the transforms together, because now it's obvious that they don't "stack" together:

$$
\left(R_{\ell \: \leftarrow \:w} \right) \left(R_{r \: \leftarrow \:w} \right) \\
$$

What you did was to invert the transform between world and left frames, but you can see with the new notation that this is the wrong answer:

$$
R_{w \: \leftarrow \: \ell} = \left(
R_{\ell \: \leftarrow \: w} \right)^{-1} = \left( R_{\ell \: \leftarrow \: w} \right)^{T}\\
$$

If you try the inverted left transform, now you have:

$$
\left(R_{w \: \leftarrow \: \ell} \right) \left(R_{r \: \leftarrow \:w} \right) \\
$$

If you try instead to invert the right transform, now you have:

$$
R_{w \: \leftarrow \: r} = \left(
R_{r \: \leftarrow \: w} \right)^{-1} = \left( R_{r \: \leftarrow \: w} \right)^{T}\\
$$

Which gets you:

$$
\left(R_{\ell \: \leftarrow \:w} \right) \left(R_{w \: \leftarrow \: r} \right) \\
$$

Now you can provide a point in the right frame, convert it to world frame, then convert to the left frame.

$$
s_{\ell} = \left(R_{\ell \: \leftarrow \:w} \right) \left(R_{w \: \leftarrow \: r} \right) s_r \\
$$

Numerically, this gets you the expected answer. Hope this helps!


问:
iRobot Create 2 Question
With the Create 2 iRobot if it is already moving backwards (with its bump sensors in the front of it) how would I code it to sense that it is hitting something on its back side with only using the create's sensors?

答:
Since there are no sensors on the back, its probably best to only back up a short distance and then make a 180 degree turn.

The only other way I can think of is to monitor the left and right motor current (packet 54 & 55) to see if its above the normal level assuming its backed into something and bogging down

Frank

Title: iRobot Create 2 Question


问:
How to access UART or serial sensors?
I want to connect ir range finder (dlem 20) with the system running Linux kernel. It looks like they don't provide any kind of SDK or drivers for their products. So how should I get data from such sensors with UART connectivity?

答:
So according to the datasheet from the link provided, the Data interface is indeed UART (LVTTL 3.3V). The datasheet also says it has 2 Modes of operation: Single measurement, continuous ranging 1Hz to 25Hz.

The datasheet does not go into the details of the application layer (ie. the commands and structure of the data in those commands), let alone the baud rate.

After reading the website I would surmise that the application layer information is a bit secretive - being that its primary application is for military use. You would have to contact the company directly for access to that information.

Title: How to access UART or serial sensors?


问:
Accelerometer calibration - how to get cross-axis sensitivities
I've already asked a related question (accelerometer bias removal) here on robotics and got a bit better results on corrected accelerometer output. To get even better results I found the calibration equations (7th & 8th paragraph) from Vectornav which are just a bit enhanced than the solution in the linked question:

However, six more variables are needed:

Sensitivity of sensor X-axis to Y-axis inputs ($M_{xy}$)

Sensitivity of sensor X-axis to Z-axis inputs ($M_{xz}$)

Sensitivity of sensor Y-axis to X-axis inputs ($M_{yx}$)

Sensitivity of sensor Y-axis to Z-axis inputs ($M_{yz}$)

Sensitivity of sensor Z-axis to X-axis inputs ($M_{zx}$)

Sensitivity of sensor Z-axis to Y-axis inputs ($M_{zy}$)

Below it is also stated:

IEEE-STD-1293-1998 [...] provides a detailed test procedure for
determining each of these calibration parameters

However, after searching through the 1293-1998 standard (especially page 201 in Google Docs) I didn't find any clue on how to calculate the $M$ values. Also, $B_{d}$ and $V_x$ values from Vectornav equations is not explained anywhere. Can someone point me further?

答:
OK.  I'm too lazy to read the document, but in general you can model the sensor response as

$$\alpha_m = S \alpha + b$$

where $\alpha$ is the actual acceleration in three dimensions with respect to the accelerometer body (including the acceleration due to gravity), $\alpha_m$ is the measured acceleration from the accelerometer, $b$ is an offset, and $S$ is a $3\times3$ sensitivity matrix.

$S$ and $b$ can be derived from the equations you give in your question above: $S$ is the product of your two $3\times3$ matrices, while $b$ is the product of $S$ and their $B$ and $V$ vectors.  We're all saying the same thing; I'm just compressing the math a bit.

If you know $S$, $b$, and $\alpha_m$ then you can solve the above equation for $\alpha$ to get
$$\hat{\alpha}=S^{-1}\left(\alpha_m - b \right)$$

So if you don't assume that $S$ is symmetrical (I don't think it needs to be) then you have 12 unknowns (nine in $S$ and three in $b$).

If you mount your accelerometer into a cube whose sides are more accurate than the calibration you're trying to make, and you set it on a table that is as accurate as the cube, and measure the acceleration at each of the six faces of the cube, then you'll get 18 equations, three for the three axes, times the six faces of the cube.  There should be sufficient information there to extract your 12 unknowns by linear algebra.

Serious aerospace companies do this job with rotary tables, but that gets kinda spendy.


问:
RS-232/422, UART, usb sensor access code same?
Is the method to access all the sensors with RS-232/422, uart and usb sensors can be done in same way? Or by converting rs-232 to usb, uart to usb can they be programmed in same as usb from linux?

For example this link provides way to access such port from linux command line and program. so my question is considering i have another serial device/sensor with same type of connetivity i.e serial would it not be same to access that device in same method as described in above link.

答:
The RS232 and RS432 should be handled identically since they are both merely physical standards (voltage, cabling, etc) and appear to the computer identically. They would even have the same device under Linux.

The USB is just slightly different when opening it up because it has a different device associated with it. Once you've found that for your system, it should be the same.

They all should act like serial connections.


问:
When and when not to use the Inertia tensor in Kinetic energy computing?
I'm trying to obtain the dynamic model of a 3D robot (academic problem), I have obtained the D-H table, the transformation matrix for each pair of links and the total transformation matrix. Now I'm struggling with computing the total Kinetic energy (for using it in the Lagrangian approach).

In some texts, only the linear velocity is used in computing the kinetic energy, even if there are revolute links, that is:

$K=\frac{1}{2}m~v^2$

But in some others, both the linear and the angular velocities are considered :

$K=\frac{1}{2}m~v^2 + \frac{1}{2} I~\omega^2$

I'm a little bit confused with this, when and when not to use the angular contribution to the Kinetic energy?

答:
It all depends on your robot design, the joint category (linear/revolute) can have an impact but what you need to consider is the final motion of the parts for which you compute the Kinetic energy.

The total Kinetic energy is the sum of all links and motors individual Kinetic energy. This is used because it makes the computation way easier as usually one consider a center of mass (CoM) for each motor and link.

So you should consider both linear and angular components of Kinetic energies. Sometimes, based on your robot design, there are parts with no angular or linear velocity, which results in no contribution to the total Kinetic energy.

Think for example about gantry crane which only have linear motion.


问:
Can I "shape" the sound of words spoken by Pepper with Phonetic transcription?
I am using Aldebaran/Softbank Robotics Pepper with Choregraphe software. There are some loan words in my dialogs. When Pepper say these words they often don't sound natural.

e.g. the german word Demenz (eng: dementia) The first e is to long. I imagine some synax like that De[0.5]menz or phonetic transcription [deˈmɛnʦ].

Is this possible?

答:
Yes, it's possible to tweak the ponetic proncunciation, see the documentation here:</p>

```<code>tts.setLanguage("English")
tts.say("\\toi=lhp\\‘zi.R+o&U \\toi=orth\\")
# Same as
tts.say("zero")
</code>```

Body:
Yes, it's possible to tweak the ponetic proncunciation, see the documentation here:

tts.setLanguage("English")
tts.say("\\toi=lhp\\‘zi.R+o&U \\toi=orth\\")
# Same as
tts.say("zero")