答:
You have an interesting approach, but I think it's the wrong approach; you've painted yourself into a corner by trying to avoid some technical obstacles (instead of just tackling them).

Based on the information you've provided, it sounds like the goal is for this robot to successfully mow an irregularly-shaped lawn while staying within an invisible boundary -- defined using GPS.

A positioning system (enabling closed-loop control) is critical to accomplishing this goal.  Going without one is the equivalent of pushing the lawnmower around the yard while blindfolded; not only is it impractical, having a spinning blade on a blindfolded robot borders on unethical.  There are ways to improve the accuracy of GPS, e.g.

With an INS (Robust GPS/INS-aided localization and mapping via GPS bias estimation)

With visual odometry (Accurate Visual Odometry from a Rear Parking Camera)

With wheel odometry (Improved Inertial/Odometry/GPS
Positioning of Wheeled Robots Even in
GPS-Denied Environments)

Once you have a robot that knows its precise location, you do not need to pick your algorithm based on minimizing error; you need only visit every position in the lawn area.  (Remember, you will have already used a GPS to draw the boundary of the lawn.) I would refer you to other questions on this site that concern coverage, such as:

What algorithm should I implement to program a room cleaning robot?

What's an efficient way to visit every reachable space on a grid with unknown obstacles?

Title: Working of Autonomous Lawn mower(ALM) in an unbounded area without a perimeter wire

Body:
I have an Autonomous Lawn mower(ALM) which can mow a certain lawn area when that area is bounded by a perimeter wire. Even when that perimeter wire is removed, it has to mow the above mentioned area accurately without slipping into a neighboring area.

Constraints and problems:

The ALM is an open loop system.

Differential GPS was tried, but it did not yield proper results.

Any iterative pattern of area coverage can be used provided the error in each iteration is not added cumulatively which can result in unpredictable error in the end.

I do not expect full fledged solution. But I need a starting point to understand motion planning particularly for unbounded robotics to solve this problem.

I searched on internet to know about the knowledge sources about motion planning but could not get good results. Can anyone guide me to know about such sources preferably books and articles on internet which can help me to solve this problem?

EDIT:
Addition of information:

The above picture shows the irregular lawn area which does not have any enclosures and perimeter
wire
1.The red mark shows the center point of lawn .

2.The grey area is the initial scaled down area which resembles in shape to the larger area .I could not draw the grey area which exactly resembles the larger green area .

3.The grey lines are the contours which from the tracks to be followed by the lawn mower

Idea description:

1.Using planimeter app for onetime , the shape and dimension of the lawn area (green area) can be known
Link:https://play.google.com/store/apps/details?id=com.vistechprojects.planimeter&hl=en

2.Center of polygon can be found by using the method in the following link
http://en.wikipedia.org/wiki/Centroid#Centroid_of_polygon

3.Calculation of area of grey shape in the above figure .

4 . Grey shape is the least possible area which can be grazed by the ALM . Grey shape is similar to the green area shape and it is formed when Green area is scaled down

To determine the scale down factor which is a numerical value ‘ n’ (n<1)
Where Grey area = n * Green area

Once the Grey area is known , the number of contours or tracks to be grazed by ALM have to be determined manually .

The width of contour is equal to the distance between the blades on the either end i.e. the width which can be grazed by ALM in a single stroke .

Green area = Grey area + area of track 1 + area of track 2 + area of track3 + . . . . . . + area of track n

5.Once the lawn mower is switched on ,it should reach the center of the lawn (red mark showed in the above figure)

6.Then, ALM should graze the least possible area or grey area .

7.After that ALM should Switch to contour circumscribing the grey area . It should continue circumscribing in each track till all the tracks are completed( decision has to be made by validating against the calculated and preset value ' No.of tracks' in ALM)

In this way entire lawn can be mowed without the need of perimeter wire and also ALM would not mow the neighbor’s lawn

Challenges :

a. Enable ALM to reach the center point of the lawn

a. To make ALM mow the grey area accurately

b. To make the ALM switch from one track to track .

c. To bypass the obstacle in track and return to the same track .

When i mentioned this idea to my colleague ,he mentioned the about possible cumulative addition of error in each iteration resulting in an unpredictable error in the end .

I intend to minimize the error and fix the boundary as correct as possible.
In fact this deviation should be predictable before it can be corrected .


问:
Tool calibration- orientation
I'm currently working calibrating a robot's tool. I have found some simple methods to get the tool centre point. But I'm unsure about how to get the tool's orientation relative to the robot's tip (the point where the tool is attached to the robot). The assumption here is that the tool-free robot is calibrated.

I'm looking for a solution which doesn't use camera or expensive sensors.

EDIT:
The robot is 6dof. The accuracy I'm looking at is approximately 0.1mm. The programming will be C language (How is this info related to the calibration method?).

Could someone guide in this aspect?

答:
You can also use a touch sensor, that can be as simple as a conductive pad that completes a circuit when a tool touches it to determine initial position with the distance of the tool length accounted for. It won't work unless you want the tool to return home for recalibration periodically though.

Also look into
teach position method

ContentLicense: CC BY-SA 4.0

Title: Tool calibration- orientation

ContentLicense: CC BY-SA 3.0


问:
Quadcopter controlled by Raspberry Pi
I have:

Raspberry Pi 3.

Pi camera.

CC3D flight controller.

I have already developed a Python script that decides whether the quadcopter dron has to turn left/right, move straight on or to stop.

Is there a way to connect the Raspberry Pi to the flight controller to send it the commands?

Is it as easy as it sounds?

Edit: I can change the flight controller if necessary.

答:
The easiest way to do this would be using UART for serial communication. The CC3D has TX/RX/GND pins which you connect to Raspberry Pi.

Now you will need some sort of protocol or data framing to send pitch/roll/yaw/throttle values to the flight controller and differentiate these values somehow. You can implement and use the MultiWii Serial Protocol for this purpose. Flight controller firmware such as CleanFlight already support MSP. On the RaspPi, PyMultiWii can be used to handle MSP frames.

What is the format or range of the controls the python script decides for the quadcopter? You will have to convert or map these values into MSP RC frame format. The pitch/roll/yaw/throttle range in MSP is 1000-2000 (centered at 1500 at pitch/roll/yaw) and 1000 for throttle stops all motors and 2000 is the max value for throttle. The RC frame also support 4 AUX channels, where you can send any sort of data you want. Here's a good tutorial for implementing MSP with python and STM32 microntroller (which is used on CC3D).

Tip: You can also make use of the MSP attitude and heading frame to get the pitch, roll and yaw computed from the IMU on the flight controller and integrate this with your Python script on RaspPi for better control!

Title: Quadcopter controlled by Raspberry Pi


问:
If two ir proximity sensors or two ultrasonic sensors are kept face to face , will they give bad readings for interference?
suppose there are two bots.their task is to detect each other and hit one another(as,i am participating in a sumo-bot competition). but if the two of them are using the same kind of sensors like ultrasonic or ir proximity (for object detection) then ,what will happen if they fight face to face?
won't there be an interference of the ultrasonic sound wave or infrared ray of two bots?

what will happen??

and what is the solution if this happens?

答:
Because you have not specified any particular Infrared nor ultrasonic device only generic responses possible.

Infrared range finder devices which triangulate normally project a small focused light on the target.  The receiver likely is only looking for the refection in a defined area.  So interference from reflection of other infrared signals should be unlikely.  However, if an infrared source was aimed at the receiver, it could flood it and cause an incorrect reading.  Since normal transmitters project a small focused light, this too should be unlikely.  But if the opponent wanted to, it may be possible to flood the play area with correctly modulated infrared light.

Ultrasonic range finders transmit and receive sounds waves timing all events.  So there is only a small window when the range finder is expecting to hear an echo.  Any sounds heard outside this window of time are likely ignored.  It would appear unlikely that two independent ultrasonic range finders would encounter overlapping windows where they would be susceptible to unexpected interference. That said, it may be possible to flood the play area with the correct ultrasonic sound to cause the opponent problems.

Software solutions exist to deal with unintentional interference.  Values that are known to be impossible can be rejected.  Minimum of, say, 3 samples and Maximum of, say, 3 samples can be used to remove outliers.  And averaging can be used to remove noise.


问:
Mass Matrix in Lagrange equation
I want to find the equations of motion of an RRRR robot.I have studied about it a bit but I am having some confusion.

Here, in one of the lectures I found online, it describes an Inertia matrix of a link as $\bf{I}_i$ which is computed by $\tilde{\bf{I}}_i$ also described  below?

In conclusion, the kinetic energy of a manipulator can be determined when, for each link, the following quantities are known:

the link mass $m_i$;

the inertia matrix $\bf{I}_i$, computed with respect to a frame $\mathcal{F}_i$ fixed to the center of mass in which it has a constant expression $\tilde{\bf{I}}_i$;

the linear velocity $\bf{v}_{Ci}$ of the center of mass, and the rotational velocity $\omega_i$ of the link (both expressed in $\mathcal{F}_0$);

the rotation matrix $\bf{R}_i$ between the frame fixed to the link and $\mathcal{F}_0$.

The kinetic energy $K_i$ of the i-th link has the form:

$$
K_i = \frac{1}{2}m_i\bf{v}_{Ci}^T\bf{v}_{Ci} + \frac{1}{2}\omega_i^T\bf{R}_i\tilde{\bf{I}}_i\bf{R}_i^T\omega_i \\
$$
  It is now necessary to compute the linear and rotational velocities ($\bf{v}_{Ci}$ and $\omega_i$) as functions of the Lagrangian coordinates (i.e. the joint variables $\bf{q}$).

So $\tilde{\bf{I}}_i$ is computed wrt to fixed frame attached to the centre of mass.

However in another example below from another source there is no rotation matrix multiplication with ${I}_{C_1}$ and $I_{C_2}$ as shown above. Am I missing something?

$\underline{\mbox{Matrix M}}$

$$
M = m_1 J_{v_1}^TJ_{v_1} + J_{\omega_1}^TI_{C_1}J_{\omega_1} + m_2 J_{v_2}^TJ_{v_2} + J_{\omega_2}^TI_{C_2}J_{\omega_2} \\
$$

What is the significance of multiplying Rotation matrix with $I_{C_1}$ or $\tilde{\bf{I}}_i$?

I am using former approach and getting fairly large mass matrix. Is it normal to have such long terms inside a Mass matrix? I still need to know though which method is correct.

(A series of images showing Mathematica output of a 4x4 matrix with some very, very long terms - A, B, C)

The equation I used for the mass matrix is:

$$
\begin{array}{lcl}
K & = & \displaystyle{\frac{1}{2}} \displaystyle{\sum_{i=1}^{n}} m_i\bf{v}_{Ci}^T \bf{v}_{Ci} + \displaystyle{\frac{1}{2}} \displaystyle{\sum_{i=1}^{n}} \omega_i^T\bf{R}_i\tilde{\bf{I}}_i\bf{R}_i^T\omega_i \\
& = & \boxed{ \frac{1}{2} \dot{\bf{q}}^T \sum_{i=1}^{n}\left[ m_i {\bf{J(\bf{q})}_{v}^{i}}^T {\bf{J(\bf{q})}_{v}^i} + {\bf{J(\bf{q})}_{\omega}^i}^T\bf{R}_i\tilde{\bf{I}}_i\bf{R}_i^T\bf{J(\bf{q})}_{\omega}^i \right] \dot{\bf{q}} } \\
& = & \displaystyle{\frac{1}{2}} \dot{\bf{q}}^T\bf{M(q)}\dot{\bf{q}} \\
& = & \displaystyle{\frac{1}{2}} \displaystyle{\sum_{i=1}^{n}} \displaystyle{\sum_{j=1}^{n}} M_{ij}(\bf{q})\dot{q}_i \dot{q}_j \\
\end{array}
$$

答:
I am not sure what exactly your question is. Here is something that might help.

The rotation matrix converts inertial matrix with respect to body fixed frame (F$_1$) to that in space fixed frame (F$_0$) in which the angular velocity has been expressed.

If you carefully read the derivation of Lagrange equation, you can see that both the Inertial matrix and angular velocity must be expressed in the same reference frame.

Title: Mass Matrix in Lagrange equation


问:
programming pan-tilt unit with C
I am trying to write a C code for a pan-tilt unit model ptu-d46 using visual studio 2010 in Windows 7, but I can't find any tutorial or reference on how to do so. All the user's manual mentions is that there is a C programmer's interface (model ptu-cpi) available, but it doesn't say where to find it nor how to use. I looked for it on google but couldn't find anything.

There is a command reference manual along with the user's manual, but it only shows the different commands to control the tilt and does not explain how to make a C program that connects to the tilt controller and sends queries to it.

Does anyone please have an idea of where I should look or if there are any open source programs for that. I'm not trying to make a complicated program. I just need it to connect to the tilt controller (the computer is connected via USB cable to the host RS232 of the tilt controller) and makes it nod to say "Yes" and "No" !

答: The command reference manual is here. These commands are sent as ASCII text to the serial interface on the controller.  How to send data to a serial port depends on your OS and how the device is attached.  On Linux, you'll probably open a device file like /dev/ttyXXX and write to that.  I don't know about Windows or MacOS.</p>

Title: programming pan-tilt unit with C

OwnerDisplayName: Lee Daniel Crocker


问:
Tracking a ball returning its x,y,z coordinates
I'm a Mechatronics Student Engineer, and still new with the computer vision field and am now working on a project that needs to Tracks a small ball and need to determine it's (x,y,z).
1st) Kinect was bad for detecting small objects.
2nd) Stereo with 2 cameras not hardware synchronized isn't accurate.
3rd) Single Stereo Camera is very expensive and I don't have any information of how dealing with it.

So how Can I track a ball to return its coordinates(x,y,z) ?

答: I did this for my project usingb 2 webcams,to get x,y,z it is a very hard topic you need to be well informed in computer vision,even you get a stero vision camera you need to threads,so you wont be dealing with low fps ,since you are using computer vision in 2 camera frame,getting depth from stero vision is hard,also the accuracy in stereo vision is less than a kinect,and takes a big amount of time,i recommend you use kinenct or a 3d camera,and it is not the camera that is important the more important thing is your code and your method to track the ball,there are alot of method to track it ,in kinect or any other3d vision system getting x,y,z is easy since you know the depth,otherwise if you want to use normal or fast camera,if you are not well informed  in computer vision ,i recommend you change the project</p>


问:
My Plug Says It's USB, I can't Identify
I ordered this cool little USB endoscope camera, but the cord does not look like any type of USB I have ever seen. I would eventually like to make this act like a webcam, so does that make a difference? It looks like this:

The back is just flat. I tried plugging in an Arduino RedBot cord because I had one lying around, it doesn't fit.

答:
USB is more than just a connector.  It is a standard communications protocol, voltage levels, and even wiring colors.

I suggest you get a standard USB cable, cut it in half, then splice in your wires.  http://wikipedia.org/wiki/USB does a good job of describing the pin outs on the various USB connectors.

Title: My Plug Says It's USB, I can't Identify


问:
How to find the Adjoint matrix of multiple twists
So let's say I have a three degrees-of-freedom robot with twists ${\xi}_{1}$, ${\xi}_2$, and ${\xi}_3$. The spatial Jacobian is given by
$$
J = \begin{bmatrix}\xi_1 & Ad_{g1}{\xi}_2 & Ad_{g12}{\xi}_3\end{bmatrix}
$$

I know that
$$
Ad_{g1} = \begin{bmatrix}R_1 & p \times R_1\\ 0 & R_1\end{bmatrix}
$$

However I am not sure how to calculate $Ad_{g12}$. Do I multiply $Ad_{g1} *Ad_{g2}$ or do I get the Transformation matrix of $\xi_1$ and $\xi_2$ and then use the formula for the adjoint?

答:
You want to use the product of exponentials to calculate the transformation of $\zeta_1$ and $\zeta_2$ for $\theta_1$ and $\theta_2$.

To be more clear, using your notation of $g_{12}$:
\begin{equation}
g_{12} = e^{\hat{\zeta_1} \theta_1} \cdot e^{\hat{\zeta_2} \theta_2}
\end{equation}

Where $\hat{\zeta_i}$ is the skew-symmetric matrix representation of the twist. Then you want to use the adjoint transformation of that resulting transformation matrix.

It is the transformation that takes the third joint's frame from its reference pose to it's current pose, and thus the adjoint transformation of this transforms the third joints unit twist to the current configuration.


问:
F/OSS Optical Object Avoidance
I am beginning work on a larger scale, 250-350 lbs wheeled robot and looking to use both optical and other means of object avoidance. I am concerned with a robot this large causing issues with running into things, including people as it has a top speed of 15mph and that would cause issues with safety. I am starting out with a remote control but am looking to have the robot become self contained. I have been loosely following the DARPA driver-less car project but will not have anywhere near the fiscal or power budget that they do for sensors and computers. Am I thinking to far afield with my idea of having a self-contained robot in the 250-300 lbs range that does not break the bank on optical object avoidance? Any comments or experiences will be greatly appreciated.</p>

答: If what you are looking at is a research topic, not a ready-to-use solution, then maybe visual servoing techniques with occlusion handling, or path planning in the image, might be of some use. (Never tested, but know the names behind it: http://www.irisa.fr/lagadic/visp/visp.html)</p>

Title: F/OSS Optical Object Avoidance


答:
You do not need the PTI-CPU (which is a separate product -- $250) for your application. It's only necessary if you are going to give the PTU instructions more than 10 times per second.

What you just need to do is figure out how to use a serial port in your environment, and send it the commands as described in the manual you already have.

Title: programming pan-tilt unit with C

Body:
I am trying to write a C code for a pan-tilt unit model ptu-d46 using visual studio 2010 in Windows 7, but I can't find any tutorial or reference on how to do so. All the user's manual mentions is that there is a C programmer's interface (model ptu-cpi) available, but it doesn't say where to find it nor how to use. I looked for it on google but couldn't find anything.

There is a command reference manual along with the user's manual, but it only shows the different commands to control the tilt and does not explain how to make a C program that connects to the tilt controller and sends queries to it.

Does anyone please have an idea of where I should look or if there are any open source programs for that. I'm not trying to make a complicated program. I just need it to connect to the tilt controller (the computer is connected via USB cable to the host RS232 of the tilt controller) and makes it nod to say "Yes" and "No" !

OwnerDisplayName: Gabe


问:
Is a larger Kv equivalent to more voltage?
I've been a fan of first person view drone Racing for years now and, in thinking of building a new quadcopter, I have a question I'm unable to resolve myself.

Please correct me if I'm wrong:

As i understand, a brushless motor has a maximum torque and power (Watts), if you push it beyond its limits it will start heating and eventually burn.

A brushless motor will always try to match the speed required drawing as much amps as is needed so increasing the power used.

Any brushless motor has a Kv value related to the coils windings that determines the rpm it will get without load per volt applied.

Then, can I say, for example, 1000 Kv at 1 volt will be equivalent to 500 Kv at 2 volts in terms of power, rpm and torque? So could I say it will generate the same lift?

Of course more voltage will reduce the amps but that's not related to the question, I think.

If this is true, I can't understand why actual drones do not run on bigger Kv and fewer cells since cells add weight and Kv not.

EDIT:

As a example of my question the DRL RacerX has broke the speed world record using T-motor f80 wich is a 2408 at 2500kv the manufacturer says it should be run at 16V achieving 680W but the 1900kv says 22V around 1000W.

The DRL used it at 42V (the 2500kv version) still with a 5 inch prop (Sure the motor will not survive for a long time), they just seemed to increase the amp rating of the controllers and just hope the motor will last long enought.

Why did they use such a high voltaje (2 x 5s) since that will not only increase the total weight but that will also increase the amps needed (as its increasing the load).

Im sure they had done their research and made the best they could but i want to understand why is that the best way of achieving it, the main question that comes to my mind is why not a larger prop? it should be much more efficient right? and still that drone is for a max speed record maneuverability is not needed

答:
OK so lets start with  Please correct me if I'm wrong

As I understand, a brushless motor has a maximum torque and power (Watts), if you push it beyond its limits it will start heating and eventually burn.

Yes(mostly).

A motor has a maximum torque called the "stall torque" that occurs when the motor is kept from moving (stalled).  The current that flows in that condition is called the "stall current".  In this case, all the energy that is going into the motor is producing heat and if the motor cannot get rid of it, the temperature will rise until something bad (and often irreversible) happens.

When a motor is operating it can also overheat; but, often in an aircraft the prop wash will help to cool the motor to reduce the risk of that.

Another failure mode can happen as you push to higher RPMs.  Every motor has a breaking point.  Here is a video of a really cool 3D printed motor that the author was able to get to 30,000 RPM!!! Note what happened at max RPM - it didn't burn up.

A brushless motor will always try to match the speed required drawing as much amps as is needed so increasing the power used.

Again, Yes(mostly).

The nature of an open loop DC Motor is that the motor output power (Power = RPM*Torque) will rise to the point that it matches the power available to it (input power - losses). RPM is not the only thing that limits this.  An example of this is when you grab the chuck of an electric drill and it slows down because the fixed power available forces the RPM to drop to compensate for the increased torque required.

Any brushless motor has a Kv value related to the coils windings that determines the rpm it will get without load per volt applied.

Yes
Kv is a pretty good model of what drives the RPM on an unloaded motor.  What is happening is that a motor also acts as a generator.  As the RPM increases, it generates a Voltage (called the Back EMF) that increases pretty linearly with the RPM.  This voltage works against the source voltage.  At some point the EMF will rise to match the source voltage and no more current will be able to flow into the motor.  If $V_{emf} = K_e  \omega \\$ then $K_v = 1 / K_e$.  This is where the $K_v$ comes from.

Then, can I say, for example, 1000 Kv at 1 volt will be equivalent to 500 Kv at 2 volts in terms of power, rpm and torque? So could I say it will generate the same lift?

NO  Generating lift means torque (load) and $K_v$ only applies in the theoretical world of no load.

Since lift = work and work = power, then (for a lossless motor) the same amount of power will be required to produce the same lift and if you are using the same propeller, the relationship between lift/torque and RPM will be the same; so, the required RPM and torque will be the same regardless of the $K_v$ of the motor.

In the real world there is another parameter $K_i$ and this parameter establishes the relation between current and Torque.  And, due to some interesting (and insidious) math (which I will get to in a bit) $K_i \propto 1 / K_v$.  So, as you get a bigger $K_v$ and get more RPM for the same voltage, you will get a smaller $K_i$ and get less torque for the same current.  The same power will be required and still no one will get a free lunch.

If this is true, I can't understand why actual drones do not run on
  bigger Kv and fewer cells since cells add weight and Kv not.

So from the above discussion, $K_v$ really has not affect on the number of batteries that are required for the same performance.  If you increase $K_v$, sure you need less voltage; but, you will draw more current either requiring more cells to reach the required current or to match the battery life.  The power required by the motor times the run time will result in the energy required in Joules which also will be the battery capacity in Ah times its voltage (which also is Joules).

Now, regarding the T-motor f80 2408 you mentioned, Mini Quad did a pretty detailed Bench Test.  Here is some of the data.  It looks pretty sweet to me.

Note that for the 5" prop it hits about 28,000 RPM at 16V (28000/16=1750$K_v$???) - NO - this is loaded not unloaded.  Also note how much current was required - 30A Average with 162A peak.  Max nominal discharge for a battery is normally about 25C.  That would mean you would need to use a 16V, 1200mAh battery pack. The real limit, however, will likely be peak current.  I believe a LIPO battery probably can't do more than 50C discharge rate; so, 162/50 means you will probably need at least a 16V 3200mAh battery which will NOT be small.

There is also going to be some magic in the Motor Controller to be able to get the full power out of this motor by optimizing the voltage on each motor phase and also managing the currents.

I hope this helping you understand that there is A LOT more to getting the maximum power to weight than just having a large $K_v$.


问:
How to apply Inverse Kinematics with angle constrained servos?
I want to implement Inverse Kinematics and i understand the inverse jacobian method but the servos i have only have a range from -90 to +90 degrees, how can i implement this detail in the algorithm? I can't simply set each joint to its maximum/minimum if the calculated angle is above/below the constraints because if i do future calculations will not understand that the maximum angle is not the correct path</p>

答:
it depends on your design,how many joints you have,
all the movement might happen in 180 degree/depending on the work space you want
,let say for a x,y,z point for the end effector ,you could have multiple  angles but different paths to get to same,for a point you might have multiple set of angles for each joint. you could use limits to pick one set of angles which doesnt have any degree more than 180, but if a point which cant be reached unless you need to have an angle that is more than 90/-90 then you cant go there,as i said it depends on your workspace and design
also be aware from singularity points,</p>


问:
Powering a robot using the 12v adapter
Hello every one hope you all alrigt

I am working on a mecanum wheel robot and now I am facing a problem to afford a lipo battery which the required voltage to power my robot is 12
So I think that I can exploit the 12v adapter to power my robot and I want to know if its possible or no

First I have a cotroller which takes a rated voltage 6v - 12v and rated current 1.5 A

And tow motor drivers with driving voltage of 6 - 12 v and driving current of 8A

My idea is to take an adapter like this one

And connect in parallel with these three chips to power my robot
Is that possible ?

答:
You have to check how much current your power adapter can draw.

If i understand correctly, you need at least 12v 9.5A to make your robot work. (~8A+1.5A).

The kind of power adapter you showed on the picture generally does not provide this much current.

Title: Powering a robot using the 12v adapter


问:
Programming Forward and Inverse Kinematics of PUMA 560?
I am currently coding a Forward and Inverse Kinematics solver for a PUMA 560 robot. For the Inverse Kinematics part I am using the closed for solution given in this paper. But my issue is, my solution for IK for a given set of (x,y,z) does not return the same values returned by my FK values. The reason I am doing this is to verify my code accurately computes the FK and IK.

These are the DH parameters for my robot (These are Python code, since I was testing my algorithm on Spyder IDE before implementing on C++).

DH Parameters

Link lengths

   a = [0, 650, 0, 0, 0, 0]

Link offsets

  d = [0, 190, 0, 600, 0, 125]

Link twist angle

  alpha = [-pi/2, 0, pi/2, -pi/2, pi/2, 0]

So basically I finding the T transformation matrix for each link from the the base frame {B} to wrist frame {W}. This is my code;

 Function to compute Forward Kinematics

```<code>def forwardK(q):

#T06 is the location of Wrist frame, {W}, relative to Base frame, {B}
T01 = genT(q[0],0,d[0],0)
T12 = genT(q[1],a[0],d[1],alpha[0])
T23 = genT(q[2],a[1],d[2],alpha[1])
T34 = genT(q[3],a[2],d[3],alpha[2])
T45 = genT(q[4],a[3],d[4],alpha[3])
T56 = genT(q[5],a[4],d[5],alpha[4])

#Tool frame {T}
#T67 = genT(0,0,d[5],0)

T03 = matmul(T01,T12,T23)
T36 = matmul(T34,T45,T56)
T06 = matmul(T03,T36)
#T07 = matmul(T06,T67)

x = T[0][3]
y = T[1][3]
z = T[2][3]

print("X: ",x)
print("Y: ",y)
print("Z: ",z,"\n")
print("T: ",T,"\n")

return T06
</code>```

 The function to compute  T Matrix

```<code>def genT(theta, a, d, alpha):
T =  array([[cos(theta), (-sin(theta)), 0, a],
    [sin(theta)*cos(alpha), (cos(theta)*cos(alpha)), -sin(alpha), (-   d*sin(alpha))],
    [sin(theta)*sin(alpha), cos(theta)*sin(alpha), cos(alpha), cos(alpha)*d],
    [0, 0, 0, 1]])

return T
</code>```

from the T Matrix relating the {B} frame to the {W} frame position vector of the {w} [x y z] is extracted. R Matrix (orientation) of the {W} relative to the {B} is obtained by the following piece of code;

```<code>T = forwardK([30,-110,-30,0,0,0])
x = T[0][3]
y = T[1][3]
z = T[2][3]
R = T[0:3,0:3]
</code>```

Where T is the transformation matrix relating {W} to {B}. Then this information is fed in to the invK(x,y,z,R,ARM,ELOBOW,WRIST) function to check if the algorithm returns the same set of angles fed to the forwardK(q1,q2,q3,q4,q5,q6) function.

In the invK(x,y,z,R,ARM,ELOBOW,WRIST)
      - ARM, ELBOW, WRIST are orientation specifiers to describe various possible configurations of the manipulator. Each of these parameters are either {+1,-1}. These values are then used in the closed form geometrical solution presented by the afore-mentioned paper.

I did not post the code for the invK(x,y,z,R,ARM,ELOBOW,WRIST) since it is a direct implementation of the closed form solution presented in the paper and also it significantly long hence making it highly unreadable.

What do you think I am doing wrong? I am quite sure the way I am computing the FK is correct but I could be wrong. The matrix multiplications of my Python code are correct since I double checked them with Matlab. Any advice is appointed.

答:
You can't really make progress until you are sure the FK calculations are correct.

Think about the angles you are setting the joints to and where you expect the robot to be, and how you expect it to look. It is worth working through the DH transformations and drawing out all the frames in your own diagram.

Make sure you know whether you are using DH or Modified DH notation, as 50k4 mentions, and use one approach consistently. Make sure the link parameters match with the method.

If using DH you should have:

For Modified DH your reference is:

It looks like Lee and Zeigler are using DH so I would stick with that if you are wanting to use their solution.

To code up the FK and IK, these are the steps I normally use:

Split up your matrix multiplications and calculate the joint positions, joint by joint and test with known angles to check you have the correct positions.

Using the above calculations, plot your links using matplotlib or matlab. This will give you a visual reference.

Code up the solution for the FK and IK using the equations in Lee and Ziegler. You can test against this.

Generate a large range of angle inputs and output positions from your code

Write unit tests for your solvers using the output of 4

Once you have done this, work through the joints systematically trying different poses. Also once you have the FK solution correct, this will give you a test for your IK as you can then solve forwards and back and you should get to your original joint inputs.

If you are still stuck after doing this, then you will be in a better position to ask more specific questions here.


问:
clarity in understanding the moment of inertia matrix D and Coriolisis and centripetal matrix C as per attached equations
Would appreciate if anyone could help me understand the how if equation 6 and 7 are derived. Helping with any one D22 and C32 would suffice.

答:
Where did this example come from? It looks like maybe a class handout or similar. I don't agree with all of the formulas given, but I'll try to explain where I think they should be coming from.

The $\bf{D}$ matrix is pretty straightforward - the key here is to understand the parallel axis theorem, which is a formula for finding the moment of inertia at one point given the moment of inertia at the center of mass and the mass:

$$
I_{\mbox{new}} = I_{\mbox{center of mass}} + mr^2 \\
$$

The linkages form a kinematic tree, where each joint "feels" the mass of its "downstream" link and the effective masses of all links attached after it as well.

So, start with the last term in the matrix - $\bf{D}_{44}$:

$$
D_{44} = I_{bu} + M_{bu}r_4^2 \\
$$

This is exactly the parallel axis theorem. You transfer the moment of inertia from the center of mass of the bucket to the stick-bucket joint, because that's where you're rotating. The next step is a little tricky because everything has already been reduced. I'll walk through the derivation of $\bf{D}_{33}$ and then hand-wave the rest saying the method is similar.

The distance from $O_2$ to $O_3$ is $a_3$. The distance from $O_3$ to $G_4$ is $r_4$.

If you wanted to get the distance from $O_2$ to $G_4$, then you could use the Pythagorean theorem, but that's only applicable for right triangles, so what you have to use instead is the law of cosines, which is a generalization of the Pythagorean theorem that applies to all triangles:

$$
c^2 = a^2 + b^2 - 2ab\cos{\gamma} \\
$$
Where $\gamma$ is the angle between $a$ and $b$. Side note: for right triangles, they're "right" because the angle between $a$ and $b$ is a right angle (90 degrees), so the cosine of 90 is zero, so that term drops off and you're left with the Pythagorean theorem.

So, for your example, you need not just the angle of the stick-bucket joint, but also the angle from that joint to the center of mass.

The angle of the stick-bucket joint is $\pi + \theta_4$, per the drawing, and now you need the angle from the $O_3 - O_4$ joint to the center of mass of the bucket; this is given as $\alpha_4$.

Now, going back to the parallel axis theorem, if you wanted the moment of inertia for the bucket about the stick-boom joint, you need the moment of inertia for the bucket at the bucket's center of mass, and then you need the straight-line distance from the bucket-stick joint out to the center of mass of the boom.

Call that distance $c$, call the distance from the boom-stick (joke) joint to the stick-bucket joint $a$, and the distance from the stick-bucket joint to the bucket center of mass $b$, then what you get is:

$$
I_{\mbox{bucket about boom-stick joint}} = I_bu + M_{bu}c^2 \\
$$

$$
c^2 = a^2 + b^2 - 2ab\cos{\left(\mbox{joint angle} + \mbox{center of mass angle}\right)} \\
$$

$$
c^2 = a_3^2 + r_4^2 - 2a_3r_4\cos{\left(\left(\pi + \theta_4\right) + \left(\alpha_4\right)\right)} \\
$$

Now a little regrouping in the cosine term:

$$
c^2 = a_3^2 + r_4^2 - 2a_3r_4\cos{\left(\pi +\left(\theta_4 + \alpha_4\right)\right)} \\
$$

And finally a period shift identity:

$$
\cos(\pi + \theta) = -\cos{\theta} \\
$$

And you get:

$$
c^2 = a_3^2 + r_4^2 - 2a_3r_4\left(-\cos{\left(\theta_4 + \alpha_4\right)}\right) \\
$$

Distribute the negative:

$$
c^2 = a_3^2 + r_4^2 + 2a_3r_4\cos{\left(\theta_4 + \alpha_4\right)} \\
$$

NOW FINALLY plug this $c^2$ back into the shifted moment of inertia equation:

$$
\begin{array}{ccl}
I_{\mbox{bucket about boom-stick joint}} & = & I_{bu} + M_{bu}c^2 \\
& = & I_{bu} + M_{bu}(a_3^2 + r_4^2 + 2a_3r_4\cos{\left(\theta_4 + \alpha_4\right)}) \\
& = & I_{bu} + M_{bu}r_4^2 + M_{bu}(a_3^2 + 2a_3r_4\cos{\left(\theta_4 + \alpha_4\right)}) \\
\end{array}
$$

Now recognize that $D_{44} = I_{bu} + M_{bu}r_4^2$, meaning that:

$$
I_{\mbox{bucket about boom-stick joint}} = D_{44} + M_{bu}(a_3^2 + 2a_3r_4\cos{\left(\theta_4 + \alpha_4\right)}) \\
$$

So that's the moment of inertia of the bucket about the boom-stick joint, now you also need to add the moment of inertia of the stick about the boom-stick joint,

$$
I_{\mbox{stick about boom-stick joint}} = I_{st} + M_{st}r_3^2 \\
$$

Put it all together and get:
$$
\begin{array}{ccl}
I_{33} = D_{33}& = & I_{\mbox{stick about boom-stick joint}} + I_{\mbox{bucket about boom-stick joint}} \\
& = & I_{st} + M_{st}r_3^2 + D_{44} + M_{bu}(a_3^2 + 2a_3r_4\cos{\left(\theta_4 + \alpha_4\right)}) \\
& = & \boxed{D_{44} + I_{st} + M_{st}r_3^2 + M_{bu}(a_3^2 + 2a_3r_4\cos{\left(\theta_4 + \alpha_4\right)})} \\
\end{array}
$$

Short P.S. -

The trouble with calculating the Coriolis force (why I'm not willing to do it at the moment) is that it's a cross-product. You're looking at a singular plane, but it looks like the axes are flipping for some reason; $O_3$ and $O_4$ seem to be rotated about the y-axis? Or maybe the y- and x-axes? I can't tell if that's a typo or not.

Anyways, you should take the cross-product and then keep the terms about the axes you care about; the forces about the axes in the plane don't affect the solution.

But, there are a lot of typos in the document;

$D_{44} = I_{bu} + M_{bu}R_4^2$ should be $D_{44} = I_{bu} + M_{bu}r_4^2$,

$D_{24} = D_{42} + D_{34} + (...)$ should probably be $D_{24} = D_{42} = D_{34} + (...)$,

I think that the signs are wrong on the off-diagonal $D$ terms, but I'm not willing to study the problem hard enough to verify,

there are $\dot{\theta}_{234}$ terms that aren't defined, etc.

I would definitely question the source/author of the paper you've acquired. Generally speaking, the method is as I've described above. Start where the only force is the local one, then work your way up (or down) the kinematic chain. Subsequent forces are the new local forces plus all of the previous forces expressed relative to the local frame.


问:
Wire connectors
I'm making an Iron Man costume for Comic-Con and it has electronics in the hand and head.
I'm going to route both to the back to be handled. There is a certain type of wire connector that I want to use to connect across the shoulder and neck and I don't know what it's called. The connector is the same one that small lipo batteries and pc fans use, the one with the clip to prevent unwanted detachment but pushing on it allows for easy removal.

What is this type of wire connector called?

I uploaded some pictures to make sure you know which ones I'm taking about.

imgur.com/a/afeEw

答:
Computer fans usually use Molex connectors, however there are different versions of Molex connectors:
https://en.wikipedia.org/wiki/Computer_fan#Connectors

Small LiPo batteries often use JST connectors. Again there are different versions and the Internet often does not differentiate correctly. Popular JST versions are JST XH and JST RCY. Bigger batteries might use custom connectors.
http://www.rchelicopterfun.com/rc-lipo-battery-connector.html

For examples:
(I currently can't post more than two links)
Check your favourite supplier shop and search for Molex and JST. Just as a shop-example I'll mention: reichelt.

Title: Wire connectors


问:
Handling PID DC motor control at low speeds
I am building a 4 wheel rover and am using PID DC motor control for the back set of wheels. The feedback for the speed is provided by Hall effect sensors, with two pulses per rotation.

This means with the motor as 100% duty, the sensor returns a 240Hz signal (4.2ms between pulses) and at the lowest duty for when the wheels are turning 20% duty, the sensor returns a 14.33 Hz signal (74.2 ms between pulses).

I'm using a STM32 Cortex-M3 part for the controller and a timer to capture the hall effect input and convert this to frequency. This is done by comparing two capture samples through a ISR that triggers on each rising edge.

The issue I have is the PID loop is running at a rate of 50Hz, so when the motor is running at low speeds and a timer compare has not been done, it returns the last calculated value. This is fine, but I could also find myself in the situation where the motor has stopped spinning and I haven't been able to update the captured frequency due to the second pulse not having arrived.

Im just wonder if there is a sensible way of handling this ?

Thanks.

答:
I came up with a solution in the end.

Fire a periodic interrupt at a fixed rate (In my case, I configured the STM32 to fire a systick interrupt every 1ms

In the ISR for the 1ms timer, decrement a global variable down to zero (stopping at zero)

In the ISR for compare and capture timer that detects the pulse from the Hall effect sensor, set the same global variable above to a "time-out value" (In my case 100). This is the millisecond value to denote the maximum period for the pulses.

When polling for frequency of the hall effect sensor, I now check if the global variable is zero. If it is, I return zero (It would have decremented down to zero if no pulses have been received for 100ms) else I return the last measured frequency.

As I said above the slowest period I detect before the motor becomes stationary is 73.2ms, so the 100ms timeout gives me some buffer for example if the robot is moving down hill and can actually register a speed slower than this.


问:
Sensing an actuator using vision
I am looking forward for a method to sense in real time, using computer vision for a control application.

For this I am unsure of which is the right platform . I am well versed with MATLAB, but I am wondering if it will be able to do the image processing in real time or not.

If there are other platforms which are much quicker, you can please recommend me.

答: The branch of science that is binding vision and control is called visual servoying. You can find visp written in cpp or matlab implementations. Check also if visp is having a matlab bridge/api. If you have a professional robot (not a diy one ) i think ROS + visp will be a good start.</p>

Title: Sensing an actuator using vision


问:
Robot real time control
I want to control a arduino based robot in real time , i am confused whether simulink real time control is a better option or Using ROS ??

I am familiar with the simulink , My application is to controlling the robot using controller with time delay .

Can anyone suggest me which way should i go ?

答: ROS is not offering real time(RT) control by default. Specially ROS 1.0, ROS 2.0 is still under development. Though there are many hacky/tweaky ways to let ROS perform in soft RT. I wouldn't recommend it unless you have some maturity in ROS. </p>

Title: Robot real time control


问:
Jacobian of a Robot
What is the dimension of the Jacobian of a robot with 9 actuators and 6 degrees of
freedom? 6 x 9 is my guess but not sure. Can someone please explain ?</p>

答: Yes, 6x9.   Since $$\dot{x} = J \dot{\theta}$$ each column of the Jacobian represents the differential change in one of the six $x$ coordinates with respect to each of the joints.  </p>

Title: Jacobian of a Robot


问:
RC Transmitter for DIY
A couple of years ago I bought a WLToys V222 quadcopter.

I would like to know if there is a way to use the transmitter to control some DIY projects?

Does anyone know how I could do that?

答:
I opened up the quadcopter and Identified the chips it uses

Mini54 microcontroller

MPU-6050 Motion Tracking Device

BK2423 2.4 GHz Transceiver

Based on this, I found the NRF24L01 which appeared to be compatible which I purchased on eBay for a whopping $0.67US

After a bit of time and part in hand I hooked it up to an Arduino and I was able to control a servo using my inexpensive wireless controller.

SUCCESS!!

If you would like more information, Up Vote this and add a comment.

Title: RC Transmitter for DIY


问:
Forward monocular stereo vision (Structure from Motion)
I am looking for a library (or algorithm) that computes 3D scene (point cloud) from 2 consecutive images of a monocular sequence. I mean something like OpenSfM but only for 2 consecutive frames and also with a known camera calibration data (I dont need to do "bundle adjustment" like most of the SfM libraries do). I do know my absolute camera translation for the scale.</p>

答:
It turns out this can easily be done with OpenCV - just find image features (FAST etc.) in first image, track them to the second image (get a set of corresponding features between two images) and then use triangulatePoints function to get the 3D scene.

triangulatePoints accepts two projection matrices - one for each image. Each projection matrix defines camera intrinsic (focal + principal point) and extrinsic (rotation + translation) parameters. Intrinsics will be the same for both images, first image may have R+t all zero (coordinates origin) so just use R+t for your second image (compared back to zero).


问:
DH parameters solution for forward kinematics
I am stuck at a problem of solving DH parameters for a simple test mechanism. I know that the given mechanism is a structure but just for pure academic purposes assume that it's a real system. I only want to know the correct way to solve a system with DH parameters, when there is only one active joint and more than one passive joints that depend totally on the command of the actuated joint.

-- Joints (All joints are Revolute): J1 (Actuated by some motor)
        J2 (Passive)
        J3 (Passive)

-- Links: L1,L2 (Rigid Links)
The link 1 and link 2 are not directly connected at joint J2 but there is a small link that connects link L1 with joint J2. It is not visible in top view but it allows the system to work in real life. But please just ignore it for this example!

-- The images are the top view with the z axis for each joint coming out of the paper.

-- Assuming clockwise rotation as positive for this problem.

![Page#1]
[edit]I realize that the transformations below are wrong and not done by following the DH convention. I should have but instead I followed the standard method. But once I apply DH coordinate axis, I should use the DH method. But this still does not change the real question in the last picture. Thank you

![Page#2]

@Chuck:

Problem: J1 is the only active joint in the system. j2 and J3 are passive joints. I want to find the kinematic equations of the system(basically, I want to find the Joint angle of J3(Pitch) as a function of Joint angle of J1). I have shown the DH coordinate axis in the first picture. I can only measure J1 angle with an encoder but J2 and J3 are passive, so I have to find their relation with J1 to get their value for the transformation matrix. Since the choice of first joints x axis is arbitrary in DH method, I chose x0 axis parallel to link L2 and then found theta2 as a function of theta1. I want to know, is this the correct way to find the passive joints angle as a function of an active joint?

If my solution of joint paramter Theta2 = 180 - Theta1 is not correct, then how would you find the joint parameter Theta2 as a function of Theta1, since you can not measure Theta2(for it is passive), you can only find Theta2 mathematically and its very important to find Theta2 to get the transformation matrix from J3 coordinate system to J1 coordinate system(The goal)...

I expect the system to move like this when the Joint 1 motor is actuated in clockwise direction

![Page#3]

EDIT

Hey chuck, As the following sketch shows, the motor housing is fixed on the box, it rotates with the same angle as the box about joint J4. The blue dot in the previous image is the motor axis of rotation which I called J1 because it links the motor shaft with the link L12.

If the motor shaft is rotated anti-clockwise by an angle Pfi, it makes the whole box move with it but not with the same angle. I have to find the box rotation about joint J4 as a result of this rotation of motor shaft about J1 by Phi..

As you explained, I can solve the 4 bar mechanism but how can this motors angle of rotation be related to the 4 bar mechasim's four angles Theta12,Theta23,Theta34 and Theta41 ?

![Page#4]

After anti clockwise rotation..

![Page#5]

答:
Ah ha! From my comment earlier -

If it's kinematics, then none of the joints are a function of any of the other joints. The only exception is if you had a kinematic loop, like a four bar mechanism, or a rocker, or a crank.

What you have is a four bar mechanism, and it has probably been giving you trouble because:

It's just a hard problem to begin with, and

You haven't been drawing the complete diagram for your analysis.

There are four links (or "bars") and they form a kinematic loop. Two are obvious, one is a little less obvious, and the last one is disguised. Your links are:

The link from J1 to J2,

The link from J2 to J3,

those you already have and have been giving for the problem statement, BUT you also have:

The wall, which acts as a link between J3 and J4, and

The box itself, which acts as a link between J4 and J1.

You can see that the links go J1 -> J2 -> J3 -> J4 -> J1, and so they form the loop.

I'm on mobile for the rest of the night, so it'll be tomorrow before I can give a fuller answer (at the earliest), but you should look up the "Freudenstein equation" as a starting point for the solution. Springer has a decent paper on it, but you have to pay for it, of course.

The gist is to label all of your angles, theta 1 through 4, and then to work your way top to bottom using and terms like L1 sin(theta1) + ... + L4 sin(theta4) = 0 and similarly with cosine from left to right. The key concept here is that you're forming a closed LOOP, so you must end where you started when you add together all the vertical (or horizontal) components of each link.

The biggest pain there is to be really consistent with your notation, but that's true of all engineering, isn't it? You may find that the vertical component of a link might involve a cosine term, and vice versa, depending on how you defined the datums (data) and positive conventions, etc.

I'll draw a picture later, but hopefully that's enough to get you started.

:EDIT:

Okay, some drawings to go with the answer.

First, re-draw the problem with all the links.

Then, be consistent with notation. In my method of solving, I assume +y is up and +x is to the right. Then I use the right hand rule that the angle should be positive in a counter-clockwise direction (right hand rotation about +z axis, which points "up out of the page.")

With the picture above, you can make a couple equations. First, combine all of the vertical components of the linkages:

$$
L_{12}\sin{\theta_{12}} + L_{23}\sin{\theta_{23}} + L_{34}\sin{\theta_{34}} + L_{41}\sin{\theta_{41}} = 0 \\
$$

Then, do the same for the horizontal components:

$$
L_{12}\cos{\theta_{12}} + L_{23}\cos{\theta_{23}} + L_{34}\cos{\theta_{34}} + L_{41}\cos{\theta_{41}} = 0 \\
$$

So, two equations and two unknowns - you need at least one more. For that, look at the interior angles. To do that, try to "rephrase" the interior angles in terms of the angles as already defined.

First, use the alternate interior angles:

Then, "clip" the other angles in preparation for using THEIR alternate interior angles:

Now you have a good setup to getting the interior angles:

And now, finally, you get the formulas for the interior angles:

$$
\begin{array}{ccc}
\theta_{{J_1}_{\mbox{interior}}} & = & \theta_{12} - \left(\theta_{41} - \pi \right) \\
\theta_{{J_2}_{\mbox{interior}}} & = & \left(\theta_{23} - \pi \right) - \theta_{12} \\
\theta_{{J_3}_{\mbox{interior}}} & = & \left(\theta_{23} - \pi \right) - \theta_{34}\\
\theta_{{J_4}_{\mbox{interior}}} & = & \left(\theta_{41} - \pi \right) - \theta_{34}\\
\end{array}
$$

The last step now is to recognize that the sum of interior angles, $\theta_{J_1} ... \theta_{J_4}$ is 360 degrees, or $2\pi$:

$$
\theta_{J_1} + \theta_{J_2} + \theta_{J_3} + \theta_{J_4} = 2\pi \\
$$

This now gives you three equations and four unknowns, which means you can now express any one of the angles $\theta_{J_2} .. \theta_{J_4}$ in terms of the actuated joint $\theta_{J_1}$.

NOTE THAT my expression for $\theta_{J_1}$, or $\theta_{41}$, is not the same as your $\theta_1$ and is not necessarily the same as the DH representation for the joint either. You'll have to re-express the joint angles (again), but hopefully I've outlined the process for you.

Final note - you might not be able to get a "clean" solution to this set of equations because they are nonlinear (thanks, trig -.-). You are likely to need a numeric solver to get the answer for the joint angles.


问:
Generating double s-curve velocity profiles with given time
I wonder how to generate double s-curve velocity profile for multiple DOF trajectory. Since there are constraints on initial and final velocities which can be non-zero it is necessary to synchronize each DOF in time. Therefore firstly I would like to compute trajectory for DOF with the largest displacement and then trying to fit other DOFs in the computed execution time for the former. However I was not able to find anything about generating s-curve profile with given time. Having tried to solve it by myself I came up with a conviction that it is an optimization problem. I tried several approaches but they all seemed to have non-convex cost function and hardly could they satisfy constraints on final velocity. Having spent much time I wondered if there is an easy way to synchronize them?</p>

答:
Yes, this is indeed a difficult non-convex optimization problem. But if, say, second-order polynomial (parabolic) trajectories work for you, then there are some heuristics that you might want to look into.

For parabolic trajectories, the procedure for computing the time-optimal (1D) trajectory exists (see e.g., this paper). So first you can compute 1D velocity profiles for all DOFs and see which DOF takes the most time. Suppose DOF $i$ takes time $T$ to reach its destination, you need to synchronize other DOFs with time $t =T$, because DOF $i$ cannot go any faster.

Then the next step is kind of velocity profile stretching, i.e., for each DOF $j \neq i$ we stretch the velocity profile such that it has duration $t$ as specified earlier. For this steps, many heuristics can be used. One of them is described in the paper I mentioned above (this method is somewhat constrained due to some assumptions made in the paper). Another one is implemented in OpenRAVE, see this file (the detail of the method implemented was given alongside of the code, this method is less constrained than the first).

Note that given a duration $t$ to synchronize a trajectory with, the problem is not always feasible due to inoperative time interval (this paper mentioned this topic a bit). Basically, due to velocity and acceleration limits of the robot joints, given a set of boundary conditions (such as initial and final velocities), there might exists some time interval $\tau = [t_0, t_1]$ such that there exists no trajectory which satisfies the boundary conditions and has a duration $t \in \tau$.


问:
Localizing two points using self position and angle between this points
my question is about localizing points in 2D space.

I know exact position (x,y,alpha) of my robot in some room. In room there are two points of unknow location.

Robot can find angle between he and two points in room. Also robot can move on room, and find more angles between this two points and his.

How to solve this problem, when I want to discover the position of this two points in room?

I can move robot where it's needed, but what should I do to discover this positions??

答:
I assume that (x,y,alpha) represents the pose of the robot with (x,y) as the origin of the robot frame with respect to the reference frame in the corner (image shown below). And alpha is the angle of the vector connecting the origin of our reference frame to the origin of robot frame (you could also call it rotation around Z axis pointing out of the screen).

For example in this diagram, the alpha angle is zero:

So if you now look closely to the figure, you find what I think is the solution.

The angle $\alpha$ shown in the figure is the angle between the robot and the unknown point in the reference XY plane. If you go from position 1 to position 2 where the angle $\alpha$ stays constant or ($180+\alpha$) and go to position 3 & 4 where you know a second angle, you can calculate the position of the point.

The point lies on the cross of the two lines connecting 1 to 2 and 3 to 4. But you have to be sure you cross the unknown point.

In the meantime while writing this, I have a second solution:

You move in the +X direction.

If angle is increasing, once you are at 90 $\deg$, the robot has the same $y$ value as the point.

If it's constant you have the $y$ already.

If it decreases you are going in the wrong direction and have to go -X direction.

Then you repeat the same for the +Y motion.


答: I have found a solution. Quiet simple actually. To generate minimum time double s-curve profile I used algorithm presented in this wonderful book. After computing trajectory for the first DOF I perform the same algorithm for the other DOFs but if trajectory is infeasible with given time, it is appeared to be a good idea to make maximum possible acceleration smaller and smaller with some factor(I use 0.95) which leads to longer trajectory execution. Moreover we can do the same with maximum velocity and jerk constraints which will make more trajectories to be feasible. However this will take significantly more time and since all my tests passed with only decreasing acceleration I am satisfied.</p>

Title: Generating double s-curve velocity profiles with given time

Body: I wonder how to generate double s-curve velocity profile for multiple DOF trajectory. Since there are constraints on initial and final velocities which can be non-zero it is necessary to synchronize each DOF in time. Therefore firstly I would like to compute trajectory for DOF with the largest displacement and then trying to fit other DOFs in the computed execution time for the former. However I was not able to find anything about generating s-curve profile with given time. Having tried to solve it by myself I came up with a conviction that it is an optimization problem. I tried several approaches but they all seemed to have non-convex cost function and hardly could they satisfy constraints on final velocity. Having spent much time I wondered if there is an easy way to synchronize them?</p>


答:
I don't have the time at the moment to post a full answer with every step shown, but consider the following diagram:

Your robot starts at origin 1, $O_1$, and moves some distance $d$ to get to the second origin, $O_2$. Each origin has its own $<x,y>$ coordinate.

You can measure the angle to point 1, $a_1$, at the first origin. When you re-measure a new angle, $a_2$, at the second origin, you can find the second interior angle of the triangle $O_1$ $\mbox{pt}_1$ $O_2$ as $\pi-a_2$. Now, with two angles and a side, you can use the law of sines to calculate the distance from $O_1$ to $\mbox{pt}_1$, $r_{a_1}$, and the distance from $O_2$ to $\mbox{pt}_1$, $r_{a_2}$.

You can imagine this as the intersection of two circles now:

And, indeed, you can solve the problem with the formula for the intersection of two circles.

There are two intersections shown in the image above, and the circle intersection formula will also give two answers, but only one will correspond with the angles you found.

Please give this method a try. If you find you have more questions, please start a new question and link this one in the post.

Title: Localizing two points using self position and angle between this points

Body:
my question is about localizing points in 2D space.

I know exact position (x,y,alpha) of my robot in some room. In room there are two points of unknow location.

Robot can find angle between he and two points in room. Also robot can move on room, and find more angles between this two points and his.

How to solve this problem, when I want to discover the position of this two points in room?

I can move robot where it's needed, but what should I do to discover this positions??


问:
how to make a configuration space of a robot manipulator?
How to make a configuration space of a robot manipulator from a work space ? it's robot manipulator is 3 degree of freedom. Is a robot manipulator with more degrees of freedom the same process ?. Do more links affect the config space?</p>

答:
I am not exactly sure what the question is, (maybe you are confused on terminology), but I will take a shot.

Forward Kinematics (FK) defines the transform between a robot's joint space (aka configuration space) and its end-effector's task space (aka operational space).  While Inverse Kinematics (IK) defines the opposite; the transform from task space to joint space.  A robot's workspace is simply the volume of space that the end-effector can reach.

For serial-link arms (aka open kinematic chain), "regular" robot arms, computing the FK gets more complicated as you add degrees of freedom, but is still relatively straight-forward.  There are closed-form solutions for IK for certain arm styles and DoF, but is more complicated in general.  Typically this is done numerically for larger DoF.


问:
Which programming language should I use with the NXT?
We have an optional course in our high-school which is about robotics. We're using the Lego Mindstorms NXT and program it with the original Mindstorms-software.
However, we want to advance and use a major programming-language. We have tried NXC and LeJos. Plus, I tried out the Microsoft Robotics Development Studio, but with all these different possibilities we are a little bit overwhelmed.

Because of that (now it becomes interesting), I want to ask, what technology is the best for NXT and especially: What is easy to use? I don't want to need 14 steps just to compile a program and get it running on the NXT. Also, it would be nice, if it's an extend-able language, like using C#, but are there some better or easier possibilities?

答:
NXT-G is based on LabView. If you don't like LabView, you won't like NXT-G. Good news though. Lego just debuted Mindstorms EV3. It uses a language based on ICON. Something you may be more interested in. It should be available this winter. http://mindstorms.lego.com/en-us/News/ReadMore/Default.aspx?id=476243

Also, while browsing questions on this site, I learned about this: http://www.ros.org/wiki/Robots/NXT

A group has apparently built bindings that are relatively simple to use for the Robot Operating System and NXT. EV3 is still cooler, but if you simply must use NXT, I would give ROS a try.

ROS uses NXT-python which you might also give a look as well.


答:
Let's start from the definition. (Well, there are actually a few possible definitions depending on the system but let's talk about a basic one first.)

A configuration $q$ is a vector of robot joint values. So as in your case, a configuration is a 3D vector. The configuration space $\mathcal{C}$ is then the space of those configurations, i.e., $\mathcal{C} = \mathbf{R}^{3}$.

There are two types of configurations in $\mathcal{C}$, those that are in collision and those that are collision-free (i.e., not colliding with itself or any environment). To construct a configuration space is then equivalent to creating a map of $\mathcal{C}$ which shows collision region (obstacles). To explicitly do that, you need to discretize $\mathcal{C}$ then test at each discretized configuration if it is collision-free. For example, suppose all of your three joints can move from $-180^\circ$ to $180^\circ$ with discretization resolution of $1^\circ$, you then have a grid of the size $361^3$. This means you need to test all of $361^3$ (almost 50 million) points to explicitly construct the collision regions and hence the map of $\mathcal{C}$.

This process is the same for more DOFs as well. And having more links means that your configuration space will be of higher dimension. We cannot tell anything much about the obstacle regions in the configuration space since their geometries will generally be very complex.

You can see from above that even constructing the map of $\mathcal{C}$ of dimension $3$ is a very computationally expensive process. Therefore, people generally do not construct explicitly the configuration space. For example, in motion planning, using a sampling-based planner together with a collision detection module can efficiently substitute the construction of the full map of $\mathcal{C}$.

Title: how to make a configuration space of a robot manipulator?

Body: How to make a configuration space of a robot manipulator from a work space ? it's robot manipulator is 3 degree of freedom. Is a robot manipulator with more degrees of freedom the same process ?. Do more links affect the config space?</p>


问:
Testing and Lifespan of Industrial Robots?
How does one go about testing the robot once it is built? How does one predict the number of hours it can operate? I see most of the industrial robots for instance robotic arms have warranty of 12-18 months, how did they arrive at such an estimate, clearly testing for 12-18 months is not on option, so what is the procedure for determining the lifespan? </p>

答: In general, robotic arm is more mechanical than electrical. Manufacturers would use power law to increase vibration stress to accelerate life of their products. They will pick several product, estimate mean life and predict reliability and life of the model. It is called accelerated life test and can be used for failure analysis and life predict. Highly accelerated life testing (HALT) also accelerates life of product, but it cannot predict life range of tested unit. It is widely used to cause failures and thus improve design by exposing weakness of product.</p>


问:
Supplying power from a power bank to an arduino and DC Motors
I have a two port powerbank capable of supplying a maximum of 5V 2.1A

I'm using it to power an Arduino and a L293D IC connected to two DC motors which have the following specifications:

Working voltage : 3V to 9V

No-load current = 60 mA, Stall current = 700 mA

The setup is not working and I have made the following observations

1) The voltage across the output terminals of the powerbank is read as 4.9V (when the arduino is not powered either from the other port of the power bank or another power supply all together)

2) The voltage across the output terminals of the powerbank is read as 4.0V when the Arduino is powered either from the other port of the power bank or my laptop

This voltage is given to the L293D Pin 8 (That is meant to be given 12V). A 12V to 5V buck provides the 5V to the IC itself (this is part of the motor driver board)

3) When only one motor is switched on, the voltage provided to that motor is 2.8V. The motor rotates only when given some manual force on the axle.

4) When both motors are switched on, the voltage provided to each motor is around 0.5V. Both the motors don't rotate at all.

5) When only one motor is switched on, the voltage reads around 0.2V until given manually rotating the axle after which it picks up speed.

I couldn't measure the current (or rather measured current to be 0A) anywhere as the motors don't rotate at all if I connect the ammeter. I understand that the power bank supplies power only when the load connected to it demands the power (due to smart sensing).

What should I do so that the power bank continually provides 5V and this 5V is delivered to each motor?

答: It's important to know how much mAh (miliAmperes per hour) is capable your power bank. And also, specially for DC motors to know peak current that could provide too.</p>


问:
What is the cheapest / easiest way of detecting a person?
I'd like to know if anyone has had success detecting a warm-bodied mammal (ie. Human) using standard off the shelf, inexpensive sensors?

Ideally, I'd like to use an inexpensive sensor or combination of sensors to detect a person within a room and localize that person. I would like the robot to enter a room, detect if a human(s) is/are present and then move to the detected human. The accuracy does not need to be 100%, as cost is more of a factor. I'd like the computational requirements of such a sensor to be such that it can run on an Arduino, although if it's impossible, I'd be willing to utilize something with more horespower, such as a Raspberry Pi or a BeagleBone Black. I have a few thoughts; however, none of them are ideal:

PIR Sensor - Can detect movement within a large field of vision (ie. usually 120 degrees or more).  Might be the closest thing to a "human" detector that I'm aware of; however, it requires movement and localizing/triangulating where a person is would be very difficult (impossible?) with such a large field of vision.

Ultrasound - Can detect objects with good precision.  Has a much narrower field of view; however, is unable to differentiate between a static non-living object and a human.

IR detectors - (ie. Sharp range sensors) Can again detect objects with great precision, very narrow field of view; however, it is again unable to differentiate objects.

Webcam + OpenCV - Possibly use face detection to detect human(s) in a room.  This may be the best option; however, OpenCV is computationally expensive and would require much more than an arduino to run.  Even on a Raspberry Pi, it can be slow.

Kinect - Using the feature detection capabilities of Kinect, it would be relatively easy to identify humans in an area; however, the Kinect is too expensive and I would not consider it a "cheap" solution.

Perhaps someone is aware of a inexpensive "heat-detector" tuned to body heat and/or has had success with some combination of (#1-4) above and would like to share their results?

答:
A combination of a passive infrared detector (PIR) and sonar range finder (SRF) should do the trick.

What has worked well for me previously (not finding humans but very similar) was to have two PIRs on the left and right sides pointed so they have a little bit of overlap in the middle.

You can then figure out if the human is to the left, right or in front (when both are on). You basically then stack this on top of the SRF which will tell you range etc. It is a bit dirty and you have to make some assumptions, but it works well for it's simplicity.

The pseudo code for the 2 PIRs could be something as dead simple as:

```<code>amount = 60; //degrees
while (notCloseEnough)
{
  if (bothActive)
    forward;
  else
  {
    if (leftActive)
      turnLeftByAmount(amount);
    else
      turnRightByAmount(amount);
    amount = amount - 5;

    //recalibrate
    if (amount <= 0)
      amount = 60;
  }

  checkIfCloseEnough();
}
</code>```

The idea is that you turn a lot to one side (60 degrees) if you see something in that area. If they are not in front of you after the turn, turn a little bit less to the side which you are seeing them. Keep repeating and narrowing the amount of turn until they are in front of you, then forward. Remember that you do not turn as much (reset the angle) once they are in front because the will not move 'out of scope' as quick.

I was genuinely amazed by how good this algorithm actually works (we used it for automated chase toys and had to slow/dumb it down because it would beat/catch a human controlled robot too easily).

Both sensors are available from Pololu (no affiliation):

Passive Infrared Detector

Sonar Range Finder

Body:
A combination of a passive infrared detector (PIR) and sonar range finder (SRF) should do the trick.

What has worked well for me previously (not finding humans but very similar) was to have two PIRs on the left and right sides pointed so they have a little bit of overlap in the middle.

You can then figure out if the human is to the left, right or in front (when both are on). You basically then stack this on top of the SRF which will tell you range etc. It is a bit dirty and you have to make some assumptions, but it works well for it's simplicity.

The pseudo code for the 2 PIRs could be something as dead simple as:

amount = 60; //degrees
while (notCloseEnough)
{
  if (bothActive)
    forward;
  else
  {
    if (leftActive)
      turnLeftByAmount(amount);
    else
      turnRightByAmount(amount);
    amount = amount - 5;

    //recalibrate
    if (amount <= 0)
      amount = 60;
  }

  checkIfCloseEnough();
}

The idea is that you turn a lot to one side (60 degrees) if you see something in that area. If they are not in front of you after the turn, turn a little bit less to the side which you are seeing them. Keep repeating and narrowing the amount of turn until they are in front of you, then forward. Remember that you do not turn as much (reset the angle) once they are in front because the will not move 'out of scope' as quick.

I was genuinely amazed by how good this algorithm actually works (we used it for automated chase toys and had to slow/dumb it down because it would beat/catch a human controlled robot too easily).

Both sensors are available from Pololu (no affiliation):

Passive Infrared Detector

Sonar Range Finder


问:
Quadcopter Flat Surface Roll Pitch angle not 0 Degree
At 11:13 or 2:22 of this video or 0:09 of this second video the drone itself is on flat surface but the flight controller itself must have been placed in tilted position (not intentionally) on frame a little so the Pitch and Roll angles are not perfectly 0 degrees. When the PID makes corrections to make FC  at 0 degree level for hovering over, the drone itself will be tilted so the drone will go in x or y direction. Should we mount FC with this manner to the drone's frame (in a way we read exactly 0 degrees) or are we making correction to these things during flyting with remote controller to make it stable.

Or is there a code trick in flight controller like taking the start angles as flat degrees so -2 for example is flat level for it.

I hope i am clear. Any help is appriciated.

答:
As demonstrated in your second video you can give the FC an angle offset (it does not have to be a multiple op 90°). In order to find the appropriate offset you can place the quadcopter on a level surface use the angles you measure then as offset.

It is also possible to make a controller which controls the x and y position or velocity of the quadcopter using the pitch and roll as outputs (this is also known as consecutive loop closing). By using a PID controller for this then the integral action can also counteract the offset of the FC orientation.


问:
Do i really need an AHRS for 2D maps?
I am currently making a 2 wheeled SLAM robot that will use an array of either ultrasonic or sharp IR sensors with a particle filter. I also have a MPU-6050 and GY-271 and i am looking to turn it into an AHRS. However, considering that the map is going to be on a 2-D plane, do i really need a full AHRS? Can i not just use a magnetometer to create a compass for rotation readings?</p>

答:
AHRS will yield roll, pitch and yaw values.  In your case, you would only need the yaw reading.

You could use just the magnetometer for yaw or rotation headings, but I would not recommend it. This is because the magnetometer is susceptible to magnetic interference. If the sensor is mounted on a chassis nearby ferrous metal, this also could be a source of problem. In this case, you would have to cover it with a magnetic shielding material.

For your information, there are algorithms like complementary filter, EKF and DCM that you could use to obtain the yaw value.

Title: Do i really need an AHRS for 2D maps?


问:
CC3D connector cable connection with receiver
I am trying to make my First Quadcopter but having problem with cc3d connection, The CC3D cable seems extremely complicated. I would have figured the pin out would have started with a red/black/white for the power/ground/signal for the first port of the receiver but the colors are all weird. They are in order:

Black
Red
Blue
Yellow
White
Green
Blue
Yellow

The duplicate colors and the white in the middle is throwing me off. I've searched openpilot.org but can't seem to find a wiring diagram or a pin out diagram to tell whats what. Just wondering if someone can help me out. How should I connect these in Flysky FS-i6 Receiver?

cable sequence is below

答:
Got it.

Some connectors comes with same color for some wires.

Try to follow the connection from left to right, as shown on the pictures on the course.

The first cable that goes to the receives has 3 wires, the rest are only one. Follow according to the position,
first cable on first channel of the receiver and so on. Ignore the collors and follow the picture:

Throttle is channel 1, Roll is channel 2 and so on.

Btw, on the receiver follow the correct polarity for the first cable. Black wire goes outside. The other wires (the alone ones) should be in the same position as the white whire of the first channel.

This could be the problem.

Hope that helps!


问:
Aluminum vs Carbon Fiber
So building a quadrocopter from scratch HAS a lot of decision making, and I need some input on the material choice.

I have short listed Aluminum and Carbon Fiber for the Arms and support of the Quadrocopter.
I am a little short on cash to experiment with both of them.

So considering that I have enough money to buy either of those, and assuming that I have access to general tools like a Table Saw, Horizontal Band Saw, CNC Router and a Water jet.

What would be a better material to work with

EDIT:

I will be deciding the specs around the frame so as to allow me some design liberty. So right now, my goal is to assemble a very durable, as-light-as possible frame, which can withstand a lot of experimentation on the electrical side.

答: Aluminum. Simply because you're going to want to make improvements and design changes. I assume cost is a major consideration else you probably would not ask this question. You're free to get creative, adaptive and constantly make changes if you go with a cheaper material. It would be a shame to inhibit creativity because of budget constraints.</p>

Title: Aluminum vs Carbon Fiber


问:
How Should I tie My quadcopter to some thing, to adjust pid on one axis
I am stuck in adjusting the PID of my quadcopter, I cant adjust them on the fly because it just get out of control. I am adjusting them while attaching my quadcopter to something.

Is this method correct. Will the pid values required will be different on the fly or same. Please suggest me how to attach my quad to some thing.

答: It would stumble along the landing gear like that. Your UAV should be suspended in the air. Tie the harnesses to a heavy object on the sides of the UAV and keep them very taught to minimise any movement on it's other axis of rotation.</p>


问:
How would i implement position and heading readings into my SLAM system?
I am trying to build a low-cost SLAM system with an MPU-6050 and GY-271 (magnetometer). Currently, i have a robot with an Arduino that collects the sensor data and a Raspberry Pi that (hopefully) will do the SLAM calculations.

I want my robot to be able to use all three sensor readings in SLAM to create a 2D map of the environment. However, considering that i want a 2D map, i will not need all the axis readings correct?

I read another post on here where one of the answers said that only the yaw from the gyroscope, and the x and y from the accelerometer would be needed.

My question is, how would i implement this into my SLAM robot? I was thinking of passing the accelerometer and odometry readings through a kalman filter on the Arduino and then the same for the gyro and magnetometer readings. Would that be correct?

Would i also need to use all the axis (x, y, and z) readings from the magnetometer? Or just one or two axis?

Thanks.

答: Maybe you can checkout ROS on Raspberry Pi, they have various libraries and SLAM algorithms (such as Gmapping & Hector SLAM) that you can use.</p>


问:
Computationally efficient way to represent joint C space for a multi-robot RRT
I am working on writing code for a coordinated multi-robot rapidly exploring random tree (RRT) based planner, which would naturally involve a lot of sampling, nearest neighbor searching and 'radius' searching. Because this is a coordinated/cooperative planning step, all robots' paths are incrementally created in every iteration until all robots reach their respective goals, and the planner needs all the robots' positions during the planning phase.

I have a basic framework for this working in MATLAB, which was only a proof of concept and not really efficient: but I am not sure what the best way to program it in, say, C++ would be. Normally for an RRT, I would go for a KD tree implementation, but in a multi-robot point of view, the environment would be a joint configuration space and this would mean a pseudo-high-dimensional KD tree: which is not actually high dimensional, but just needs to perform nearest neighbor searches in a space that combines the states (x,y,z, yaw) of all the robots - over and over again during the planning phase. The metric is simple enough, as it is just Euclidean distance, but I don't know if using KD trees for this will be computationally efficient. I'm looking for some suggestions on how to describe the configuration space for an efficient multi-robot RRT (I am thinking of a maximum of five robots) with a state dimension of 4.

答:
I'd start by considering your problem as a single K-dimensional problem (K would be 4 DoF by the number of robot, so K=20 in the case you mention), and have a look to FLANN, which is distributed as a C++ library, for the nearest neighbors search.

Or simply start by an exhaustive search using Euclidean distance in that K-dimensional space.
Also, I don't have a reference at hand, but I think you can use a search among some randomly sampled points of you graph: on each nearest-neighbor search, pick randomly n points in your graph and exhaustively look for the nearest-neighbor in that subset. It will degrade some qualities of your tree, but may result faster, depending on the value for n you pick.

But the solution you need depends a lot on your problem specification, mainly size and clutteredness of your environment, presence of bottlenecks...

Hope it helps...


问:
Handling changing frames in ROS
I have a robot that is inherently symmetric in nature. Sometimes one side is the base while the other is the end-effector and vice versa. This 'mode' can change while the robot is moving around.

Judging from the URDF tutorials wiki, it looks like the commonly used URDF package in ROS is static and so the base of the robots is assumed to stay the base. Are there ways to get around this so that I can still use the TF package?

答:
Your system looks similar to walking robots, like humanoids. You may set the base as an other joint/link, that in your case would your symmetry center. In the case of humanoids it is usually the pelvis, where all the kinematics chains originate.

All the rest is only software, you never have to touch your URDF. You will need to remember in which mode your robot is. You'll also need something to keep your odometry (if needed) up to date when it switches. But I guess you already have done this.

You may have a look to ROS packages for humanoid robots, like Nao.

Title: Handling changing frames in ROS


问:
How to evaluate 3D Occupancy grid maps
I would like to know how to go about evaluating 3D occupancy grid maps.

I have a SLAM system that produces a 3D OGM (in .bt format using octomap/octovis)

I also have a ground truth OGM in same .bt format.

How do I compare the accuracy of my map to the ground truth map in a qualitative and quantitative way?

Important notes:

The two maps may not be the same scale.

One map may be less dense than the other.

One method I have thought about using is MRPT's occupancy grid matching application
This would require me to send both 3d maps as a message to the octomap_server node in ROS, get the resulting map in Rviz, save the image 2D image of each separately, and then somehow convert the images to MRPT's .simplemap file format, and then run MRPT's grid matching program on the two files.

Surely there is a better/more accurate way?

EDIT:
So I did more research and another route I could go is Matthew's Correlation Coefficient (MCC). I could compare two maps and iterate over each cell to compare my result to a ground truth, counting the True and False Positives and Negatives.
Only problem with this is that I have to assume that the two maps are the same scale, and also in the same orientation.

If you have any ideas on solving these scale and orientation issues don't be shy.

答:
Actually, evaluating maps with different scales and densities happens to be part of my research for my PhD so here goes the two ways I can think of on the top of my head:

Visually: it is always the first step but not the only one ;).

Map matching methods as in this paper by Sören Schwertfeger. That sounds like the idea you had first and I think it would probably be the best way to go about it.

Sören Schwertfeger's method is based on the Voronoi diagram and thus goes away your scale and density problem by have some fuzzy limits on the angle and length of the edges of the Voronoi diagram. I used a similar method to match hand drawn sketch maps onto ground truth maps using Voronoi diagrams, and I did not consider at all the angle and length of Voronoi edges, just their order. That's probably the worst case of "maps with different scale and density you can have" and the matching was not half bad. Thus, I believe that should be a pretty solid solution, especially if you have occupancy grid maps; you'll be able to take in account angles in between Voronoi edges to get a better precision.

Title: How to evaluate 3D Occupancy grid maps


问:
DH- Parameters of BCN3D Arm
Consider the following Arm:

```<code>https://www.bcn3dtechnologies.com/en/bcn3d-moveo-the-future-of-learning/
</code>```

I looked for the DH-Parameters of this arm and I found this:

```<code>https://github.com/BCN3D/BCN3D-Moveo/issues/15
</code>```

Although I don't think that this is correct because I think that the first Alpha should not be 0.

P.S: A clear photo of the arm:

答:
There are two conventions followed while deciding DH parameters.
1) Where the parameters are calculated with respect to the ith and the (i+1)th link (Excerpt from Chapter 5 of the book “Introduction to Robotics” by S.K. Saha,
Tata McGraw-Hill, New Delhi, 2008)

2) Where the parameters are calculated with respect to the (i-1)th and the ith link (slide no. 38)

Cross check the methods to ensure you are using the same convention followed by the Github user.

The final answer remains the same while only the formulation of the transformation matrix changes.

Title: DH- Parameters of BCN3D Arm


问:
What is the right approach to write the spin controller for a soccer robot?
Imagine programming a 3 wheel soccer robot. What type of controller would you use for spinning it? P? PID?

The goal for this controller is that it should make the robot stand in a defined angle ( 0 degree ) and turn back if rotated by hand or other robot.

I use stepper motors for my robot and not servos so I need to implement this in my software!

I have written a sample P type controller already and the movement is fairly good. But I would like to make it better if possible. The code is as follows:

```<code>void spinSpeed(int devidedValue, int addedValue, int correction) {

    if(degree<correction && degree>-correction) {
        motorSpeed = 0;
    } else {
        if(degree > 0) {
            motorSpeed = ((degree)/(devidedValue) + (addedValue));
        } else {
            motorSpeed = ((degree)/(devidedValue) - (addedValue));
        }
    }
}
</code>```

correction is a range , in which robot has no movement.
degree is a number between -127 and 128 which is returned from the compass.
motorSpeed is a number between 0 and 255 which is applied to the PWM.

答:
A PID controller would be the best, Using a compass then it is a relatively straight forward task of getting the bearing of your robot and comparing it to the bearing you want to achieve, and using some PID tuning techniques to achieve a smooth turning motion to your desired heading. This approach can also be applied to rotating by a given amount accurately.

I have already done some robotics in this field, this is what we used in our robot, doing a not too dissimilar task to yours...


问:
How mature is real-time programming in robotics?
Edit: I don't know why, but this question seems to be confusing many people. I am aware of when/where/why/how to use real-time. I am interested in knowing whether people who have a real-time task would actually care enough to implement it in real-time or not.

There's no need to mention why real-time operations are important for a robot. My question is however, how much is it actually used in robotics?

Take this question for example. Only one answer mentions any platform with real-time capabilities, and it is far from the top too. ROS apparently, being a very popular platform which is not real-time.

In the real-time world however, RTAI1 seems to be the only workable free real-time platform of use. It is however, limited to Linux (no problem), badly documented and slowly developed.

So, how much is real-time behavior sought after among robotics developers? The question is, how much are developers inclined to write real-time applications when real-time behavior is actually needed? If not much, why?

For example, reflexive behavior based on tactile data, cannot go through ROS because it would lose its real-time property. But do people really come up with a real-time solution or use ROS anyway, ignoring the real-time property?

1 or similarly Xenomai

答:
Remember that there's Real Time and there's Real Time.

Hard Real time is difficult to achieve without hardware support or low level software support, but you often don't need everything to be Hard Real Time capable. Soft & Firm Real Time response is much easier to achieve and is often more than adequate for many applications.

Also, different parts of a system can have very different real time requirements. If you are running software PID loops, they really should have a hard real time response (you really don't want to have to choose between soft tuning your PIDs or tuning them hard and having them occasionally go unstable, for instance). A vision system might have firm real time response requirements, performance will degrade if you can't process the image in time for the next decision but it need not prevent the system running, in this case if you can't process it in time you are better off throwing away the partial results and not loosing time starting analysis on the next frame. Finally your overall planning and coordination (probably the most complex part of your robotic system) can often remain firmly in the domain of soft real time.

Even in the realm of Windows PCs you can get hard real time performance, you just need the right software with the right hooks into the kernel. Beckhoff's TwinCat soft PLC quite happily ran a high scan rate PLC by slicing half of a Pentium's machine cycles, giving the other half to Windows NT, and this was over a decade ago. Even modern control systems like some options in Aerotech's A3200 range do the grunt work on the host PC, with the low level kernel taking as much CPU time as it needs for the hard real time requirements and leaving the rest of the CPU cycles for Windows 7 to use!


答:
I don't want to sound too pessimistic, but from my experience a straightforward RRT approach for multiple robots would not be able to scale well with the number of robots, due to excessive collision checking. Therefore, nearest-neighbor search (NN) would certainly not be the bottleneck, as you will not be able to experiment with more than 10 robots, at best.

If you do manage to experiment, possible by using a different method, with a large fleet of robots, and the high-dimensional NN technique turns out to be the bottleneck, it might be worth to consider a dimension reduction: for $m$ robots having $d$ degrees of freedom you might be able to efficiently encode the distance relations between $md$-dimensional composite configuration using dimension reduction.

You may want to elaborate on the reason you chose to implement an direct RRT approach, so that we can help in finding a better alternative.

Title: Computationally efficient way to represent joint C space for a multi-robot RRT

Body:
I am working on writing code for a coordinated multi-robot rapidly exploring random tree (RRT) based planner, which would naturally involve a lot of sampling, nearest neighbor searching and 'radius' searching. Because this is a coordinated/cooperative planning step, all robots' paths are incrementally created in every iteration until all robots reach their respective goals, and the planner needs all the robots' positions during the planning phase.

I have a basic framework for this working in MATLAB, which was only a proof of concept and not really efficient: but I am not sure what the best way to program it in, say, C++ would be. Normally for an RRT, I would go for a KD tree implementation, but in a multi-robot point of view, the environment would be a joint configuration space and this would mean a pseudo-high-dimensional KD tree: which is not actually high dimensional, but just needs to perform nearest neighbor searches in a space that combines the states (x,y,z, yaw) of all the robots - over and over again during the planning phase. The metric is simple enough, as it is just Euclidean distance, but I don't know if using KD trees for this will be computationally efficient. I'm looking for some suggestions on how to describe the configuration space for an efficient multi-robot RRT (I am thinking of a maximum of five robots) with a state dimension of 4.


问:
Simple relation between lifting weight and power of the motor in quad-rotors?
I like to know are there simple equations to find how much motor power is needed to lifting 1 KG with a quad rotor?
Also if we use gas powered engine, how can we find a relation between lifting weigh and fuel consumption?</p>

答: In order to lift the weight of $mg$, you need at least a trust $T=mg$. The trust of a quadrotor with four identical motors is given by $T=4 k_T \omega^2$, in which $k_T$ is a parameter that depends on your motor/rotor and $\omega$ is the angular velocity. From this, you can estimate at which $\omega$ your motor has to operate. Additionally, to this, you will have to overcome the air drag due to rotation of the blades. This air drag needs to be overcome by a torque $M=4k_M \omega^2$. So you have to check if your motor does supply this torque $M$ at $\omega$. So if you combine this information you can estimate your power by $P=M\omega$. Remember that this is just a lower bound and you should rather select a better motor in order to allow a certain level of agility.</p>


问:
Image registration with ground plane for surround view
I am currently working on a project which which involves surround view.

I have 4 fish eye cameras and are fixed at 4 sides of a car.The fish eye cameras are corrected for radial distortion.

After radial correction,Each camera sees a pattern in the Common FOV of adjacent camera to get the points on the ground plane.

Pattern in the common FOV of adjacent camera

Now for each camera I need to warp those points to a plane which is the birds eye view.

Right now I choose those 8 red points, map first 4 points on a square and the other 4 points on another square on the same line,since I know that both squares lie parallel to each other at some distance,for front and back images and use the same points for left and right also appropriately so that left image comes left and right image comes right of the result.

Then I calculate Homography Matrix for each image(front,left,right and back) using the points in the Image and the birds eye plane.

I map the points such that warped front image sits at the top, left sits at the left side and right at the right side and then back sits at bottom of image .

Example, Front sits at the top of result image

Left sits at the Left of result image

I do this so that I can stitch properly,forming a composite view.

My final stitched image looks like below.

As you can see, the geometrical alignment is not proper.

QUESTIONS

What is the right way of registering each image with the ground plane.

From the object points shown as red dots, what is the proper way to get the corresponding points in the bird's eye plane.

答:
I don't know what the proper way to do this is but I can give you ideas to make it better:

define an exact transformation for each camera. You could calibrate each camera using a grid pattern and by using a bigger one, multiple pictures, and averaging the transforms, you could define the transformation between the fish eye view and the normal view more accurately and wouldn't need the pattern on the image later on. Im on my phone so I can find any more info or links on this but there are plenty :).

use image registration techniques. Use keypoints and descriptors on the image and register then using something like ransac for example. A good library to do that is openCV. Look at this for example but I think you can find plenty of better tutorials.

Ideally, you should use both of those technics :).