问:
Build a drone with a raspberry pi 2 as receiver for the CC3D-LibrePilot
I tried to get the yaw, roll, pitch and throttel integers from the pi to the CC3D with python and c++ as PWM signal over the GPIOs but the output didn't seem to be right or it was delayed.
Could someone help me to program an application who knows how to program PWM, PPM, SBus or ExBus?
Or does someone know a better way to do it than a serial connection?</p>

答:
The problem is with the Raspberry pi. You can't generate accurate PWM output using Raspberry Pi because it's a microprocessor running an operating system (not real-time system). So you may get unexpected delay in the GPIO.

If you insist in using Raspberry Pi to drive PWM signals, you can use PWM adafruit driver with I2C interface.

However, I think you should really consider redesigning your whole system. Maybe building your own flight controller using Arduino. Then make Raspberry pi talk to the Arduino using serial communication. There are a plenty of tutorials that explain how to do that.


问:
Kalman filter for vision based pose estimation: 'good' measurements not improving system covariance
I am starting off with a very simple Kalman filter for vision based pose estimation (PnP algorithm). The filter is inspired by the constant velocity model in this OpenCV tutorial, but I am ignoring roll, pitch and yaw for now and I am only estimating the XYZ pose.

As PnP is formulated as a non linear least squares problem, I have access to a covariance matrix from the solver I am using (Ceres), and I am using this matrix as an estimate of the measurement noise covariance matrix $R$ at each step. Process noise covariance $Q$ remains constant. My understanding of the filter is that if I obtain more and more 'good' measurements (with low $R$), the system covariance should recursively decrease; and even if the measurements worsen later, the posteriors should not worsen too much. So if I were to start from an area of bad measurements with covariance $P_1$, move to an area where I receive some good measurements and back to the area of bad measurements with covariance this time being $P_2$, $P_2 < P_1$.

On the other hand, in my formulation, my posterior covariance $P$ seems to be blindly following $R$: in my previous example of bad-good-bad areas, $P$ decreases and increases to almost the same extent, so I can't see the advantage of receiving good measurements reflected in the final covariance. On the other hand, if I reduce $Q$ even lower, I can see some variation in initial vs. final covariances, but the system is not trusting the measurements at all and is smoothing the poses out way too much. I am confused as to how to pick the best values of $Q$ and $R$, and mainly as to how I can write my filter in a way that it recognizes the advantage of getting good measurements.

答:
First, let me see if I can summarize your issue to see if I understand correctly:
1) Start in area with bad measurements (high R), get P1
2) Move to area with good measurements (low R)
3) Move back to first area (high R), get P2
And you expect P2 < P1, correct?

Generally speaking, yes, at some level you can think P2 should be less than P1. But the devil is in the details: over time the filter will reach a steady state so given the same state, Q, and R it will converge to the same value regardless of how you got there. If are able to instantaneously jump between the bad and good measurement regions you should initially see P2

The other thing to consider is the magnitude of R relative to Q; if even your "good" measurement R is large the filter mostly just trusts the predictive model so the quality of your measurements doesn't affect much. You can try test with a large Q (or smaller R) to trust the measurements more; but that will also make the filter adjust more quickly after changing from good->bad measurement regions.

ContentLicense: CC BY-SA 3.0


问:
Smart camera image processing on embedded GPU vs. in the cloud
I'm working on a smart camera that does key point prediction (predicting locations of wrists, elbow, shoulder, ears, eyes, nose, etc.) for gesture recognition.

Right now, the neural net is running on the embedded GPU (a Jetson TX2) and performance isn't ideal (<3 FPS). So I'm exploring whether it makes more sense to constantly upload images to the cloud, doing the predictions there, and sending the results back to the device.

I'm curious what approach others would recommend for a smart camera. Specifically:

Performance differences between using an embedded GPU vs. the cloud?

Cost differences between using an embedded GPU vs. the cloud?

What other smart cameras are doing (Nest, Lighthouse, etc.)?

If there is an alternative better than the Jetson TX2 if going the embedded path?

Any advice for any of the questions would be great.

答:
If there is an alternative better than the Jetson TX2 if going the embedded path?

You can try https://developer.qualcomm.com/software/snapdragon-neural-processing-engine

I did not see any comparison between different Snapdragon's and Jetson and I am not sure where you can find top level Snapdragon 835 except some fresh Android phones.


问:
Determine the relative camera pose given two RGB camera frames in openCV-python
I would like to determine the relative camera pose given two RGB camera frames. I assume there's overlap in field of view between the two cameras, what I am looking for ultimately is the rotation and translation between two cameras. I understand how to do this in theory, and am looking for existing openCV implementations in python. An existing one for matlab can be found here: https://www.mathworks.com/help/vision/ref/relativecamerapose.html#inputarg_inlierPoints1. But so far as I can tell I see no openCV API in python.</p>

答:
If you understand how relative pose estimation works in theory, it should be quite trivial to translate it into OpenCV code. First, you can pick any feature detection/description approach you like (say SIFT and brute force matching) and obtain a list of matches. But here, you need to be absolutely sure there is overlap between the images: because without feature matches, relative pose estimation would not work.

Once you have access to these matches (pairs of features visible in both images), you can then use the findEssentialMat() function in OpenCV, where you will have to provide the intrinsics data from the camera as well as those matching pairs you obtained in the first step. This function, using a RANSAC scheme will compute the essential matrix that encodes the transformation between the scenes. Once you obtain the matrix $E$, you can use another OpenCV function recoverPose() and pass the $E$ matrix to it, which will calculate the relative rotation (as a Rodrigues vector, if I remember right) and the relative translation up to scale.

These functions are available in C++ as well as Python. To put you on the right path about how to go about coding it in python, here is a tutorial on how to compute the fundamental matrix through feature matches in OpenCV: this can be easily extended to the essential matrix and subsequently the relative pose.

http://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_calib3d/py_epipolar_geometry/py_epipolar_geometry.html


问:
How to find a smartphone with a quadcopter?
I think there are some quad-copter at the market those can find you from your smart phone. I don't know how accurate it is and how does it works? Is there a solution that I can build an android/ios application that quad-copter can find exactly the smart phone which has this app installed?</p>

答: Yes, you can make an app of your own which will enhance the drone to gives you  the exact location of your mobile  phone or any buddy you make the app available on their mobile phone, is just a pity you are not a professional in this line, I would have given you some  tips which will help you out and if you seems it's hell of a work will help you make one </p>


问:
How to get data from ArduPilot through Serial Port
I'm doing a project related to telemetry, and I want to make ArduPilot (programmed with ArduPlane 2.73) send through a serial port the sensors informations such as height, GPS position, etc.. I have tried to use ArduStation, but I could not change its firmware to do what I want.

The idea would be to read the Ardupilot's serial port using an Arduino Uno, and then saving it in a SD card in real-time. So ArduPilot needs to send data without any user input or something like that. I've already tried to manipulate ArduPlane source code to do that, but I couldn't either.

Has someone here did something like that before? I need some advice!

答: I understand a new Ardupilot was released recently. I am not familiar with it, so if that's the device you have then this answer may not be helpful. With that said I have done something similar to what you are doing with the Ardupilot Mega. Specifically I wrote a node in ROS to control a quadrotor and read its state. The Ardupilot uses a fairly simple protocol called Mavlink to communicate with other systems. You can get the library from the QGroundControl website linked above. From there you will connect the serial port on your Uno to the Xbee port on the APM. There are two caveats however. First, I don't know whether the Mavlink library will fit on the Uno though I believe it will. Second, it does require that your Uno query the APM by sending requests for data but they are simple enough to construct. The purpose for this is to control the flow of information. If I recall correctly you can instruct the device to repeatedly send the data you are interested in but you will have to review the documentation to confirm as much. </p>


问:
Live Streaming video via Arduino with limited space
I am currently undertaking a competition called CanSat, in which you build a satellite in the form of a standard soda can. It will in turn then be launched 30 meters, 100 meters and then finally 500 meters into the sky. I'm stuck on something and I need a little bit of help.

Basically I am looking at streaming low quality video (480p-10fps/ 240p-30fps), using an Arduino Uno/Mega, inside of a can. The spacial limitations I mentioned above are 115 mm in height and 65 mm in diameter. I will not be able to use a conventional IP camera, due to the limitations.

I was thinking about using a Bluetooth V2 Chip in order to achieve the transfer rate to stream to a PC. I am looking for the following help:

What camera to use

What software to use to receive the video on a PC

And finally any other relevant information about the limitations of the Arduino and streaming.

答: Based on your limitations, I would consider a Raspberry Pi Zero W, which has bluetooth built in. You can connect a camera that has quite a high resolution designed to operate with the Pi and stream the video back over whatever you choose.</p>


问:
How can serial manipulator have unique condition number for given end effector position?
I am reading about Condition Number which is considered as measure of manipulability of robotic arm, it is defined as

$$
k = \parallel J \parallel \parallel J^{-1} \parallel
$$
Where,
$$
\parallel J \parallel = \sqrt {tr(JNJ^{T})}
$$
How this can be a unique value for given end effector location, as manipulator can reach a point in workspace with different joint variable values, which in turn will change Jacobian value ?

Reference Paper: Comparative study of performance indices for fundamental robot
manipulators
Serdar Kucuka,1, Zafer Bingulb,

答:
Condition number and manipulability are measured at a specific joint configuration, not end-effector location. You already understand it correctly that the values change according to the robot configuration as they are computed from the Jacobian.

You may also want to check out Yoshikawa's original paper on manipulability.


问:
How to determine x-axis if the two z-axis are intersecting in Denavit Hartenberg representation
Suppose I have a 3 link(1 dimensional) chain in which all the joints are revolutes, the axis of first revolute joint is along Z-axis(global) and axis of second joint is along X-axis(global). The first link is along X-axis(global) and second link is along Z-axis(global).

Now in order to use DH representation I introduced a local frame for link 1 at joint 1(z axis along Z and x axis along X) and another frame at joint 2.Here z-axis is along axis of rotation(global X) and here I am clueless how to determine x-axis for joint 2 because the two z axis are intersecting.(standard procedure is to find common normal between two z axis)
Thanks for your time.

答:
The right hand rule will help you here. For a given joint i: your thumb will correspond to the Zi-1 axis, your index will correspond to the Zi axis and your middle finger will correspond to Xi axis.

Here is the wikipedia page on the right hand rule, I linked it so people can look at the image if ever they forgot what the rule was. https://en.wikipedia.org/wiki/Right-hand_rule


问:
how to sync the timer in control system with ROS?
To simulate a system, a global timer will be set and all submodules will be synchronized with that timer to work together. such as PID controller, kalman filter, PWM module etc.

How do you sync the timers in ROS?

1) should I make a timer pointer as paramter in PID() and pass the system "ros::Time xxx" to this PID?  is this timer "real time" enough for a balance car?

(For the PID controller I can do this because the PID controller and the PWM generater will be in the same node).

2) or receive the msg from nodes and extract the time stamp and use? is the latency can be ignored or how to evaluate the latency?

(The Kanlman filter will be in the sensors node and from the coder view we cannot pass the system timer pointer to the kalman filter such as kalman() )

The PID controller works at around 500Hz and the kalman filter works at lower speed. my PWM is 5KHz.

Thanks a lot!

答:
Your question kind of boils down to, what is real time ?
In the end real time is what you want/specify for your system to work, whether it be hard real time or soft real time.

In practice ROS is not hard real-time, but is sufficient enough for most robotics applications.
It seems to be that you are trying to take into account the latency between your submodules in your system. By experience I would recommend you to first try assuming there are latencies and see how your system works, and if needed investigate the latency issue.

Now for the problem you describe I would rather use the time-stamp in messages because they should give you the date at which they where emitted and compare it with the current machine time (aka the time you get in 1) ). One of the main motivation of defining interfaces between component with timestamps, is to have this simple to way to check if the input that you want to use are  fresh (no latency correction needed), less fresh (latency correction to be taken into account) or old (re-design of the architecture).

Now what can impact the delay/latency in the software your describe ?
It is the computational power required for your algorithms vs.  the computational power at hand to run them. From your post it's hard to see, but a small board like (Pi,beaglebone,...) should be able to handle PID and Kalman filter (for reasonable number of states).

From a robotic perspective, balance boards are inverted pendulum so you try to stabilize an unstable equilibrium and you run your PID at 500Hz, from experience it sounds reasonable. Specifically because running faster and faster will increase your performances but at some point you will realize that the actuators are filtering the inputs so much that running the control faster dosen't bring anything.


问:
How's robot vacuum cleaner back to charger when battery is low?
What's technology robot vacuum cleaner used to locate it's charger when battery is low ?</p>

答:
I can't say that all robot vacuum cleaners use it, but the models that I have played with (the Neato XV-15 and Xiaomi Mi) use variations of the Simultaneous Location and Mapping (SLAM) algorithm.

Both robots use a LIDAR as the main navigation sensor for SLAM. There is a rather nice paper available on the Characterization of the Neato LIDAR unit if you would like more information.

In simple terms, the SLAM algorithm uses sensor data to create a map while the robot is cleaning. This allows it to plan a path from its current location back to the base station / charger at the end of the cleaning cycle, or when the battery charge drops below a predefined threshold.

If you are unfamiliar with SLAM, a good place to start is the SLAM for Dummies guide produced by Søren Riisgaard and Morten Rufus Blas at MIT.


问:
Setting initial conditions in a quadcopter numerical simulation
I am new to robotics, and currently trying to develop a purely numerical simulation of a quadcopter. As I understand, the problem of quadcopter control includes take-off control, hover stabilization and landing. However, I am only working with navigation control right now, foregoing take-off and landing. I am imagining a scenario wherein the quadcopter is already off the ground at a certain height (is that called hovering?) and it has to follow a trajectory in the presence of simulated noise (which I intend to introduce through random deviations in the angular orientations of the quadcopter) . The trajectory is nothing but a finely discretized curve in XYZ space (with a constant Z for now).

I am trying to build on this tutorial. It's a highly simplified model, just taking into account the thrust, external torques and frictional forces on the quadcopter. I have two questions here:
1. Is my setup even feasible just to demonstrate a proof of concept fuzzy control?
2. In this setup, and according to the initial condition mentioned above, I understand that if the quadcopter already has to be at a certain height h, then the net thrust in Z direction should balance the gravitational force. However, that would be the case at any height above the ground. But to get it to height h, how do I calculate the angular velocities in body frame that are required to keep it at that height? I am asking this because by means of affecting these velocities I'll be able to add some noise to the system and then work my way from there.

The platform for this numerical simulation is to be Matlab, if that information adds anything. I am planning to use only Matlab scripts for now, and not Simulink. As for my knowledge of dynamic systems, I understand basics of linear and rotational kinematics. I have only worked with implementing text book algorithms in a standard computer science course, and that's as far as my programming experience goes.

答:
Here's a quick answer. We can work on it to improve.

What you are searching for is the "trim state" of the vehicle for a given height and velocity (or hover). Methodologies for finding trim state is given in textbooks as "trim theory".

There are a few very general trim search methods:

1) solving an optimization problem: iteratively trying several values for states (attitudes, linear velocities, control positions, etc) Matlab has some built in functions for non linear optimization. Namely, fminsearch, fmincon, fsolve, etc. of course, you could write your own optimization script as well. Not too difficult, and definitely worth the effort.

2) using a gentle autopilot to converge on the desired flight conditions (requires a working flight controller, at least a SAS and an attitude hold mode)

Answers to particular questions:

Is this a feasible approach? Yes. Although a bit simplified, the method results in a representative vehicle that control algorithms can be developed on. However if the research is only about the controller side, a functional, working, linearizable plant would be a better option. Consumes less energy for making it work, and leaves more energy for designing a controller.

How to get to a particular height? You simply start your simulation at that height, and see what happens. For quadrotors, the RPM would need to be increased as air density decreases with altitude.

I couldn't understand why you'd need angular velocities in body frame, to catch an altitude. You need to have zero angular velocities during a trimmed flight condition. (Unless it's a trim of a maneuver like coordinated turn, or a wind up turn).


问:
How to check reachability of manipulator to a point?
I have written a MATLAB code for inverse kinematics of 3R robotic arm, which returns value of joint angles for given link lengths and end effector position and orientation. But if location of point is outside the workspace or it can’t be reached with certain orientation the program gives error.
Is there any way to check whether a particular point is reachable with a given orientation ?</p>

答:
You are basically asking if a given tool transformation has a corresponding IK solutions. This question, unfortunately, currently has no universal shortcut other than trying to actually compute IK solutions and see if any exists.

Nevertheless, I think there are a number of heuristics that you can use to speed up the process. For example, if the given position is farther from the base than the combined link lengths, you can be sure that no solution exists without checking further. You can also reach for works on reachability map.


问:
Why does the Denavit-Hartenberg representation fail to capture the length of the last link in my model?
The length of the last link (1.73) of my model (of a human finger) is not represented in any of the parameters that I calculated using the Denavit-Hartenberg algorithm, which I think can't be right. I suppose it should be represented in either a₃ or α₃, but those are both 0. It should be noted that the model has no end-effector/tool, but I aligned the z₃ with the approach vector anyway. If anyone has an idea where I'm messing up, that would be much appreciated! The model in question:

答:
I'm not sure why you're not following your own pattern. You have

```<code>a1 = PP;
a2 = IP;
a3 = 0;
</code>```

Why would a3 not be DP?

Body:
I'm not sure why you're not following your own pattern. You have

a1 = PP;
a2 = IP;
a3 = 0;

Why would a3 not be DP?


问:
How can I calculate speed and torque of stepper motor screw
I want to choose stepper motor screw with slider for use it to shift cube with side 5 cm and wight 250 g .

I found this motor .. how can I calculate speed and torque of slider

答:
This has a slightly longer answer than you may prefer, but the extra knowledge is necessary to get your result.

The useful values there are the 4-6V, 500mA, and the 3mm pitch. The motor will give you up to 3 watts of power. Power = torque x speed (kinda, I oversimplify slightly but its accurate). Now here's where the stepper can be handy: you can run it 'slowly'. Take a look at the charts on http://www.orientalmotor.com/stepper-motors/technology/speed-torque-curves-for-stepper-motors.html   You don't need to study the charts in too much detail; just notice that slope, showing that they have the most force at around 200-400 RPM, almost regardless of the particular motor. Also, stepper motors often are combined with gears - that exact website sells them, and you can reduce the gearing beyond 30:1 if you want it to move really slowly. That website just so happens to have a calculator for this exact application! http://www.orientalmotor.com/motor-sizing/ballLeadScrew-sizing.html

Just be aware that you'll need at least an Arduino board and a special driver for a stepper motor. They operate differently from other motor types, hence why they have 4 wires.

I wish I could give you easier answers, but unfortunately I've not found simple answers for electric motors either.  The easiest way to start is to get a simple DC motor or geared DC motor (more extreme gearing means more power, but slower) and you could attach it to a setup like that to spin the screw. You may still want/need a controller circuit for it.


答:
Note that in your drawing theta_p and theta_d angle are negative according to the right hand rule. That's the first mistake you made, to elaborate, theta_1 is equal to -theta_p.

Also in the last row of your DH table, the translation of DP is in the negative Y direction. Do not forget that the order matters - although there are 5 different combinations of orders of matrix multiplications to calculate the homogeneous transformation matrix.

Forget about the 5 different combinations and stick with the standard one:
First rotation about Z
Second translation along Z
Third translation along X
Fourth rotation about X

Title: Why does the Denavit-Hartenberg representation fail to capture the length of the last link in my model?

Body: The length of the last link (1.73) of my model (of a human finger) is not represented in any of the parameters that I calculated using the Denavit-Hartenberg algorithm, which I think can't be right. I suppose it should be represented in either a₃ or α₃, but those are both 0. It should be noted that the model has no end-effector/tool, but I aligned the z₃ with the approach vector anyway. If anyone has an idea where I'm messing up, that would be much appreciated! The model in question:


答:
First find the workspace of the robot arm.

The easy method is to model the robot arm and to apply ramp functions to the first two joints and a sine function to the last joint. Use the probe block to record the end effector positions. Ensure that the simulation length is sufficiently long enough.

The hard method is to find it analytically as given here.

Second export result to MATLAB and plot a 3D graph using the plot3 command.

Third for every point you want to test; plot it on the same graph and you will immediately see if it's within the workspace or not.

Title: How to check reachability of manipulator to a point?

Body:
I have written a MATLAB code for inverse kinematics of 3R robotic arm, which returns value of joint angles for given link lengths and end effector position and orientation. But if location of point is outside the workspace or it can’t be reached with certain orientation the program gives error.
Is there any way to check whether a particular point is reachable with a given orientation ?</p>


问:
Is it possible to use neural networks with Arduino?
I've got a project in university to build a vehicle on Arduino and I'd like to implement reinforcement learning for it. The processors on Arduino, of course, are too slow for this task so here is my question. Is it possible to perform all the learning in the cloud which will communicate with the vehicle via wifi? And if so, I would really appreciate some hints or references. Thanks.</p>

答:
If you are looking for training a neural network on Arduino, it might not be a very good idea. For this purpose, i would suggest a device with higher computation power, such as your own computer or a Raspberry-Pi .
However, if you wish to run a neural network on Arduino after training it and using the obtained weights, it can be done and there are a few libraries on the web that can help you out.
For the purpose of using cloud-based data, Tensorflow would be a good starting point.</p>


问:
Relative scale in SfM
I'm using monocular visual odometry. As in this case absolute scale can't be recovered, we rather compute relative scale for subsequent transformations as in this tutorial

To do this, triple matches across three frames are required. We then triangulate two $3D$ points $X_{m}$ and $X_{n}$ from images $\{i,i+1\}$ and $\{i-1,i\}$  then the relative scale can be determined from the distance ratio between point pairs in subsequent image pairs as follows:

$r=\frac{\parallel X_{m,\{i,i+1\}}-X_{n,\{i,i+1\}}\parallel}{\parallel X_{m,\{i-1,i\}}-X_{n,\{i-1,i\}}\parallel}$

My question concernes the coordinate system of the triangulated $3D$ points, the points have to be expressed in the coordinate system of the first, second or third frame or it dosen't matter as we are using the norm?

The triangulation method that I'm using outputs a $3D$ point expressed in the first viewpoint. How to convert it to another viewpoint?

答:
The answer simply is, it does not really matter because you're using the norm. The scale is determined by the actual translation and rotation between two cameras (which in case of monocular odometry are two views from the same calibrated camera). This rotation and translation information is contained in the essential matrix (or fundamental matrix) which has a scale ambiguity.

Another point I'd like to mention is, triangulation using monocular images is seldom very accurate. So if your objective is to determine the scale of subsequent images to generate a trajectory, I suggest taking a median of many ratios between many corresponding points, because it will work much better than randomly selecting two points and calculating r.

To express your 3D point to another viewpoint, use bundle adjustment.

Title: Relative scale in SfM


问:
Optimization of link lengths for 3R serial manipulator
I am trying to formulate an optimization problem for determining link lengths of 3R manipulator shown in picture below,

Following are the constraints,

Robot arm should be reachable at point x = 100, y =0

Link 3 should sweep minimum 60 deg. angle at the end point (i.e. min Φ = 240 deg, max  Φ = 300 deg)

$ 20°\leq\theta_{1}\leq160°$, $ 200°\leq\theta_{2}\leq340°$, $ 200°\leq\theta_{3}\leq340°$

Objective is to minimize $l_{1} + l_{2} + l_{3}$

How can I define 2nd constraint of minimum sweep angle mathematically?

Reference for 3R Robot kinematics: http://www.seas.upenn.edu/~meam520/notes/planarkinematics.pdf

Current Formulation:

$Minimize f(x) = l_{1} + l_{2} + l_{3}$

$Subject \:to \: \: l_{1}\cos(\theta_{1})+l_{2}\cos(\theta_{1}+\theta_{2})+l_{3}\cos(\theta_{1}+\theta_{2}+\theta_{3}) = 100$

$ \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \:l_{1}\sin(\theta_{1})+l_{2}\sin(\theta_{1}+\theta_{2})+l_{3}\sin(\theta_{1}+\theta_{2}+\theta_{3}) = 0$

$ \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \:  20°\leq\theta_{1}\leq160°$

$ \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \:  200°\leq\theta_{2}\leq340°$

$ \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \:  200°\leq\theta_{3}\leq340°$

答:
You can try this.

Suppose we break the chain of the original robot $R$ into two: $R_1$ with two links (the first and the second links of $R$), $R_2$ with one link. $R_1$ is based at the base of $R$ while $R_2$ is based at your grasping point. See figure.

When link 3 sweeps $60^\circ$, $R_2$ will trace an arc of a circle. Then what you want is that $R_1$ can also trace the arc traced by $R_2$.

I think it is the case that this two-link robot can trace out any smooth curve within its reachable region (the circle of radius $l_1 + l_2$ centered at the case of $R_1$). (You will need to prove (or disprove) this, but I guess it's not too difficult.) So you just need to make sure that the arc drawn by $R_2$ lies inside the reachable region of $R_1$.

Using some geometry, the above condition should be able to be written down as a constraint (or a set of constraints) for your optimization problem.


问:
Optimal-Time Trajectory Planning in 1D
I have been searching for a solution to the mentioned above problem, but nothing was accurate enough.

I am trying to find the optimal-time trajectory for an object from initial point A to final point B.

The velocity at those points is 0, and the max velocity and acceleration are v_max and a_max

How can i solve this?

答:
Hi usually the time optimal solution of a motion not having specific constraints is know as 'bang-bang'. Where you let you system accelerate and decelerate at the maximum rate possible.
In your case, you command a_max until v_max is reached then you stay at this speed until you need to break at -a_max to reach zero velocity.

I also suggest to look at Pontryagin's maximum principle

How to do that in practice, i.e. how to find the profiles of the position/velocity/acceleration ?
This is the solution that is usually described, when the dynamic of the object is not considered, that means when control authority is unlimited.

keep in mind that the problem is symmetric, i.e. you need as much time to accelerate then to decelerate;

start from position, velocity and acceleration at zero (or higher derivative);

apply a discontinuous acceleration from 0 to a_max until v_max is reached, check the time and the distance (you will need the same to brake);

apply a discontinuous acceleration from a_max to 0, this keep the velocity at v_max do that until you arrive at half the distance (this will also be half the time);

apply a discontinuous acceleration from 0 to -a_max until the velocity is zero, you should have reached the goal (this is the inverse of 2) ) set acceleration to 0.

Note that if you goal is "close" you might not need to reach v_max and should start to break before, hence the checks in time and distance. Also the best to visualize that is to draw the profile one below the other on a sheet of paper.

To the best of my knowledge this case without the dynamics is considered as simple and I don't know a solver for that, as coding the above algorithm reasonably easy. The assumption of neglecting the object dynamics is usually good enough for simple robots and brings to feasible motion for simple robots. If you want to be more gentle for the system considering higher order derivatives (jerk, snap) is possible but there maximal values are usually not intuitive to set/find, another solution is to take the position profile and feed it to a  5/6th oder filter, to get a smooth trajectory for all derivatives considered.
The literature for 'bang-bang' controller considering dynamics and actuation constraints is vast and encompass different cases that might fit you.

In short if you are an hobbyist or undergrad  try this method out, if you want more advanced stuff you will need to dig the literature to find something close to your issue.

Title: Optimal-Time Trajectory Planning in 1D


问:
Connecting two microcontrollers using I2C
I Have an ATmega16 mc which is master on the i2c and a ATMega8 mc which is slave on the i2c.

I have connected the two mcs' sda and scl ports to each other alongside a pullup resistor.

Now I want to read a register from the ATMega8 using the ATMega16.

The problem is that I don't want to assign all the variables manually. Is there any libs or headers that will do this thing for me?

答:
AVR publishes a set of guides for every microcontroller they make. See http://www.atmel.com/devices/atmega16.aspx?tab=documents, and obtain the ATmega16(L) Complete document.

You will find a chapter dedicated to I2C (it is named 2-wire Serial Interface (TWI)). While there may be libraries, the general practice is to set the appropriate registers manually.

Each register is given a name (all caps, like a constant) - an 8-bit integer you can set in C. Specific bits will be used to set one microcontroller as a master or slave. For example, the following registers are relevant to the two-wire interface.

TWI Register Description

TWI Bit Rate Register – TWBR

Bits 7...0 – TWI Bit Rate Register

TWI Control Register – TWCR

Bit 7 – TWINT: TWI Interrupt Flag

Bit 6 – TWEA: TWI Enable Acknowledge Bit

Bit 5 – TWSTA: TWI START Condition Bit

Bit 4 – TWSTO: TWI STOP Condition Bit

Bit 3 – TWWC: TWI Write Collision Flag

Bit 2 – TWEN: TWI Enable Bit

Bit 1 – Res: Reserved Bit

Bit 0 – TWIE: TWI Interrupt Enable

TWI Status Register – TWSR

TWI Data Register – TWDR

TWI (Slave) Address Register – TWAR

Note that you set certain bits to specify bit rate, the data to transfer, the address a slave responds to, and when to start/stop transfers (the control register). You can also obtain the status of transmissions from the status register.

The document will also walk you through the steps to use it:

Obtained from the AVR "ATmega16(L) Complete" document


问:
Dynamics of a robot manipulator with a force acting on the end-effector
I have this exercise

The dynamic model is

$B(q)\ddot{q}+S(q,\dot{q})\dot{q}=\tau+\tau_k$

Where $B(q)$ is the inertia matrix, $S(q,\dot{q})\dot{q}$ are the centrifugal and Coriolis terms, $\tau$ is the actuator input and $\tau_k=J^T(q)F$ is the torque imposed by the external force.

So since at rest $\ddot{p}=J(q)\ddot{q}$, $S(q,\dot{q})\dot{q}=0$ and we have no actuator input, substituting $\ddot{q}$ from the dynamic model we have

$\ddot{p}=J(q)B^{-1}(q)J^T(q)F$

I assume that for the point 1, for the second principle of the dynamics, the end-effector accelerates as in the case B. Now, in the point 3, if we have non-uniform masses of the links, the second principle of the dynamics is still valid? I guess I can choose an inertia matrix $B(q)$ with proper centers of mass of the three links such that at the rest configuration $q_{eq}$

$\ddot{p}=J(q_{eq})B^{-1}(q_{eq})J^T(q_{eq})F=\begin{bmatrix} p_1 \\ 0 \\ 0\end{bmatrix}$

and so the end effector accelerates as the case D right?

答:
If you consider a null velocity when you apply the force, then you cancel out the terms in your dynamics that are multiplied by the velocity, hence you can consider $S(q,\dot{q})q$ null  and $\ddot{p} = J q$ as $\dot{J}\dot{q}$ is null leading to your expression of the instantaneous acceleration.

If you rewrite it in the form $\dot{p} = A f$ (prefer capital for matrix and lowercase for vector if you can), then what you want to prove is that $A \in \mathbb{R}^{3 \times 3}$ is such that it maps a vector of the form $\begin{bmatrix} 0 \\ f_2 \\ 0 \end{bmatrix}$ to an acceleration $\begin{bmatrix} \ddot{p}_1 \\ 0 \\ 0 \end{bmatrix}$. You known the analytical structure of A from the Jacobian and Inertia matrices, so you can see if it is possible to get a second column of A of the desired form.


问:
Multiple Line Estimation
Background:

I am working on a design in which an autonomous RC car implements a LIDAR sensor to navigate a course.

The primary LIDAR sensor returns a 270 array of points, scanning in a line like fashion, each representing the distance at a particular angle. These can easily be converted from polar to cartesian coordinates.

Question:

Given a set of points how would you estimate the number of lines that exist within this plot and the slope of each line. An explanation for a simple linear regression is not required, an explanation on how to detect discontinuities between the data is helpful.

答:
From technical point of view I would refer you to this pcl tutorial

From you description I guess that you want to navigate the car between lines. Looking a one scan and detecting the line is quite crude, a more complex approach would be to merge the LIDAR info with odometry info and use a SLAM algorithm to at the same time build a map of the environment and localize your vehicle inside. This way the points from your LIDAR are aggregate other time and it might be easier to extract features as they are composed of more point.

Also a practical thing I would recommend you not to have the LIDAR plane parallel to the floor but with a couple of degree tilting so that in your point cloud you also get information about the ground.

Title: Multiple Line Estimation


问:
Robotic arm select servo motors
Hi i´m designing a robotic arm based on this idea of the NOVABOT I only want to change its structural parts by aluminum tubes. In this design 3D model it use the servo hs-311 wish have a max torque of 3.7 kg/cm, and its made of some plastic material.

I made my calculations following this url and made a excel that I append here... the mass of my design have been taken from iProperties of Autodesk Inventor, so they are in mass units not in weight. And I´m dismissing the mass of the joints (m5,m6) to have a first idea of the values, because I dont have the selected motors.

And my problems is that I think I´m missing something here because the it results in a very high torque motors, for this simple design.

here is my excel

答:
Well it seems that length is your problem.I came here having a similar problem to yours with designing a robotic arm. Servos that can pull this weight go for 500+ USD. Adapt the length and weight of your joints to what your servos can lift.
I would also suggest using 6V power supply to get more torque out of your servos and while datasheets are available for cheap servos from China you should not take the listed torque for granted.</p>

Title: Robotic arm select servo motors


问:
Preventing leaks in motor shafts for underwater bots
Whenever building an aquatic bot, we always have to take care to prevent leakages, for obvious reasons. Now, holes for wires can be made watertight easily--but what about motors? We can easily seal the casing in place (and fill in any holes in the casing), but the part where the axle meets the casing is still left unprotected.

Water leaking into the motor is still quite bad. I doubt there's any way to seal up this area properly, since any solid seal will not let the axle move, and any liquid seal (or something like grease) will rub off eventually.

I was thinking of putting a second casing around the motor, maybe with a custom rubber orifice for the shaft. Something like (forgive the bad drawing, not used to GIMP):

This would probably stop leakage, but would reduce the torque/rpm significantly via friction.

So, how does one prevent water from leaking into a motor without significantly affecting the motor's performance?

(To clarify, I don't want to buy a special underwater motor, I'd prefer a way to make my own motors watertight)

答:
On one of my remotely controlled boats, I used this design...

The blue discs are flywheels. They are attached to the green rods which are hooked to both sides of a flexible, waterproof membrane. The membrane is fixed to both sides of the casing so it will transmit the motion, but it will not let water through.


答:
You can start by using split-and-merge segmentation algorithm.

There are many algorithms available A Comparison of Line Extraction Algorithms using 2D
Laser Rangefinder for Indoor Mobile Robotics.

If you want to refer the code, A ROS package is available here and below picture is the result from it.

Title: Multiple Line Estimation

Body:
Background:

I am working on a design in which an autonomous RC car implements a LIDAR sensor to navigate a course.

The primary LIDAR sensor returns a 270 array of points, scanning in a line like fashion, each representing the distance at a particular angle. These can easily be converted from polar to cartesian coordinates.

Question:

Given a set of points how would you estimate the number of lines that exist within this plot and the slope of each line. An explanation for a simple linear regression is not required, an explanation on how to detect discontinuities between the data is helpful.


问:
Cmake Error While Buliding Pixhawk simulator
I am trying to run "px4 SITL simulation" using gazebo7 on my machine with "UBUNTU-14.04 LTS" using these commands:

```<code>mkdir -p ~/src
cd ~/src
git clone https://github.com/PX4/Firmware.git
cd Firmware
git submodule update --init --recursive
</code>```

But as I enter the next command i.e :

```<code>make posix_sitl_default gazebo
</code>```

It gives an error -->

```<code>CMake Error: The source directory "/home/arpit/src/Firmware/build/posix_sitl_default/-Wno-deprecated" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
/bin/sh: 1: cd: can't cd to /home/arpit/src/Firmware/build/posix_sitl_default
make: *** [posix_sitl_default] Error 2
</code>```

Any Solutions?

答: There's something wrong with the Makefile where this is breaking depending on your exact setup. As a quick fix I would hack out the -Wno-deprecated from the Makefile, and I'll look at fixing this.</p>


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

答:
I would say, that it depends on how you fly it, if you think you are going to crash it a lot, and if you make a lot of changes/improvements. Aluminum is pretty damn cheap, and it has, depending on how you fly/crash, one big advantage, it's flexible. Sudden high G-forces don't crack aluminum, carbon fiber on the other hand is very rigid.

So if you are a professional R/C pilot, that build's it right the first time, and doesn't crash a lot, I would say Carbon fiber.

If you make a lot of changes, are not a very good pilot, or think you are going to stress it a lot, I would say Aluminum.

Title: Aluminum vs Carbon Fiber


问:
Searching for an idea to enhance robot chasis strength
Hello every one I am working on a robot and I am using kinda big motors and I made the body from 5mm plastic sheet and I found that its not strong enough to hold the robot as you see in the pic there a big curve there
And I am searching for a cheap idea to make the robot stronger

答:
I would make an X shape using L channel or U channel going from corner to corner on the upper side. It is much easier to bend a flat piece of metal, plastic, wood, etc than it is to stretch or compress the same material. Think of I beams in buildings, the material at right angles causes the beam to have much more strength.

https://www.mcmaster.com/#aluminum-angles/=1a0i7kc

A cheap and easy way would be to mount one piece of L channel on the upper side going one direction, and the other on the underside going the other, to form the X. otherwise you're going to have to find a way to deal with the intersection of the two right angle pieces, which is still possible, just more work.


问:
finding the frequency of CAN send and CAN receive messages using CAN in Ubuntu
Can anyone please share me the command how can i find the frequency of CAN send and CAN receive messages. I'm sending CAN messages using a serial port and receiving it with a peak CAN usb. There is no error no drop messages between both receving and sending sides but i don't know the command to get the frequency. I'm using only simple candump and can send commands in Ubuntu. I know the bps but i want to know the frequency of sending and receiving sides. Thank you</p>

答:
candump can output the timestamp for each message in different formats. Check the usage notes of candump.

candump -t d can0 will give you the time difference between messages for instance.


问:
Image coordinate to robot coordinate
I am working with a Nao robot. One if the things I want to do is the following:

Take an image of geometrical objects in front of the Nao (done)

Extract features from the objects in the image, such as x, y, color, etc.. (done)

Make the Nao point to one of the objects (TO DO)

So, what I need is to transform a 2D coordinate in the image plane to a 3D coordinate in the robot's coordinate system. I have some idea on how to do this, but I am not sure if this is correct.

So, I start by transforming the 2D image coordinate to the 3D coordinate system that originates in the camera of the Nao. For this, I use height and width (in pixels) of the image ($r_w$ and $r_h$) and the horizontal and vertical camera opening ($\theta_v$ and $\theta_h$). This transformation is: $$ v_c = \left( \begin{matrix} 1 \\ -\frac{x_i}{r_h} \tan{\frac{\theta_h}{2}} \\ \frac{y_i}{r_w} \tan{\frac{\theta_v}{2}} \end{matrix} \right) $$

Than, I need to translate this vector using the orientation of the head of the Nao. The resulting coordinate system is parallel to the entire robot's coordinate system. The rotation of the camera is given by $R_c$. The translation is: $$ v_t = R_c v_c $$

Finally, I project this coordinate system to the robot's coordinate system. The Nao can use 2 coordinate system, one that originates on the ground between its legs (FRAME_ROBOT) or one that originates in its chest (FRAME_TORSO). Which one is used has no real importance for me. Let's say the offset between the coordinate systems is given by $t_c$. The transformation is: $$ v_r = v_t + t_c $$

So, given a position in the image $(x_i, y_i)$, I get this position in the robot's coordinate system. Is this a correct approach?

答: The standard way to perform projection transforms between camera images and the world outside is through a projection matrix. Look at this presentation starting at page 25 for an introduction to the subject. But I recommend that instead of implementing your own, you rely on external libraries to perform this sort of task whenever possible, e.g. in ROS the image_geometry package provides the PinholeCameraModel class for handling coordinate projections.</p>

Title: Image coordinate to robot coordinate


问:
Why are quadcopters more common in robotics than other configurations?
I've noticed that almost all research being done with helicopter robots is done using quadcopters (four propellers). Why is there so little work done using tricopters in comparison? Or a different number of propellers? What about four propellers has made quadcopters the most popular choice?</p>

答:
The mechanical answers above are correct. The inherent stability problems with single large motors are exchanged for dynamic comtrol over 12 dimensions of acceleration, yaw, pitch, roll which can be partially coupled (the translational amd rotational matrix) where one is presented with a simplified diagonal inertial frame to build a dynamic model with. In this model there is also an inverse relation between the radius of the quad and the translational and rotational agility. It becomes very easy to "dodge bullets" at very very small radii.

To answer the question How do you get pure yaw motion with a quadcoptor?, in comments to this answer, you get pure yaw in the following way:

North and South motors rotating the same speed but collectively at a higher (or lower) speed than East and West Motors which are also at the same speed.

It won't pitch or roll, it will yaw y'all. (Sorry)

Furthermore, in software one can control the copter after breaking off the north and south propellers at the expense of yaw control, the craft will continuously spin and as long as the frequency of software refresh rate is able to handle the speed of yaw rotation the copter remains exactly as stable (sort of) the dimension of acceleration is clipped and response or jerk is also somewhat clipped but it can move pitch and yaw just the same by compensating in software. (Desired yaw state becomes virtually coupled to the physical state)


问:
Lego Mindstorms EV3 gyro sensor offset fix
I am currently working on a project for a Lego Mindstorms EV3 autopilot using Matlab/Simulink. Basically, I am using a closed loop control system with a PID controller for the control of the control surfaces. I'm using Simulink to construct the autopilot block diagram. The feedback loop consists of the gyro sensor. Now the gyro sensor is not accurate in the sense that it has some offset. It does not have any bias or noise. I need to get rid of the offset to give me the actual angle of the device. How could I solve this problem? I could use a low pass filter but how do I know what transfer function to use in Simulink?</p>

答: One reason is that the gyro is not being software reset. A hardware reset(unplugging and plugging in gyro) might help too</p>


问:
Why does a ID controller not exist?
Why doesn't a PID only consisting of ID exist?</p>

答: P (Proportional) meaning how responsive the system. Not only P can control the system responsive. Clock or Sampletime can make the system more responsive. So when u try only I (Integral) if responsive system has been high so it's possible only using ID.</p>

Title: Why does a ID controller not exist?


问:
What software can I use to 3d model and simulate my robot?
I would like to know if there is any software that I can 3d model my robot and insert that model into some sort of simulation software where I can run AI related code(in python). Any suggestions would be appreciated.</p>

答:
All depends on much "standards" is your robot and how much coding of the simulator you want to code.

If you don't want to simulate contact the easiest way is to write down your own simulator in you favorite language, based on the underlying mathematical model of your robot. If you have access to matlab the simmechanics toolbox, can be interesting because the toolbox derive the dynamical model on its own, but it is poorly documented (and expensive).

If you have a "standard robots" you can look at V-REP or gazebo, which are working standalone or in combination with ROS. Some robots models are already coded or can be easily generated. ROS is compatible with python.
You can also have a look at the MORSE simulator, which has been developed for academia.

I am pretty sure that my list is non-exhaustive, but it should provide you some starting points.


问:
How to track two set-points with one output?
How can I track two set-points in a system using only one output?

Example: make a motor track a position x moving in a speed y while I have only voltage as an output, speed and position as feedback.

can this be done with PID or there is a need for more complex methods?

答:
If your position and velocity are related (i.e. the speed is derived from the position) then they are kind of matching. In this case, if you use a simple proportional controller you can track the position but if you use a PD you are providing an extra information on the derivative of the tracked position, thus you can have a better tracking because the controller also has information about the derivative.
This approach relies on feedback on the quantities, i.e., you check the discrepancy between desired and an actual values. As noted by @fibonatic, you can use mixed approach where you apply feedback on the position and a feedforward approach on the higher derivative (so you only consider the desired values not checking against the actual ones).

If you have position and velocities which are not matching, it is physically impossible to track both for your system. The first requirement of a trajectory generator is to produce feasible trajectories, i.e. feasible pairs of position velocity w.r.t your system dynamics.

Note that in practice there is potentially an infinity of such feasible trajectories (as pointed out by @Gürkan Çetin) and you could choose the "best" one based on your criteria (minimal time, minimal energy, ...) via optimization methods if you have a good enough model.


问:
Using jacobian of arm robot to calculate transformation matrices?
I have been given a Jacobian for a 3 revolute joint robot.

I need to obtain the origins of each of the joint. Origins of the joints can be obtained once I get $T^0_1$, $T^0_2$, $T^0_3$ and $T^0_4$. 4th frame is my end effector.

Is there any way to calculate the transformation matrices from the Jacobian? I have gone through literature extensively and I can get the Jacobian from the transformation matrices using the below relations

The Jacobian is

$$J = \begin{bmatrix}
J_v\\
J_w
\end{bmatrix}$$

where for revolute joints,

$$ J_{v_i} = z_{i-1} \times (o_n - o_{i-1}) \\
J_{w_i} = z_{i-1}$$

Is the reverse possible i.e, obtaining the transformation matrices when I have the Jacobian?

Is there any way to obtain just the origins of the frames $ o_1, o_2, o_3$  ($o_0  = \begin{bmatrix}
0 &0 &0
\end{bmatrix}^T$ ) from the given Jacobian? The reverse cross product method does not give me the complete co-ordinates of the origin.

答:
The Jacobian corresponds to the mapping between Cartesian space and joint space at the velocity level. So from the joint coordinates to the end-effector Cartesian coordinates.

As you pointed out from the transformation matrices it is easy to derivate the the Jacobian.
But if you get the Jacobian of a robot in general it's is hard to retrieve the transformation matrices because they are "mixed" in the term of the Jacobian, and it is impossible if you retrieve a numerical Jacobian.

I your case you have some structure so its might be possible but it would be simpler/faster to just write down a parametrization of the arm and derive the transformation matrices. If you want some generic tool look at Denavit–Hartenberg parametrization in any robotics handbook.


答:
While it is not possible to completely determine all the origin given only one Jacobian, I think it's possible to obtain the origins $o_1, o_2, o_3$ from multiple Jacobians.

Let's write
$$J = \begin{bmatrix}J_{v1} & J_{v2} & J_{v3}\\J_{w1} & J_{w2} & J_{w3}\end{bmatrix} = \begin{bmatrix}z_0 \times o_3 & z_1 \times (o_3 - o_1) & z_2 \times (o_3 - o_2)\\ z_0 & z_1 & z_2\end{bmatrix}.$$

You can easily see that given one Jacobian, it's not possible to completely determine $o_3$ as we can write
$$
o_3 = \frac{J_{v1} \times z_0}{\Vert z_0 \Vert^2} + a_0z_0,
$$
for arbitrary $a_0$.

Simllarly, from $J_{v2} = z_1 \times (o_3 - o_1)$, we have
$$
o_3 - o_1 = \frac{J_{v2} \times z_1}{\Vert z_1 \Vert^2} + a_1z_1,
$$
for arbitrary $a_1$.

From the two equations above, we then have that
$$
o_1 = \frac{J_{v1} \times z_0}{\Vert z_0 \Vert^2} - \frac{J_{v2} \times z_1}{\Vert z_1 \Vert^2} + a_0z_0 - a_1z_1,
$$
for some arbitrary $a_0$ and $a_1$.
But $o_1$ is actually the origin of the first joint so by right, $o_1$ should remain the same at any configuration.

Considering this, with another Jacobian, we may be able to calculate  $a_0$ and $a_1$ and hence $o_1$.

I think we can use the same trick to recover $o_2$ and $o_3$ as well.

Title: Using jacobian of arm robot to calculate transformation matrices?

Body:
I have been given a Jacobian for a 3 revolute joint robot.

I need to obtain the origins of each of the joint. Origins of the joints can be obtained once I get $T^0_1$, $T^0_2$, $T^0_3$ and $T^0_4$. 4th frame is my end effector.

Is there any way to calculate the transformation matrices from the Jacobian? I have gone through literature extensively and I can get the Jacobian from the transformation matrices using the below relations

The Jacobian is

$$J = \begin{bmatrix}
J_v\\
J_w
\end{bmatrix}$$

where for revolute joints,

$$ J_{v_i} = z_{i-1} \times (o_n - o_{i-1}) \\
J_{w_i} = z_{i-1}$$

Is the reverse possible i.e, obtaining the transformation matrices when I have the Jacobian?

Is there any way to obtain just the origins of the frames $ o_1, o_2, o_3$  ($o_0  = \begin{bmatrix}
0 &0 &0
\end{bmatrix}^T$ ) from the given Jacobian? The reverse cross product method does not give me the complete co-ordinates of the origin.


问:
Generate a coverage path given a polygon region
I'm making an app which controls a drone (DJI) and takes photos.
In one particular feature, the user can draw a polygon (let's keep it a convex quadrilateral for now) and the app should generate a serpentine path for the drone to fly over the entire region.

Input: 4 vertices of the polygon

Output: Array of coordinates of the path.

Any heads up on which algorithm to use?
I've looked in to Boustrophedon Cell Decomposition, but there's not much documentation on it.

答:
This thing is generally called coverage path planning.

If you are particularly interested in Boustrophedon Cell Decomposition, you may have a look at the paper introducing it: Choset and Pignon (1998).

You may also want to check out this survey paper.


问:
How do you arrange the dof in a robotic arm?
I'm designing an arm that can manipulate objects on a table.

My question is about the arrangement of the degrees of freedom.

Different robots seem do have different arrangements of the degrees of freedom,.

e.g. the open-source thor robot uses [yaw-roll-roll-yaw-roll-yaw], while Google's in-house arm uses [yaw-roll-yaw-roll-yaw-roll-roll].

Is there any reason you would choose one specific arrangement over another?

答:
One thing you should note is the difference between the number of DoFs. Do you want a robot for a specific task or do you want a versatile robot.

If you want a specific task robot, chance are that you can optimize your DoFs arrangement for the task at hand.

If you want a generic robot then you have way more freedom. From my experience, the choice of DoFs and their arrangements is mostly constrained by the available motors and the wrench you want to exert at the end-effector. Also if the considered motor have angular limits the shape of the workspace is impacted by the arrangement of the DoFs. Lastly the location of the motor influence the inertia of the robot, hence the dynamic motion. For example for very fast motion, like pick and place delta robots are preferred as the motors are fixed to the base when the end-effector moves.


问:
What criteria should be considered when comparing 2 robot simulation/modelling software?
I want to compare MapleSim (Maplesoft) to SimMechanics (Mathworks) what should my criteria of comparison be?</p>

答:
I think the most important criteria are

the purpose of your simulator (do you need contact physics? how complex are your models? )

your fluency in both solutions

the size and quality of the documentation/community

is the code you are going to write for the simulator re-usable for real system ?

what is the licencing policy of the simulator (and its price)

In general there is no magic simulator, each comes with its drawbacks and plus. So the choice of a simulator is a compromise between your needs and the solutions available on the market.


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

答:
The Inverse Kinematics (IK) solver needs to be aware of the joint bounds in order to provide always a feasible solution lying in the allowed range.

In literature, there are essentially two diverse methodologies to deal with constrained IK in a principled way:

The Gradient Projection method that makes use of the null space of the Jacobian to establish a secondary task that attempts to keep joints far from their constraints while converging to the solution of the primary task. See for example [1]. You can resort to tools like KDL.

Nonlinear optimization techniques that inherently deal with bounded search regions and thus demonstrate to outperform other approaches. Nowadays, computational resources are such that these demanding techniques can be run even in real-time. See [2], [3] and [4]. Tools implementing this approach are for example TRAC-IK, iKin (tutorial is available) and iDynTree.

References

[1] H.-Y. Lee, B.-J. Yi, Y. Choi, “A Realistic Joint Limit Algorithm for
Kinematically Redundant Manipulators,” IEEE International
Conference on Control, Automation and Systems, 2007.

[2] P. Beeson, B. Ames, "TRAC-IK: An open-source library for improved solving of generic inverse kinematics," IEEE-RAS International Conference on Humanoid Robots, 2015.

[3] U. Pattacini, F. Nori, L. Natale, G. Metta, G. Sandini, "An experimental evaluation of a novel minimum-jerk cartesian controller for humanoid robots," IEEE-RSJ International Conference on Intelligent Robots and Systems, 2010.

[4] https://robotics.stackexchange.com/a/10008/6941


答:
For 3D modelling go with a Solidworks and for Simulation use Matlab.These links might help you:

1- https://www.youtube.com/watch?v=1nSafEJlySs&feature=youtu.be

2- MATLAB 3D Simulation with SOLIDWORKS model

Title: What software can I use to 3d model and simulate my robot?

Body: I would like to know if there is any software that I can 3d model my robot and insert that model into some sort of simulation software where I can run AI related code(in python). Any suggestions would be appreciated.</p>


问:
Motor and Ethernet shields together
I was wondering if it is possible to plug a motor shield on top of an Ethernet shield, even though the direction pins on the motor shield would be connected to the same pins as the spi bus.  I was thinking that it would work if, in the coding, I disabled both chip selects on the Ethernet shield before I used the motors.</p>

答:
The whole point of the chipselect pin is so that multiple devices (in this case, shields) can share the same SPI bus.

As long as no two chipselect pins are the same, you ought to be fine. Make sure only one chip select pin is on at any given time.

Title: Motor and Ethernet shields together


问:
Expressing a global point in different frames
I am trying to express a vector defined in global coordinates in different frames using homogeneous transformation matrices.

There are in total 3 frames. Frame 1 lies in the origin and is fixed to the world. Frame 2 is fixed to a floating body, with 6 degrees of freedom. Frame 3 is attached to the same floating body and has only a pure translation with respect to Frame 2.

The vector $R_0$ is the vector that I'm trying to express in Frame 2 to obtain $R_2$.
For this I have constructed two homogeneous transformation matrices:

$H_{01} = \begin{bmatrix}R_{01} & T_{01}\\\mathbf{0} & 1\end{bmatrix}$ and $H_{01} = \begin{bmatrix}I & T_{12}\\\mathbf{0} & 1\end{bmatrix}$.

With these transformation matrices i should be able to transform a vector expressed in frame 0 to frame 2. I did this doing the following:

$R_2 = (H_{01}H_{12})^{-1}R_0$

Then I plotted the frames and vector to come to the conclusion that its not quite right whenever I put in a rotation matrix $R_{01}$. To illustrate my situation some images:

If I put $R_{01}$ is equal to anyhting but the identity matrix my vector does not end up in the red dot (the fixed point expressed in world coordinates).

Edit:

From what i can see, the vector that I am obtaining looks correct but is now plotted in global space and not in the frame from which is should be plotted.
So basically my question becomes: how can I rotate $R_2$ back in order to plot the vector such that it ends up in the reference point?

答:
I would suggest you to clarify your notations and not use capital letter for vectors but only for matrices, calling a vector $\mathbf{R}_*$ and the rotation matrix $\mathbf{R}_{*@}$ can lead to confusions, even for you. More over your index notation  are not consistent.

That being said it seems that your math are right (provided that the index you wrote are the one I guessed).
So your trouble is most likely in plotting, if you express you original vector in the reference frame you get the red dot, if you want to check the resulting vector "$\mathbf{R}_2$" you need to pre-multiply it by the two transformations (in order to be in your third frame).

Note that you can rewrite the inverse of a transformation matrix in a more efficient way
${}_0\mathbf{T}^1 = \begin{bmatrix} {}_0\mathbf{R}^1& {}_0\mathbf{p}^1\\ 0 & 1 \end{bmatrix}$  and
${{}_0\mathbf{T}^1}^{-1} = \begin{bmatrix} {{}_0\mathbf{R}^1}^{T} & -{{}_0\mathbf{R}^1}^{T} {}_0\mathbf{p}^1\\ 0 & 1 \end{bmatrix}$


问:
Significance of link length ratio in serial manipulator
I am formulating a problem to optimize link lengths of 3R serial manipulator shown below :

I do not assume any explicit relationship between the link lengths, but in one of the papers (http://www.sciencedirect.com/science/article/pii/S1474667017358172 , page 119, equation no.14) I am referring assumes following relationship :

$l_1 /l_2 \geq 1.1$

$l_1 /l_2 \leq 2$

$l_2 /l_3 \geq 1.1$

$l_2 /l_3 \leq 2$

According to another paper (page 569, below equation 14), the above relationship exists in a number of the industrial manipulators they studied. What's the reason behind this relationship?

答:
I am not sere about the conclusion of the paper in general as it can be considered a bit outdated with respect to the "famous" manipulators configuration nowadays. You can easily find the dimensions on the manufacturer websites and check if that relation holds.

In general when you optimize you should state clearly your criteria, what do you want to optimize? Workspace ? Payload for given motors? maximal velocity at the end-effector? Possibilities are endless ...

Concerning the paper you refer to, you can see the cost function $\kappa$ as equivalent the static force manipulability index, so the criterion used is the maximization of that index.


问:
For a beginner who wants to learn lots is it better to use a PIC and start from there or to use something like a Arduino?
For a beginner that wants to learn how to build robots and learn as much as possible is it better to use a PIC and start from there or something more like an Arduino?

I ask because I have this book called The Robot Builder’s Cookbook (2007). It is certainly older but I feel like maybe starting at a lower level might help me learn more. Is this a logical train of thought or should I just try Arduino route?

答:
Assuming by PIC you meant the Microchip PIC

Because you are a beginner - it is suggested you copy rather than invent solutions to your yet to be discovered problems.  It follows that Arduino is the better choice because there are many more examples to copy from.


问:
How to simply connect a plastic wheel to plastic body of a robot?
I have a robot that it's down part is something like this photo: http://www.sanatbazar.com/components/com_jshopping/files/img_products/full_Capture3.JPG .
This chassis has 4motors and 4wheels are connected directly to motors, but my robot only has 2motors and 2 rear wheels are connected to motors directly. And the problem is about forward wheels! I am looking for a simple and cheap(but good) way to connecting them.

As I saw in some toy cars, they used a shaft through 2wheels and connecting them to shaft, but as I have electrical parts inside the body and need smoother movements, I prefer to use another way. I searched about bearings but don't know how to attach them to my chassis?

At the end I should mention my robot has made by 3D printed parts and I can change the down part's design to matching something like bearings.Also the chassis dimension is about 16*16*6 CM^3.

EDIT: These photos are my chassis, wheel and two 3D printed white parts that I wanted to use as connection, but I saw this mechanism is very unstable and wheels slipping:

I can change my chassis design and 3D print it again, but I am looking for a proper design for my purpose. I don't like to pass a shaft trough side holes, because I want to put my electronic board there!

Edit2: I bought a bearing with maintainer as you can see below:

But it's about 2times bigger and heavier than what I want! So the only other option do I have is using this simple bearings, but I don't know how to maintain them to the body:

答:
The problem with asking for a specific answer without providing all the requirements (it must do this, it can't do that, etc.) is that any answer becomes a circular argument as to what might work or what won't.

There are many possible answers, there are many possible designs.

What you are asking is this:

"Go find me a rock."

Then someone offers up a rock without knowing your master plan.

And you reply, annoyed:

"Not that rock, a better one."

When engineers (like myself) design, they start from a specific set of requirements to avoid wasteful tautologies.

Before you start playing with a 3D printer you should decide major things like where do the wheels go? Must they be in the body?

If they don't have to be in the body then you could use a technique like these Badger Wheels:

and mount them on the outside of the chassis but still keep a single front (?) axle.

Every design choice delivers you good (pro) and bad (con) consequences to your overall design. You can't keep all of them in mind when you are looking for a design one rock at a time.

Resubmit this question with a complete (exhaustive list) of requirements and someone might be able to give you the very best rock in one attempt.

Given the updated post, here is a rough idea of what you want:

Since you are mounting an axle that will carry 1/4 the load (vehicle mass) and the wall is plastic you need a method to reinforce the mounting location and at the same time not flex so the wheel drives straight. Short axles cause mechanical deformation if the mounting methods aren't strong enough because they are an unbalanced moment arm (see torque and inertial moment Wiki Torque) - the longer the moment arm the greater the torque.

$ \tau = R \times F $

That is the reason, in general, that people normally use a single axle because it cancels out one side of the vehicle against the other in a lateral sense. Do you understand?

Reinforce the mounting area on both inside and outside the plastic wall, ideally join it to the structure. I can't guarantee this will solve your problem. The longer you can make that inner axle, the more torque it can dissipate.

Use metal for the axle! Not plastic!


问:
Between which joints does a given DH table row represent?
Say for example

```<code>                          __
         _____           |  |          ____
--------|_____|----------|  |---------|____
                         |__|
</code>```

That ASCII art is supposed to represent a "rolling" revolute joint followed by a "Yawing" revolute joint, followed by the tool frame.

Would the rows in the DH table represent

```<code>BASE-J1
J1-J2
</code>```

Or would they represent

```<code>J1-J2
J2-Tool Frame
</code>```

答:
tl;dr
The rows (I guess you refer a row to a set of 4 DH-parameters) represent, roughly speaking, every link. So it's  BASE-J1, J1-J2, and J2-Tool Frame.

When deriving DH parameters, the base frame usually situates at the robot base, where it is mounted on to floor. This DH convention is a convention that tells you how you put reference frames on a robot. How many frames you need (apart from the base frame) depends on how many joints there are. This corresponds to how many links you have.

So for a 2 degrees-of-freedom (DOF) robot as shown, you would have 3 sets of DH parameters. Each set, consisting of link length, link twist, link offset, and joint angle, describes each link.


答:
There are a few DH convention out there, with main difference the way to chose the first and last frame to consider. Usually the emphasis is put on minimal representation, i.e., minimal number of frame. In my opinion this often leads to parametrization which are a bit more obscure to the user.

The most common DH parametrization would recommend to consider J1-J2 and J2-tool. Because in the end J1 is fixed in a frame, whether in the global frame if the arm is rigidly attached to the environment or a mobile frame if the arm is mounted on a mobile robot. In both cases the base frame of the arm is often irrelevant. Personally I don't agree that much with this approach and would consider an extra frame at the base o the robot, because by experience it's is more intuitive for debug and inverse kinematic. In particular the inverse kinematic is then conducted considering the base frame and not the first joint frame, which I think improves the intuitiveness, e.g. the arm is fixed on a table and should grasp an object on the table you can check easily that the base frame end the end-effector have the same z coordinate, if you consider the first frame in J1 you need to do an additional translation and this get more 'fun' when you attach your arm to the environment with funny configuration like this

Title: Between which joints does a given DH table row represent?

Body:
Say for example

```<code>                          __
         _____           |  |          ____
--------|_____|----------|  |---------|____
                         |__|
</code>```

That ASCII art is supposed to represent a "rolling" revolute joint followed by a "Yawing" revolute joint, followed by the tool frame.

Would the rows in the DH table represent

```<code>BASE-J1
J1-J2
</code>```

Or would they represent

```<code>J1-J2
J2-Tool Frame
</code>```


问:
How to finely control a gear motor with encoder using Arduino/RPi?
I'm having trouble with getting this motor to work and could use some help/guidance, please.  I have a micro gear motor with encoder which I got from ServoCity (https://www.servocity.com/90-rpm-micro-gear-motor-w-encoder) and am trying to use it for a project which will require some fairly accurate movement.  I used a servo before, but it was too loud and too inaccurate for my needs, and burned out after a couple of years.

I haven't yet gotten to the encoder part of the my control (although I intend to use that to mark "top center", eventually) - so right now I'm using an Arduino and a voltage step-up board.  I can make the motor turn by setting the Enable pin on the step-up board to high - however I'm unable to fine-tune the control.  It seems to do a full-spin and stop, no matter how briefly I make the pin high.  Attempting to do this with PWM doesn't seem to help or produce anything.

In my research I haven't found any code specific to this motor, so I don't know if this is a complete limitation of this motor, or if I'm doing something wrong in my approach.

Any help/code/advice you could give would be much appreciated.

Thanks!

答: The motor looks like a regular DC motor with two outputs for feedback from encoder. Looking at the waveform of the encoder output from the datasheet given on the website at https://www.servocity.com/files/index/download/id/1470930141/, it seems to function just like a regular rotary encoder, with two outputs A and B that would tell you the number of pulses recorded by the encoder. Many libraries for Arduino are available for the same, and a very useful tutorial is available at https://playground.arduino.cc/Main/RotaryEncoders. The crux is, you have to connect the hall effect sensor outputs to two pins on your Arduino, and write a simple code to control the position using a feedback loop (the feedback comes from the encoder reading). The encoder is very low resolution though, and you will possibly have to take steps of 30 degrees each. Also make sure you don't supply over 5V to the power pin of the hall sensor VCC and make sure that the ground of Arduino and hall sensor is common. I hope this helps!</p>


问:
Help with adaptive fill algorithm for Water Color Painting Robot
TL;DR:
Can anyone point me to a good adaptive path fill algorithm?

Hey there, my name is James, and my daughter built an awesome painting robot with her friends over at Evil Mad Scientist labs, even brought it to the white house, very fun stuff!

Anyways, I'm a web programmer by day, and though it might be fun to try and write some software to get the robot to do some cool stuff, and for some crazy reason I decided to do this using standard web technologies like SVG and JavaScript, and.. it actually works! [see the project at github.com/techninja/robopaint]

But there's a problem: to fill in colors for given shapes, it requires some kind of path filling algorithm using a given size shape to cover every part of the shape internally, not to mention it has to take into account overlapping paths and occlusions.

I have successfully created "fake" fills, by following known paths like spirals and back and forth hatch lines over paths, while detecting occlusion using browser internal functions for detecting what object lies at a given x/y coordinate, but these fill functions fall incredibly short of doing anything other than simply following paths, and can be incredibly inefficient at filling certain paths (like filling borders, letters, or U shaped areas).

The question: I need an adaptive path filling algorithm. I know they're currently being used in similar CNC setups for milling, and similar algorithms are used by the Roomba and 3D printers to figure out coverage in the most efficient way possible. The issue comes in that I don't think any have ever been done in JavaScript, using native SVG paths.

Anyone out there know where I should look? I'm not too afraid to attempt to port something over to JS, or possibly even use it as is for a native Node.JS module. All my work will be sure to go back to the community and become open source as well.

Thanks for the help!

答:
What you're looking for is a "coverage algorithm".  There are a few relevant questions on this site that address this topic:

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

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


问:
Ignoring yaw for pick and place
I get an object pose from the camera in quaternion. Since these are tetrahedron shaped objects, the robot needs to align the vacuum gripper to one of the sides of the object. But the yaw (rotation along surface normal) can be ignored.

I tried this by converting it to Euler angles, set yaw = 0, and converted back to quaternion. This works in some cases, but for certain cases, the robot picks up at an angle which seems to be 90° rotated.

Do I need to take care for certain cases of Euler angles or is there a better way to do this?

答:
Quaternion are describing a 3D vector and a rotation around this vector, to go from the origin frame to the destination frame. So either you go in direction of quaternion math or you pass through rotation matrix and back to quaternion.
Euler angles are subject to gimbal lock in general it is better to avoid them and use rotation matrix or quaternions.

Note that what you define as zero yaw is a bit ambiguous,What you want is that the arbitrary frame attached by your vision algorithm rotates in order to no ask for a motion of end-effector around the yaw. This is fair, but  in practice is tedious because you need to know with which configuration your EE will arrive to the surface. The best in my opinion is to control only the 3D position and the 2D orientation, you then have a redundant robots (6DOFs for 5) so you can either force the orientation or use redundancy to optimize a criterion. By forcing the orientation I mean that you can requite that the frame attached to the surface has a main axis passing by one of the vertex of the tetrahedron for example. And exploiting the redundancy can be leverage to maximize manipulability indexes or enforce to stay away from joint range limits.

Title: Ignoring yaw for pick and place


问:
Inverse Kinematics problem formulation (optimization)

Note:Q is a diagonal posituve semi-definite matrix

Why is the IK formulation like that?
It looks like it's trying to find the optimum dq/dt that will minimize the magnitude dq/dt. How is that giving IK solution? and isn't the optimum value be dq/dt=0?

EDIT:

答:
The formulation is typical for redundant robots, in which there are an infinite number of joint velocity vectors that could satisfy the $\dot{r}_{t}$ goal.  In the version you cite, the $Q$ matrix would allow you to weight the different joint velocities in order to create an optimal solution that matches that $Q$.  Other formulations of this approach specifically call out the null space of the manipulator Jacobian to be used for satisfying the optimization criteria.

Also, that last equation is inverted to solve for joint velocities, which makes this an approach to inverse kinematics.  With nonsquare Jacobians, pseudoinverses are used for this.


问:
How are units of noise measurement related to units of a sensor's data measurement?
I'm trying to understand how noise is represented for accelerometers, gyroscopes, and magnetometers so that I can match the requirements of my project with the standard specs of these sensors.

I want the output of a 3 axis inertial sensor to be values in meters/sec/sec, gauss, and radians/sec for each axis, and noise to be represented by a range around the true value (so X as in +/- X m/s/s, gauss, and radians/sec) for accelerometers, magnetometers, and gyroscopes respectively. Switching out gauss for teslas, meters for feet, radians for degrees, etc. would all be fine.

After looking at a few datasheets, I'm surprised to find that...

Accelerometer noise is measured in "LSB rms" and "μg/√Hz"(https://www.sparkfun.com/datasheets/Sensors/Accelerometer/ADXL345.pdf, http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Sensors/Accelerometers/MMA8452Q.pdf)

Gyroscope noise is measured in "º/s-rms" and "º/s/√Hz" (https://www.sparkfun.com/datasheets/Sensors/Gyro/PS-ITG-3200-00-01.4.pdf)

Magnetometer noise is measured in "µT rms" and "Gauss/√Hz" (http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Sensors/Magneto/MAG3110.pdf, http://www.vectornav.com/products/vn200-rug?id=54)

What do these units mean, and how do they (or can they) translate into what I want?

答:
"LSB RMS" means the root-mean-squared value of the total noise in least significant bits of the digital channel.  Roughly, that's the standard deviation of the noise times the weight of one step of the digital value.

"$\mu g/\sqrt{Hz}$" means the power spectral density in micro-g's ($1\mu g \simeq 0.0000098  m/s^2$).  If the power spectral density is flat, then you can square this number, multiply it by the bandwidth, take the square root, and get to the noise as LSB RMS.  The power spectral density is useful when you try to figure out the effect of sensor noise on velocity and/or position when integrating.

"$^\circ / s$-rms" has a similar meaning to the "LSB RMS", except the noise is referred to the rate measurement rather than the ADC bits.

"$^\circ /s / \sqrt{Hz}$" is, again, the power spectral density.

It should be obvious at this point what the magnetometer specifications mean.

If you haven't got a background in random processes and signal analysis then you're going to have a rough time relating this back to real-world numbers, particularly if you're doing any kind of sensor fusion.  Even the "big boys" in the sensor fusion game can't easily map sensor noise to system behavior without lots of simulation and head-scratching.

Simpler problems will yield to analysis, however.

ContentLicense: CC BY-SA 4.0


答:
Now that I have investigated the paper in question, here is my new answer.

It turns out that the paper actually discusses task-based motion generation. That is, given a task (end-effector velocity trajectory) $\dot{r}(t)$, find a robot input (joint velocity trajectory) $\dot{q}(t)$ that realizes the task. The formulated optimization problem is happening at a time instant on the trajectory.

So if the Jacobian is square and full-rank, you wouldn't have to worry about this optimization problem since there can be only one $\dot{q}$ corresponding to a given $\dot{r}$. However, when the robot is redundant, there can be infinitely many $\dot{q}$ satisfying $J\dot{q} = \dot{r}$. Now that you have choices, you can do fancier things.

In this case, the minimization objective is $\Vert \dot{q}^TQ\dot{q} \Vert$ to minimize the magnitude of the joint velocity. The reason is simple: one wouldn't want the joint velocity to just go unreasonably high.

So, to really answer your questions

Why is the IK formulation like that?

I think it is just that this formulation is mentioned as an example that leads to the main content of the paper. IK problems don't have to be formulated this way. There are other formulations out there.

How is that giving IK solution?

$\dot{r}$ implicitly specifies the next end-effector pose. A solution $\dot{q}$ implicitly specifies the next IK solution to reach the specified pose.

isn't the optimum value be dq/dt=0?

Without the equality constraint, yes. However, there is this inequality constraint. So $\dot{q}$ can be non-zero.

(Below is my previous answer)

The formulation is general, i.e., it can be used with any types of robots.

I think it may be easier to consider the discrete-time analogy of the problem.

Given an initial point $q$ (i.e., a robot configuration), this optimization problem is actually trying to pull $q$ towards some point $q^\ast$ that is an IK solution to your problem. What is effectively steering the point $q$ towards a solution is the difference $\Delta r$ between your desired end-effector position and your current end-effector position. However, what you control is actually the joint values. They are related by

$$J\Delta q = \Delta r.$$

You can then compute the joint velocity that satisfies the above equation (given the current $\Delta r$). And since $\Delta q$ is essentially the difference of joint values between consecutive time steps, $\Delta q = q[t + \Delta t] - q[t]$, you will obtain a joint value for the next time step.

That's why this is the constraint that is optimization problem is subject to.

At the end, the system should stop moving when it reaches an IK solution. This means $\Delta q$ should be zero. That's why the minimization objective is to minimize a norm of $\dot{q}$.

I think the positive semi-definite matrix $Q$ in the objective function will control how each of the joint values converges to an IK solution. For example, if $Q$ is an identity matrix, it means you place equal importance to each DOF (that is, you do not have any bias in favor of some DOFs to converge faster than the others).

Title: Inverse Kinematics problem formulation (optimization)

Body:
Note:Q is a diagonal posituve semi-definite matrix

Why is the IK formulation like that?
It looks like it's trying to find the optimum dq/dt that will minimize the magnitude dq/dt. How is that giving IK solution? and isn't the optimum value be dq/dt=0?

EDIT:


问:
Connect to e_puck, Could not connect to com3 at 115200 ERROR!
So I have an E-puck robot, and I'm using Tiny Bootloader from this website:
http://www.etc.ugal.ro/cchiculita/software/picbootloader.htm

I've paired the robot up on my laptop's bluetooth. It appears in the devices window on Control Panel (I'm using a Windows 10 laptop BTW with built in blue tooth.), I pair the robot and windows gives me a COM port. So far so good.

I start Tiny Bootloader v1.98 and set it to load a .hex file so I can start making the robot do things. I find and select the right COM port and hit Write Flash.

It gives me the following message:

Could not connect to com3 at 115200
ERROR!

I don't really know what to do next. None of the tutorials I've found regarding the use of the robot say anything about how to handle this. Other people who've experienced problems with Tiny Bootloader have at least managed to connect to their device before they get an error.

答:
It seems to me that the baud rate might not be the one expected by your robot.
Try to force the baudrate of the communication to other standard ones, or look in the doc of the robot if anything is said on the expected baud rate</p>


问:
Pointing at a moving object
I'm a complete novice when it comes to robotics and/or computer vision, so I'm looking for a place to start - simply googling has not located what I want.

I want to build a device that continuously points at a an object that's moving in 3 dimensional space.  Something like a robot shining a laser pointer at a moving quadcopter.

The target can be equipped with some sort of vision enhancement mechanism - LED blinking in a particular pattern, or displaying a particular combination, anything like that.  A closed feedback loop is also possible, but seems much more complicated to implement.

I don't really care if this is done visually or through some other technology (radar?) though for a hobbyist visual seems the cheapest/easiest.

I'm not looking for a product that does this off the shelf - I'm looking for ideas on how to design such a system.

So far, I've not even been able to find what keywords to search on....

Thanks.

答: There are a wide variety of solutions to reach your "object tracking" goal.  Consider using OpenCV and any of its built in methods for tracking objects.  One of which is finding objects based on color.  Color the object different than anything else in the field of view.  Then program OpenCV to find that color and offer up that color's position.  At which point it would be a matter of proper programming for the given platform to send such information to, for example, servo motors to control the camera position.</p>

Title: Pointing at a moving object


答: I don't see the problem here. You just need to pass a metal shaft across the body on the underside. This shaft needs to fit the wheels but I suppose that part is sorted already. To fit the shaft to the body you could buy attachment points or make them yourself (3d print or adapt something, for instance cut a few short lengths from a thin copper pipe as used in a/c systems and attach these to the body using hot glue or even just ties, then pass the shaft through them.) Personally I prefer being inventive.. Hope that helps.</p>

Title: How to simply connect a plastic wheel to plastic body of a robot?

Body:
I have a robot that it's down part is something like this photo: http://www.sanatbazar.com/components/com_jshopping/files/img_products/full_Capture3.JPG .
This chassis has 4motors and 4wheels are connected directly to motors, but my robot only has 2motors and 2 rear wheels are connected to motors directly. And the problem is about forward wheels! I am looking for a simple and cheap(but good) way to connecting them.

As I saw in some toy cars, they used a shaft through 2wheels and connecting them to shaft, but as I have electrical parts inside the body and need smoother movements, I prefer to use another way. I searched about bearings but don't know how to attach them to my chassis?

At the end I should mention my robot has made by 3D printed parts and I can change the down part's design to matching something like bearings.Also the chassis dimension is about 16*16*6 CM^3.

EDIT: These photos are my chassis, wheel and two 3D printed white parts that I wanted to use as connection, but I saw this mechanism is very unstable and wheels slipping:

I can change my chassis design and 3D print it again, but I am looking for a proper design for my purpose. I don't like to pass a shaft trough side holes, because I want to put my electronic board there!

Edit2: I bought a bearing with maintainer as you can see below:

But it's about 2times bigger and heavier than what I want! So the only other option do I have is using this simple bearings, but I don't know how to maintain them to the body:


问:
PID Conundrums for Legged Robots
I am currently working on a legged hexapod which moves around using a tripod gait. I have two sets of code to control the tripod.

Set 1: Time based control

In this code set, I set the tripod motor set to move at their rated rpm for a required amount of time before shifting to the other tripod motor set.

PID control would be based on counting the number of transitions using an optical speed encoder, Calculating the error based on difference between actual speed and required speed and then adjusting the error with fixed Kd and Ki values.

Set 2: Transitions based control

In this code set I count to the number of transitions required to complete one rotation of the leg(tripod motor set) before starting the other leg(tripod motor set).

PID control would be time based. Calculation of error would be the difference in time taken for individual motors of the motor set.

Query:
The set 2 shows promising results even without PID control, but the first set does not.Why so? The motors are basically set to move 1 rotation before the other set moves.

Would the speed differences between the motors cause it to destabilize?

How often do I update the PID loop?

My robot seems to drag a little bit. How do I solve this?

答:
I believe that your set #2 works better because you're already applying feedback to it, in the form of counting transitions of your encoder.

My knee-jerk method to do this control would be to first use quadrature encoders on each motor, to make sure that I was capturing any backwards motion that might mess me up.  Then I would store a time vs. position trajectory that I wanted the motor to follow, which would result in my desired velocity trajectory.  Then I would servo the motors to the desired positions using PID control.

The rule of thumb for control loops that generally works is to sample ten times faster than your desired bandwidth.  That works out to a sampling interval that's ten times shorter than the amount of time you want to allow for your system to settle after it is operating in its linear range (which roughly starts at the last instant that any of the variables come out of saturation).

If your encoders are coarse enough that they don't go through many transitions in your desired control loop sampling interval, you may be better off sampling at the encoder transitions.  This will make your life difficult as the speed changes, but perhaps not as difficult as trying to cope with control loop updates with insufficient information.

Some of the articles linked to here may help, particularly "PID Without a PhD" and the one on operating motors with friction and backlash:
http://www.wescottdesign.com/articles.html

Title: PID Conundrums for Legged Robots


问:
Best way for IROBOT Roomba 960 to "climb" 26mm step
We got a IROBOT Roomba 960 for our new apartment. The apartment has however in one door frame there's a step of about 26mm (roughly 1 inch).

What's the best way for the Roomba to overcome this obstacle. I was thinking about building a small ramp. Is there a better/easier way to achieve this (except for lifting it manually to the other room)? If not, what angle should I use for the ramp, that the Roomba will be able to climb it on it's own?

答: for a different vac robot brand ilife v7 we use a piece of wood (floor panel) which is 8mm thick.</p>


问:
Is there an implementation of this paper? "Inversion Based Direct Position Control and Trajectory Following for Micro Aerial Vehicles"
I read this paper Inversion Based Direct Position Control and Trajectory Following for Micro Aerial Vehicles and despite of google it, I did not found any implementation source. if someone has a link for how it's implemented, I'd be grateful.</p>

答:
I haven't search for that particular method but I'm going to answer this question as a question on how to find if a given algorithm as a public implementation.

There is three steps (that I use) to find a given public implementation, if it exist:

search for it on GitHub. Usually the implementation will be available on GitHub if it's available somewhere. Bonus point if the repo is the one of the lab's university.

The lab's website. This paper was written by a lab that probably has a website and a personal page for each person. You might find the software available here, and the conditions for using it.

Finally, if you haven't found it yet, it's time to directly write to the author to ask if he has an implementation that you could use. Be sure to state what you will be doing with it and why you need it.