答:
In regard to your question about what a configuration space is:

Lets pretend we have a car (which is kinda like a mobile robot).

The C-space can be though of as the locations on the map where there is no collision. But what does that really mean for a  mobile vehicle?

For example if we are traveling 50 mph towards a brick wall and our breaks are out, you can imagine  that at some point it will be too late to turn away from the wall and we will crash into it at some point in the future. So even though the space BEFORE we collided (but after it was too late to turn away) was technically free open space, it was not a free C-space because there was no action we could take at that point which would have avoided a collision.

So what the C-space models is the entire set of valid states of the car, which therefore considers its position, kinematic motion, and steering constraints. These should satisfy some property, like our ability to not crash into the wall. I think the understanding that the C-space is a function of more than just position is an important thing to understand. Because it can be a function of so many things it can be challenging to visualize it in our dimension limited 3D world.

I bet there is some robotics guru who will disagree with my characterization of C-space, and I look forward to learning more from them, but I hope this helps answer the question or spawns at least one productive thought.

Title: What is the idea behind calling configuration space a metric space?

Body:
In my robotics textbook  1 , the configuration space has been defined configuration space the following way:

A configuration space is a metric space compromising of all given configuration of a system.

Then he goes one about how we can define a metric on a configuration space of a system and some other ideas on based on it... I can't understand this at all.

What exactly is the concept of configuration space and secondly what is the idea behind defining distances behind it?

After some quick googling, I understood that a metric space is just a set endowed with a notion of distance but I can't understand how it connects to robotics. What exactly is the idea behind what the author is trying to say here?

 1  Mechanics of Robot Manipualtion, Matthew T. Mason,page-11


问:
Computing attractive and repulsive forces from gradient of Artificial Potential Functions for path-planning
I'm trying to design a controller for a path-planning robot  using Artificial Potnetial Functions [Prof. Howie Choset, Page 6 and 9, $\nabla D(q)$] and had a question about calculating the gradients of the potential functions to generate the force.

From what I understand, the attractive and repulsive force is calculated from the gradient of the attractive and repulsive potentials, i.e. $\nabla f_{a}$ and $\nabla f_{r}$.

$\begin{equation}
f_{r} = \begin{cases} \eta * (1/d(q, q_{o}) - 1/\rho_{o}))^2, && d(q, q_{o}) \leq \rho_{o} \\
0, && d(q, q_{o}) > \rho_{o}
\end{cases}
\tag{1}
\end{equation}$

$\begin{equation}
f_{a} = \epsilon * d(q, q_{g})^2
\tag{2}
\end{equation}$

$q$, $q_{o}$ and $q_{g}$ are the coordinates of location of the agent, nearest obstacle  and the goal respectively. $\rho_{o}$ is the repulsive radius of each obstacle. $d$ is the Euclidean distance.

This gradient operation on each of the potentials in (1), (2), yields an $x$ and a $y$ component, which are the $x$ and the $y$ components of the gradient vector at that point. We then combine all the horizontal components and the vertical components to calculate the angle, $\theta$, of the resultant force $F_{r}$ with the horizontal.

Is this the right approach or am I misinterpretating the $\nabla$ operations? The $X$ and the $Y$ components of the gradient at each point have to be computed seperately and then combined or am I missing something here?

Any and all help is appreciated!

答:
The role of the gradient here is to get vector information from the potential functions and not just a value. You are right in assuming, that you work separately on the X and Y axes, in the sense that the equations are vector and not scalar equations.

The potential function is a differentiable scalar function. Adding the gradient to the scalar function will return a vector and this operation transforms the operations to a vector function. This is not the only affect of the gradient function. The gradient does not only project to axes, but expresses the (partial) derivates, instead of just projections. This effect is very nicely demonstrated on the Wikipedia page of the gradient on this image.

ContentLicense: CC BY-SA 4.0


问:
How to do odometry for 4 mecanum wheeled robot?
I need to do odometry for a 4 mecanum wheeled robot for indoor applications. Is it possible to do it with just wheel encoders and IMU sensors? If possible, how? It will be of great help if someone shares any material. Thanks!</p>

答:
In order to transform encoder signals to robot motions a kinematic model of the robot is needed. In some cases this is very simple, just including the gear ratios and a heading angle (e.g. with Ackerman steering model). This is a simple kinematic model.

A more complex case is differential steering, where the encoder signals pass through a kinematic transformation in order to calculate the heading angle.

The differential drive kinematic model can be a good inspiration to the Mecanum kinematic model. The Mecanum wheel robot will include more encoders (at least 3), since it has more holomonic degrees of freedom. Furthermore, if you have 4 wheels and 4 encoder, care must be taken in the kinematics model, since you have one more sensor then degrees of freedom. You can use this to improve the accuracy of the model, but it will make things a bit more complex.

You take all encoder signals and feed them to a forward kinematic model, which gives you the Cartesian position change (if we consider tick change to be the encoder signal).

After you obtain the Cartesian position change (or other derived signal, like position or velocity) you can use this in any odometry, sensor fusion (with IMU) or SLAM algorithm (with optical sensors).

You can google "4 wheel mecanum kinematic model" and you can find examples on how to implement this.


问:
C space for R5 manipulator
Trying to create a collision avoidance model (RRT) for an RRRRR manipulator. I am unable to wrap my head around how to represent the same in configuration space. Anything upto 3 joint variables is easy to visualize but how do I go about for anything with more variables?

I understand that I need to sample points in C-space and check for collision using forward kinematics. But how do I sample these points if I dont know what the C space looks like (what the x, y or z axis represent - I have only 3 axis's for 5 variables)?

Any explanation or link to reading material would be highly appreciated!

答:
You do not neceserily create an explicit C-Space representation which you sample.

You have to choose, if you want to create your path in axis space or operational space (Cartesian space). This is a design choice and has some influence on the final shape of the trajectory. I am going to assume, that you plan in operational space (Cartesian-like).

You sample the operational space. You select one pose of the TCP with 5 coordinates, e.g. $X_{TCP} = [x, y, z, a, b]$, 3 positions and 2 orientations.

You apply the inverse kinematics to find the position and orientation of the linkages of the robot which sets the TCP to this pose. This starts with finding the axis angles.

$$Q = f^{-1}(X_{TCP})$$
where $Q = [q_1, q_2, q_3, q_5, q_5]$

If you have the axis angles you can build up the transformation matrices for each linkage and position the linkages in the operational space.

The full collision check now can be done. There is no constraint on which method you use, the more accurate the method, the more accurate the results, obviously.

The results of the collision check is binary, collision or now collision. If you get a collision, you know that in the C-Space you sampled a configuration which collides. If not, you sampled a configuration, which did not collide. Essentially, you got the evaluation of the C-Space function

$$ \mathcal{c}_{X_{TCP}} = \mathcal{C}(X_{TCP})$$

As expected this way of sampling is less efficient then creating an actual C-Space function and sampling that explicit function. However, it is expected that creating the explicit function, if possible, will have a large overhead. Something in between is also possible, where the sampling can be sped up by pre-computing different elements which are often required, or caching results which are often sampled.

Title: C space for R5 manipulator


问:
Best microcontroller for develop a robot for the market
I am planning to produce and release a robot to the market and also worked with different platforms for development such as arduino,pic,micropython/python. But now I want to do this professional. I just want to know what will be the best microcontroller to produce a bot for the market. Language will not be a great matter but it's better if python/js is a choice.</p>

答:
Some "robots" can be implemented without any micro-controller at all. When I was a child, I created "robots" by just gluing empty cigarette packs together.

There are other robots which are so complex, that a single micro-controller is not enough at all. So the choice depends highly on the product you want to develop.

For any project, when choosing the micro-controller, at least the following have to taken into consideration:

computational power (including number of cores);

code flash memory;

data flash memory;

volatile / RAM memory;

communication lines (RS232, SPI, CAN, LIN, ...);

other peripherals (ADC, DAC, PWM, timers / counters ...);

price;

while keeping in mind:

the specifics of the project / product;

the price of implementing the same features with external components (price of component + cost of implementation);

others.

So what is the best? The best price, the best computing speed, the easiest development...


问:
How well does object detection transfer from simulation to reality?
I'm looking to learn more about this sim-to-real gap. I'm new to the concept and am trying to understand what to look for. Most notably i'm curious about how well an object detection algorithm trained based on simulation data would transfer over to reality and vice versa. Should I mix the training and test datasets with both sim and real data? How much does the performance differ? Will I be crippling the accuracy of my real object recognition by polluting the training dataset with some simulation data? Looking for some guidance.</p>

答:
Even though it is very interesting, your question is quite broad. I will not cover all the details, but give you an overview.

Also, there are some open questions to your question.

What do you simulate? The entire robot? Only the AI? Only the hardware, with real AI? The target? The rest of the environment? A mix of these? Which mix?

Simulation and reality can be as related or as independent as you want. In "serious" projects, the simulation improves the "reality", and the reality is used to improve the simulation environment. How these are done, depends on the specifics of the project and the genius-ness of the people working on it.

Will I be crippling the accuracy of my real object recognition by polluting the training dataset with some simulation data?

As I mentioned earlier, that is where the genius-ness (or strike of luck) come into play. It depends how you mix and separate the data - you might pollute and destroy, but you might also improve and "educate-to-maturity".


答: Try with the old Raspberry Pi 2, ARM A7 900MHz first. If it is too slow, then you can check ARM R or M microprocessor. If you want to deploy your Python code you need an OS for it. Using Ubuntu on ARM M will be difficult.</p>

Title: Best microcontroller for develop a robot for the market

Body: I am planning to produce and release a robot to the market and also worked with different platforms for development such as arduino,pic,micropython/python. But now I want to do this professional. I just want to know what will be the best microcontroller to produce a bot for the market. Language will not be a great matter but it's better if python/js is a choice.</p>


问:
Resampling attitude states (quaternions, rotation matrix) in a Particle Filter
Suppose I have a particle filter which contains an attitude state (we'll use a unit quaternion from the body to the earth frame for this discussion) $\mathbf{q}_b^e$.

What methods should or should not be used for resampling? Many resampling schemes (e.g. this paper) seem to require the variance to be calculated at some stage, which is not trivial for $SO\{3\}$. Or, the variance is required when performing roughening.

Are there any good papers on resampling attitude states?  Especially those that re-sample complete poses (e.g. position and attitude)?

答:
Most particle filter implementations will use some kind of importance sampling, which does not require you to make an assumption on the underlying distribution. This is one of the main reasons for using a particle filter in the first place. Importance sampling does not sample from the estimated distribution, but from your set of weighted samples.

This includes the ones in your linked paper. All the references to variance in there speak of the variance which is introduced by that particular re-sampling scheme. It is a measure on the quality of the re-sampling, since you do not want to introduce unnecessary uncertainty in your estimate of the true distribution by the particles. You do not need to calculate the variances of your particles for the re-sampling.

On the question which one work best? Your paper has some of the answers. I also made a post on the subject using less maths. In most cases some form of stratified resampling will be better than the multinomial scheme.

The only case I could think of where you would need to calculate the variance of your SO(3) distribution as well would be when you wanted to verify the variance your resampling introduces. In that case, what I would do is to calculate the mean of the orientation (as you said, not trivial), and then use the variance of differences to the mean as scaled axis of rotation representation. But as I said. I don't think you need this.

One word of caution: sampling over the full 6D pose is in most cases not recommended. You need a serious amount of particles for this. Even if you needed only 10 particles per dimension to represent your distribution appropriately - which often is not enough - this could mean that you need up to one million particles in 6D. Lots of memory and processing power...

ContentLicense: CC BY-SA 3.0


答:
i'm curious about how well an object detection algorithm trained based on simulation data would transfer over to reality and vice versa

It depends on how accurately your simulator reflects reality on the metrics that matter.

Will I be crippling the accuracy of my real object recognition by polluting the training dataset with some simulation data?

If your simulator doesn't generate data that accurately reflects reality.

Title: How well does object detection transfer from simulation to reality?

Body: I'm looking to learn more about this sim-to-real gap. I'm new to the concept and am trying to understand what to look for. Most notably i'm curious about how well an object detection algorithm trained based on simulation data would transfer over to reality and vice versa. Should I mix the training and test datasets with both sim and real data? How much does the performance differ? Will I be crippling the accuracy of my real object recognition by polluting the training dataset with some simulation data? Looking for some guidance.</p>


问:
ROS TURTLESIM using PYTHON
In ROS TURTLESIM, While moving the turtle in circle using the linear velocity and angular velocity , how do i track the distance so as to stop the turtle moving after one revolution ??</p>

答:
```<code>$ rosmsg show turtlesim/Pose
</code>```

Get the pose. How are you wanting to know if it did a complete revolution? You could check that the path length is equal to the circumference, or that the rotation angle is back to the start angle, or the horizontal x/y position is the same as the starting position.

Title: ROS TURTLESIM using PYTHON

Body:
$ rosmsg show turtlesim/Pose

Get the pose. How are you wanting to know if it did a complete revolution? You could check that the path length is equal to the circumference, or that the rotation angle is back to the start angle, or the horizontal x/y position is the same as the starting position.


问:
How to implement a four Mecanum wheel robot kinematic model practically in code?

Above is the kinematic model of a four wheeled robot from Omnidirectional Mobile Robot – Design and Implementation.

My question is how to use these kinematic equations while coding on a micro controller? I have an IMU and wheel encoders: How to use these sensor data and achieve odometry for the robot?

答:
I think I figured out, please someone confirm if i'm right

In the above equations, w1, w2, w3 and w4 are taken from the wheel encoders at each time step and (x,y) of the robot are updated as per the equations and using an IMU orientation of the robot is calculated and updated according to the equations at each time step.


答:
There are quite a few ways to go, and opinions vary both by person and by application.

Check out these links to see some examples of this:

https://stackoverflow.com/questions/2137153/does-it-matter-which-microcontroller-to-use-for-1st-time-embed-system-programmer

https://electronics.stackexchange.com/questions/1199/what-are-good-microcontrollers-available-today

What type of application is your robot release?  Industrial? Educational? Smaller home-based? Large non-backdrivable? Developer friendly? Stationary or mobile?

Most large scale, non-backdriveable industrial robots that are mobile use more PCLs and other large Motion Driver power supplies so they aren't always packaged nicely for mobility.

If you're going for a developer friendly robot for your consumer, then a package that uses a raspberry pi or Arduino would be ideal.

C seems to be the go to if you're going for microcontroller programming for embedded systems, so Python and Javascript applications are not very common.  If you decide on a microcontroller, learning C will be the best.

Any choice you pick will also depend on how many input/output pins you might need, power supply choices, and speed/memory etc. virolino mentioned some of these above.

In the end familiarizing yourself well with the documentation manual/data sheet associated for your embedded microcontroller of choice, is always an absolute must.


问:
Trajectory planning in unstructured environments
How is trajectory planning normally carried out in off-road/unstructured environments? In particular I'm interested in how stereo vision can be used to plot trajectories over obstacles - for example, how does one generate ground planes when the environment is extremely rough and the robot is sitting at an angle?</p>

答:
In general, you want to build a 3D map of the environment, or more likely an approximation of a 3D map. Typically such maps are grid-based across the horizontal plane, and each cell contains some additional information like height (see '2D occupancy maps', 'digital elevation models' and '2.5D grid maps' for more information). They often focus on geometric attributes of the environment, but may also include things like appearance (from which you may be able to infer other properties). These types of maps can be created from stereo camera data.

Then in order to be able to path plan you need some way of quantifying how good/bad a given path is. I suggest you look for research around 'traversibility' for various methods of evaluating this for some given terrain but as a basic idea, the 'cost' of traversing (or moving into) some area may be calculated based on its height, gradient, roughness, surface material, difference vs neighbouring areas, some properties in relation to specific vehicle attributes etc.
Once you have a map containing this information, you can apply common path planning techniques e.g. A* on a grid based map.
In rougher or more unstructured environments, there may be more unknown information e.g. the vehicle can't see over a ridge, or behind an obstacle, or its field of view might not include ground that contains holes ('negative obstacle'), so vehicle movement will need to take these into account - both in terms of being able to create a useful and accurate map by observing enough of the environment, and also by avoiding potentially dangerous areas.

for example, how does one generate ground planes when the environment is extremely rough and the robot is sitting at an angle?

To address this specifically, you don't. You can instead use a different approach like the one described above which does not involve ground planes. Though in my (perhaps limited) experience, a lot of rough and unstructured environments featured in robotics research usually aren't really that rough, and often still have significant and relatively flat (compared to the scale of the vehicle) ground planes.


答: write a distance function with the maximum value being the circumference, use rospy's Time function to update distance and whenever the current_distance exceeds the circumference, publish a zero velocity msg to stop the turtle.</p>

Title: ROS TURTLESIM using PYTHON

Body: In ROS TURTLESIM, While moving the turtle in circle using the linear velocity and angular velocity , how do i track the distance so as to stop the turtle moving after one revolution ??</p>


问:
Determining Base Configuration Tsb from End-Effector Configuration Tse for youbot
Hello there, hope you are doing great.

Right now I am trying to control youbot to pick and cube and place it to a certain position, on simulation. However, I believe that the reference trajectory is very prone to singularities. Because of that, I am trying to create a reference trajectory that does not contain singularity possibilities.

I am trying on new initial end-effector configurations for the youbot. However I need to extract Tsb matrix (base frame relative to space frame) from the Tse (end-effector frame, relative to space frame) matrix. Because, in order to tune my PI gains, I need to start the robot with 0 error. How can I manage to do that? For example to get Tse from Tsb I do this:

Tse = Tsb * Tb0 (which has a fixed value) * T0e (comes from Forward Kinematics)

答:
Do I understand correctly, that the problem is with the matrix equation you have posted and how to calculate $T_{sb}$ from that equation?
You can solve the matrix equation by multiplying from the right with the inverse of the last matrix on the rhs, step by step.

$$\require{cancel} $$

$$T_{se} = T_{sb} \times T_{b0} \times T_{0e}$$

$$T_{se} \times T_{0e}^{-1}= T_{sb} \times T_{b0} \times T_{0e} \times T_{0e}^{-1}$$

$$T_{se} \times T_{0e}^{-1}= T_{sb} \times T_{b0} \times \cancel{ T_{0e} \times T_{0e}^{-1}}$$

$$T_{se} \times T_{0e}^{-1}= T_{sb} \times T_{b0}$$

$$T_{se} \times T_{0e}^{-1} \times T_{b0}^{-1}= T_{sb} \times T_{b0} \times T_{b0}^{-1}$$

$$T_{se} \times T_{0e}^{-1} \times T_{b0}^{-1}= T_{sb} \times \cancel{T_{b0} \times T_{b0}^{-1}}$$

$$T_{se} \times T_{0e}^{-1} \times T_{b0}^{-1}= T_{sb}$$

$$T_{sb} = T_{se} \times T_{0e}^{-1} \times T_{b0}^{-1}$$


问:
Hector SLAM, Matching algorithm
I'm trying to understand the scan-matching part of Hector SLAM (PPT summary). It seems a little difficult to understand, in some cases, how is it possible to actually perform the alignment of the scans. Can anyone explain about it?

In my case, I'm working with a simulation. I'm moving my robot in a corridor-like featureless environment (only two walls) and I don't get a map. Nevertheless, if I move in a sinewave motion, I'm able to get a map. Moreover, if I have an additional feature, the algorithm even shows the real path as long as this feature is seen (right part of the image), otherwise it shows a very weird-looking oscillatory path which does not resemble a sinewave at all. Something important to notice is that the width of the map is pretty accurate (real=4m, map's=4.014m), and the length of the movement is also somehow accurate (real=15m, map's= 15.47). I'm using a Hokuyo URG-04LX laser range finder, no odometry, no IMU. I'm running in Ubuntu 14.04 and using ROS Indigo.

I more or less understand how Hector works, but I have no idea about why I'm getting this map and specially trajectory.

Thank you.

答:
The core part of the HectorSLAM is in the file hector_slam/hector_mapping/include/hector_slam_lib/matcher/ScanMatcher.h and hector_slam/hector_mapping/include/hector_slam_lib/map/OccGridMapUtil.h.

The implementation of the scan matching in HectorSLAM uses the maximum likelihood estimator (MLE), which is implemented in the function estimateTransformationLogLh. LogLh stands for log likelihood function. This video explains the MLE very good: https://www.youtube.com/watch?v=XepXtl9YKwc.

The Hessian derivative matrix is calculated in the function getCompleteHessianDerivs which represents the formula (13) in the paper.

Title: Hector SLAM, Matching algorithm


问:
Which scan matching algorithm can be used to extract the moving objects (in 2D lidar scanner)?
There are different types of scan matching algorithms to match consecutive 2D lidar scans, see https://youtu.be/nvFcN2-NqRc?t=421 (ICP, correlative matching, RANSAC). Most of the algorithms return the estimated robot pose as a result.
From the intuition, if we can match the data points, we shall extract the points that don't match. These outliers after the scan matching can be the dynamic objects which can be filtered again.

Update:
My concrete question, during a robot motion, how can I extract the unmatched measurement points from two consecutive lidar scan, after a scan-matching pre-processing? This question is of course depends on the utilized scan-matching algorithm.

答:
I think I understand the problem more now, after your comment about ICP.

Iterative Closest Point (ICP) doesn't exactly match a point or some subset of points, or even features. ICP finds the pose that minimizes the total error.

What you would need to do is to define some threshold where you would consider points to be matched or unmatched. Then, you have a scan1, a scan2, and your scan matching algorithm returns a pose that minimizes error.

Apply your pose to scan 2, such that your scan1 and scan2 sets are "aligned," then run a nearest-neighbor search between the scan sets. Neighbor distances falling below the threshold are "matched," so you remove those, and what's left is then the data you're looking for.

I think this question is a bit more on-topic now because it seems to get at the heart of what ICP is doing, which again is to minimize RMS error across the entire dataset.


问:
Servo horn dimensions - What is 25T?
I wonder that horns for servos are marked in some T units. Example: 25T

Please help me getting out, what does it mean.

答:
The T indicates the number of teeth or ridges in the servo spline. You need to match the servo spline to any device splines or they won't mate.

:EDIT: Because it's a good link, and because I hate it when links to resources rot, I figured I'd duplicate the information here from the excellent Servo City:

Servo Splines

Servos have an output shaft that typically uses a splined profile in order to transfer the torque from the output shaft into the servo attachment that is fastened to it.  This splined profile is typically classified by the number of teeth, however, there is potential for two very different servo splines to have the same tooth count as it doesn't capture the spline diameter or tooth profile.  For example, A15T and D15T both have 15 teeth, however the D15T is a much larger spline size than the A15T.  The graphics below are loose representations of the common spline sizes that are found on hobby servos.  If you have a servo that we do not offer on the site, you can check to see if your servo has a spline that matches any of the below spline profiles by counting the teeth and measuring the distance across the spline.

Title: Servo horn dimensions - What is 25T?


答: In recommend, some version of a raspberry pi. It is based on a Linux interface, and this allows you to program in any language you please</p>


问:
Communication method between drone swarm members
I am a doing my FYP in drone swarm anti collision algorithm.

The project aims to develop an algorithm to fly a minimum of 3 drones and here are the requirements:

1-the drones can identify the position of the other swarm members and keep a distance (anti collision) between them and the adjacent drone.

The drones are to fly in different orientations like a horizontal formation or a vertical one.

The drones are to fly together as a swarm and either maintain the flight formation during the flight
or reposition after reaching destination.

The swarm is to adjust the distance between its members autonomously as in (every drone calculates
the distance to its neighboring drone and plan its action position itself accordingly based on a
preprogrammed distance

I just started and my first step is to find a method for each drone to calculate the distance between it and the next drone.
I have been doing research and I found out that (Ad-hoc networking) gives the ability to calculate the distance between two nodes using the strength of the Wi-Fi signal. However, I could not find a proper research paper to identify how to use that system in a drone swarm and how to obtain the data to be used in the calculations.

so my question is: Is using ad-hoc network the way to go in this project or is there a better method?
and in addition, how to actually implement it n a drone swarm, i.e. what type of sensors to use?

To emphasize it more, what is the best reasonable method for a drone swarm to have the ability to locate its members and measure/keep a distance between its members?

Additional information about my project:

The project aims to implement the algorithm in a real 3 drone swarm system. However, due to budget issues the project might end up being only a simulation.

There are a lot of missing variables in the information I provided , such as: how to control each swarm (each drone individually or leader/follower method), what type of drone/controller/autopilot to use, and other things I can't think of yet. However, my concern at the moment is to identify the method for the swarm to keep a certain distance between them thus having some sort of method to locate each drone in position and distance from the adjacent drone.

I will have more follow up questions as I proceed in the project

I am doing Final year Mechatronics Engineering

答:
It is widely known that in many (most) living societies (human, animal, marine...), individuals prefer to be parts of teams, which inherently have leaders.

In the case of your project, the situation is similar. The leader dictates most of the (flight and mission) parameters for the swarm. The followers:

make sure to stay within a certain range from the leader;

will make sure to not collide with other team members, or with the environment.

With a minimal effort, you can build redundancy within the swarm, so in case a drone fails to be a leader, another drone will automatically take leadership.

About the technical way to measure the relative positions, I cannot really help right now.

Comment: maybe the easiest would be to have GPS sensors on the drones - the kind of sensors that are synchronized AND of high precision. Unfortunately, they would be expensive beyond any reasonable budget.


答:
Short answer: At first, a motion capture recording of the robot is created. Secondly, the recording is converted into a task model.

Long answer: A human operator is the natural source for providing high quality control signals. A well trained operator is able to let the robot solve difficult situations. The only problem is, that the actions of a human operator are not formalized in software code, so that a planner can't use the existing heuristics. To solve the issue, a motion capture device is used which records a set of features including the actions of the human operator. This recording is converted into a prediction model which can be used by a motion solver autonomously.

Title: Trajectory planning in unstructured environments

Body: How is trajectory planning normally carried out in off-road/unstructured environments? In particular I'm interested in how stereo vision can be used to plot trajectories over obstacles - for example, how does one generate ground planes when the environment is extremely rough and the robot is sitting at an angle?</p>


问:
Quadcopter PID Controller for distance
I am trying to use a PID controller to stop a quadcopter at a specific location while travelling horizontally, however currently it overshoots/undershoots depending on the max velocity. I have tried manually tuning the P,I and D gains with limited success. Essentially the velocity needs to go from maxSpeed to 0 at the very end of the flight path.

It uses the DJI SDK so the inputs to the quadcopter are very simplistic, the pitch input to the quadcopter is in m/s and I recalculate the distance(m) to the target on each iteration.

I run a loop that executes every 0.1 of a second. Some pseudo code:

```<code>kP = 0.25
kI = 0.50
kD = 90
timeStep = 0.1
maxSpeed = 10

currentError = initialDistanceToLocation - currentDistanceToLocation
derivativeError = (currentError - previousError) / timeStep
previousError = currentError
output = kP * currentError + kI * integralError + kD * derivativeError
integralError = integralError + currentError * timeStep

if >= maxSpeed {
    output = maxSpeed
} else if output <= 0 {
    output = 0
}
return output
</code>```

Is there a way to reliably tune this PID controller to this system that will work for different max velocities, or is it too simplistic and there are other factors I need to consider?

答: If you want to work with higher velocities, you need to look into velocity controller as well. You can also try incorporating velocity control into your control system. It enables smooth stopping to point which can alleviate your problem. But a generic PID controller with just position control should not overshoot too much if tuned correctly and the maximum velocities aren't too high.</p>

Title: Quadcopter PID Controller for distance


问:
where can i learn electronics from intro to advance digital
I'd like some well put video series of like 30 videos. Or anything but it needs to thorough and in easy English...less mundane. So far all resources i have found either go upto resistors code or of projects that tell you do this and this and this and tada you got this.

Is there really no online resource for people to learn electronics. I want further master analog and do move on to digital cause it's better to spend 0.40 cents.... than
 spend $95 on components and get the whole thing on tiny chip.

Please bare with me like six months i have been searching for legit source, material that is meant to teach you. I like pictures and colors.

答:
MOOCS are so popular nowadays, that I'm not sure you haven't check it out. Anyway, let's give it a shot.

Please, have a look at this courses:

edx.org

https://www.edx.org/course-list/allschools/electronics/allcourses

www.coursera.org

You can also check out www.coursera.org. it's similar to mentioned above.

MIT OpenCourseware

And last but not least, you can also try to find something here:
MIT OpenCourseware electronics

UPDATE: Also, there's a site with all MOOCS in one place: class-central.com


问:
Do IMU have value in SLAM?
IMU are often used in theoretical models involving SLAM.

I'm a bit confused on their practical value since error accumulation is so bad that after a couple seconds you need to completely ignore it.

What is the reason to use and IMU and when should they be used?

More generally, how do you handle the horrible accumulation of error making the item essentially useless for localization?

答:
IMU's are extremely useful in SLAM.

Here is just a basic list of some of the benefits/uses.

Provides an initial guess on pose for optimization methods.

Helps filter out outliers for computer vision feature matching.

Provides scale in monocular slam.

Provides global pitch and roll estimates.

Works much better for Kalman filters prediction then a basic velocity model.

Only sensor that can reliably work everywhere.(Cameras need lighting, GPS needs a connection, LIDAR problems with reflections and rain)

An easy source of angular velocity which is useful for getting rid of motion blur in cameras and LIDAR.

Scenario identification: In car odometry it can help detect when the wheels are slipping.

And more that I can't think of the moment.

When should they be used?

Always. You should never have a sensing platform/robot without an IMU.

More generally, how do you handle the horrible accumulation of error
making the item essentially useless for localization?

You always have to pair it with a sensor that is more accurate in the long term. LIDAR,GPS, Cameras, are all viable options. The IMU is there to estimate the pose in the short time between these other measurements.

Also if your motion model is good for something like a car then you can also get some really good estimates. Take a look at https://github.com/mbrossar/ai-imu-dr. The results with purely an IMU is on par with several state of the art SLAM methods.

Title: Do IMU have value in SLAM?


问:
Does 6DOF robot arm + linear rail = 7DOF arm?
Assume we have a 6DOF manipulator, take UR5 as an example. Does adding a linear rail, on which the robot sits, add a 7th DOF to the system, making it equivalent to a 7DOF manipulator? Any caveats?</p>

答:
You are correct.
Adding an external axis results in 6+1=7 DOF.

Caveats...the same as for any redundant system

solving IK requires a more complex approach (and then path/trajectory planning also)

precision/repeatability/accuracy can be affected if the external axis has a worse precision/repeatability//accuracy

same goes for dynamic performance

technical compatibility issues might arise (depending on how the external axis is controlled and what communication protocols are available at the robot controller)


问:
How to compensate for back drive caused by gravity
I have a 24v DC motor with a planetary gear box, Hbridge, and encoder feedback that drives an arduino robot similar to a winch that moves a weight by spooling a strap up and down.  The problem I am having is that the speed is to high in freefall.  I thought I could just apply PWM to the motor in the opposite direction to slow it down, but flipping in1 and in2 on the hbridge causes the motor to stop abruptly as opposed to slowing down to the desired speed.

I think a worm gear would prevent this, but I do not think it is a viable solution due to space/geometric constraints.  I am considering attempting to PWM in1 and in2 in hopes this will have a soft breaking effect, but before I go through all the trouble I was wondering if there is a more traditional solution that I am not aware of.

答:
Yeah, just like you'd PWM to have some kind of variable drive torque between zero and the torque provided by maximum current, you'll PWM to have some kind of variable brake torque between free-wheeling and maximum electric braking.

The only thing to be careful of is that your electric braking power needs somewhere to go, and your power electronics and/or battery might not appreciate the reversed current. Here's a recent question about electric braking where the OP of that question needed to use a brake resistor to dump the power instead of sending it back to the battery.


问:
Error in Pose(): All values are zero for turtlesim/Pose
Here is the program I have written. The function is to make the turtlesim complete one revolution, with a fixed angular velocity and speed.

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

import rospy
from geometry_msgs.msg import Twist
from turtlesim.msg import Pose
from math import *

def pose_callback(msg):
    print(msg.x,msg.y,msg.theta)
    return

def main():

    speed = 10
    angular_vel= 5

    rospy.init_node('turtle_revolve', anonymous=True)
    rate= rospy.Rate(10)
    velocity_publisher = rospy.Publisher('/turtle1/cmd_vel', Twist, queue_size=10)
    vel_msg = Twist()

    rospy.Subscriber("/turtle1/pose", Pose, pose_callback)
    posi = Pose()

#Setting the time of the start of the node to be t1
    t1= rospy.Time.now().to_sec()
#Initial positions x and y
    x = posi.x
    y=  posi.y
    vel_msg.linear.x = speed
    vel_msg.angular.z = angular_vel
    rospy.logwarn(posi.x)
    rospy.logwarn(posi.y)

    while not rospy.is_shutdown():

        velocity_publisher.publish(vel_msg)

#Another time measurement t2 is taken for every iteration

    t2 = rospy.Time.now().to_sec()

# difference in time measurements t1 and t2

    t_diff = t2 - t1

#If the time delay between measurements is greater than 0.5 secs and theta has reached 0 ,
#it means that the circle has been completed

    if (t_diff >0.5  and posi.theta == 0.0 ):

        break

    rospy.logwarn("Completing circle")

if __name__ == '__main__':
    try:
        main()
    except rospy.ROSInterruptException:
        pass

</code>```

Now my reasoning here is that theta will become  zero again when it reaches the initial position and x, y should be equal  to the initial values.
I tried to find out x, y with posi = Pose () , after subscribing to turtle1/Pose . However all  values in posi, i.e x,y, theta etc are  zero. Ive confirmed this with multiple print/logwarn statements that i removed. It seems posi is returning zero values continuosly.

However I have confirmed using rostopic in the terminal that the Pose topic is printing values. Furthermore the pose values are correctly being displayed by the pose_callback function. So the zero values are only in the main function.
Could anyone point out anything wrong in the code ? Why does posi have all values zero all the time ?

Here is the output showing zero in logwarn and proper values for the pose_callback function :

答:
The position values look like they're getting to the callback okay, but then you're not doing anything with them in the callback. I can't see where posi.x or posi.y are defined, but what if instead of:

```<code>def pose_callback(msg):
    print(msg.x,msg.y,msg.theta)
    return
</code>```

you had:

```<code>def pose_callback(msg):
    posi.x = msg.x
    posi.y = msg.y
    print(posi.x,posi.y,msg.theta)
    return
</code>```

Body:
The position values look like they're getting to the callback okay, but then you're not doing anything with them in the callback. I can't see where posi.x or posi.y are defined, but what if instead of:

def pose_callback(msg):
    print(msg.x,msg.y,msg.theta)
    return

you had:

def pose_callback(msg):
    posi.x = msg.x
    posi.y = msg.y
    print(posi.x,posi.y,msg.theta)
    return


问:
How to calculate probability of particle survival for particle filter?
I'm trying to figure out a way that I can calculate the probability that a particle will survive the re-sampling step in the particle filter algorithm.

For the simple case of multinomial re-sampling, I can assume that we can model the process like a Binomial distribution if we only care about one sample/particle.

So if the particle has a weight of w that is also the probability that it will get selected in a step of the re-sampling. So we use 1 - P(k, p, n) where P is the Binomial distribution, k is 0 (we did not select the particle in all our tries), p is equal to w and n is equal to M, the number of particles.

What is the case though in the systematic re-sampling, where the probability of a particle being selected is proportional but not equal to its weight?

答:
Let
$w_1 \dots w_n$ be the weights of $n$ particles, $p_i \triangleq \frac{w_i}{\sum\limits_{j=1}^{n}w_j}, \sum\limits_{j=1}^{n} p_j = 1$, then as you posted, the probability of the $i$th particle surviving in the resampling procedure for multinomial resampling is:
$$
P(Survival_i) = 1 - (1 - p_i)^n
$$

In systematic resampling, one concatenate $p_1 \dots p_n$ as a ring of interval [0,1). First select $\tilde{u} \sim U[0,1)$, and take $n$ points $u_k = \frac{k-1 + \tilde{u}}{n}, k = 0, \dots n-1$ equally spaced $\frac{1}{n}$ apart from each other on that ring, and take the $n$ samples which have partitions $p_i$ covering the $n$ points.

Therefore, if $p_i \geq \frac{1}{n}$, the probability of survival for the $i$th particle is 1. If $p_i < \frac{1}{n}$, the probability of survival depends on $u_k$. Without loss of generality, let's always assume $i=1, p_1 < \frac{1}{n}$, and consider the probability of the first particle not being selected (you can always re-index the particles to see this is valid for all $i$).

In order for the first particle not to be selected, there need to be two equally spaced points $\{u_j, u_{j+1}, | j = 0 \dots n-1\}$ such that $u_j < 0$ and $u_{j+1} > p_1$. The probability of this event happening for $j=0$ is equal to $\frac{1}{n}-p_1$ (consider the ring interval $[1-\frac{1}{n}+p_1, 1)$). The probability of the first particle not to be selected, is a combination of $n$ exclusive events $j=0, \dots n-1$. Therefore the probability of the first particle not selected is $n\times (\frac{1}{n}-p_1) = 1-n p_1$.

Same derivation for other particles $i=1\dots n$.

In conclusion,
$$
P(Survival_i) = 1, \text{if } p_i >= \frac{1}{n}\\
P(Survival_i) = np_i, \text{if } p_i < \frac{1}{n}
$$


问:
What type of rigid body rotation can best be learned by neural networks?
I am training a reinforcement learning network in simulation for a robot which at the current stage learns Euler Angles to rotate the end-effector based on the actual state. The performance is overall not that satisfying. My network architecture is rather small and contains only two hidden layers. So, I would like to know what type of rotations can best be learned by neural networks? Euler Angles, Rotation matrices or Quaternions?

If someone could recommend a publication or paper for this topic, I would be very interested. Thank you for your help!

答:
Every three-dimensional parameterization of rotations has singularity. So even if you would implement the kinematics directly you would still run into trouble for some rotations when using Euler angles (or any other three-dimensional parameterization).

Quaternions, or more accurately unit quaternions, do not have such singularities. Though, do not have a unique parameterization (negating the quaternion would represent the same rotation). However, if you only consider the kinematics then unit quaternions already don't pose any issue in my opinion. So using a three by three rotation matrix would not really simplify the kinematics at the cost of higher over-parameterization. Additionally, unit quaternions are also easier than rotation matrices to "normalize", so ensuring that a four dimensional vector represents a unit quaternion vs that a three by three matrix represents a rotation matrix.


答: The main problem is the continuity of the representation. This paper explains it.</p>

Title: What type of rigid body rotation can best be learned by neural networks?

Body:
I am training a reinforcement learning network in simulation for a robot which at the current stage learns Euler Angles to rotate the end-effector based on the actual state. The performance is overall not that satisfying. My network architecture is rather small and contains only two hidden layers. So, I would like to know what type of rotations can best be learned by neural networks? Euler Angles, Rotation matrices or Quaternions?

If someone could recommend a publication or paper for this topic, I would be very interested. Thank you for your help!


问:
No electric motors can handle being stalled for even short periods of time, even at low power. Is this statement true in all cases?
We were using a regular POLOLU d.c motor whose stall current is 0.36A. We want to use this motor in a robotic hand where the motor will be stalled while holding the object. We are limiting the current at 0.11A because according to datasheet at this current we get the maximum efficiency. Is it safe to do this? I mean stalling it at low currents? If not what can we do to tackle this situation?</p>

答:
Electric motors designed for stall torque can handle stall torque just fine. One giveaway sign of high stall torque motors is forced cooling (cooling with a powered fan and not just a fan mounted passively on the axis of the motor). One of the issued with stalling motors is heat, as the stopped rotor does not facilitate and airflow and the winding are more prone to overheating.

If your motors stall but the maximum specified stall current is not exceeded you will not damage the motor. Please take care as some motors specify more then one maximum stall current, larger ones (if there are more) can only be applied for a limited amount of time.

Efficiency is not directly related to the stall torque, it is safe to apply the maximum continuous stall torque current to the motor for a prolonged time without any damage.


答:
Efficiency is power output divided by power input. Electrical power, your input, is

$$
P = IV \\
$$

Mechanical power, your output, is

$$
P = Fv \\
$$
or
$$
P = \tau \omega \\
$$

that is, force times speed or torque times angular speed. If you are stalled, then your speed is zero. If your speed is zero then your power is zero and your efficiency is zero.

As 50k4 said, you can do whatever the datasheet says you can do. The keyword to look for is continuous. That's what you should be able to safely do, forever, without risk of damage.

Title: No electric motors can handle being stalled for even short periods of time, even at low power. Is this statement true in all cases?

Body: We were using a regular POLOLU d.c motor whose stall current is 0.36A. We want to use this motor in a robotic hand where the motor will be stalled while holding the object. We are limiting the current at 0.11A because according to datasheet at this current we get the maximum efficiency. Is it safe to do this? I mean stalling it at low currents? If not what can we do to tackle this situation?</p>


问:
Forward Kinematics for Two Axis Gimbal Mount
I'm trying to work out the orientation of a block at the end of two axis gimbal. I know the position of the two rotational joints, but would like to calculate the final orientation of the block given the position of the two axis gimbal. Hence I thought calculating the forward kinematics would be an appropriate solution.

The gimbal system I'm trying to calculate the forward kinematics for is shown in the image below.

I've attempted to model the gimbal diagrammatically below.

The Denavit-Hartenberg parameter table I calculate as:

```<code>θ          α          r          d
90         -90        0          0
180 + θ1   90         0          0
180 + θ2   180        0          0
</code>```

I've implemented this in Matlab as:

```<code>clear all;
clc;

inner = 90;
outer = 180;

theta = 90;
alpha = 90;

h01 = DH(theta, alpha);

theta = 180 + outer;
alpha = -90;

h12 = DH(theta, alpha);

theta = 180 + inner;
alpha = 180;

h13 = DH(theta, alpha);

effector = h01*h12*h13;

disp(effector);

 function h = DH(theta, alpha)

    h= [cosd(theta), -sind(theta)*cosd(alpha), sind(theta)*sind(alpha);
        sind(theta), cosd(theta)*cosd(alpha), -cosd(theta)*sind(alpha);
        0,           sind(alpha),              cosd(alpha)];

 end
</code>```

However, I'm getting the wrong answer as if I apply an inner axis rotation of 90 degrees and an outer axis rotation of 180 degrees I should get the identity matrix i.e. my block frame should align with the frame I've set for the base. Can anyone see where I'm going wrong and give some pointers?

答:
To expand on my comment, the last line of your DH table gives the transform between END_EFFECTOR-1 and END_EFFECTOR frames, right? I'm saying instead of <θ2, 0, 0, 0> to have <180+θ2, 180, 0, 0>.

There's no movement between your end effector and the object you're attaching to the end effector, so there's no point in keeping the end effector frame. Dragging it along through all your calculations isn't going to add anything for you.

The other easy alternative is to add an extra line that defines the relationship between the end effector and the object.

:EDIT:

I modified your script a bit to make some visualizations of the frames. I used subplot in Matlab to try to orient the plots to roughly what you've drawn above, and then I could see immediately where you were having trouble. I changed your theta/alpha values to get the frames to match up, and I renamed h13 to h23 because it's the transform between frames 2 and 3, not 1 and 3.

```<code>clear all;
close all;
clc;

inner = 0;
outer = 0;

theta = 90;
alpha = 90;

h01 = DH(theta, alpha);

theta = 180 + outer;
alpha = 90;

h12 = DH(theta, alpha);

theta = 180 + inner;
alpha = 180;

h23 = DH(theta, alpha);

effector = h01*h12*h23;

disp(effector);

x = [1, 0, 0].';
y = [0, 1, 0].';
z = [0, 0, 1].';

viewAZ = 30;
viewEL = 30;
viewSettings = [viewAZ, viewEL];
xMin = -1;
xMax = 1;
yMin = -1;
yMax = 1;
zMin = -1;
zMax = 1;
axisLimits = [xMin, xMax, yMin, yMax, zMin, zMax];

figure(1)
subplot(3,2,5)
plot3([0, x(1)],[0, x(2)],[0, x(3)],'Color',[1 0 0]);
hold on;
plot3([0, y(1)],[0, y(2)],[0, y(3)],'Color',[0 1 0]);
plot3([0, z(1)],[0, z(2)],[0, z(3)],'Color',[0 0 1]);
axis equal;
axis(axisLimits)
view(viewSettings);
title('F0 - Base')

x1 = h01*x;
y1 = h01*y;
z1 = h01*z;

subplot(3,2,3)
plot3([0, x1(1)],[0, x1(2)],[0, x1(3)],'Color',[1 0 0]);
hold on;
plot3([0, y1(1)],[0, y1(2)],[0, y1(3)],'Color',[0 1 0]);
plot3([0, z1(1)],[0, z1(2)],[0, z1(3)],'Color',[0 0 1]);
axis equal;
axis(axisLimits)
view(viewSettings);
title('F1')

x2 = (h01*h12)*x;
y2 = (h01*h12)*y;
z2 = (h01*h12)*z;

subplot(3,2,4)
plot3([0, x2(1)],[0, x2(2)],[0, x2(3)],'Color',[1 0 0]);
hold on;
plot3([0, y2(1)],[0, y2(2)],[0, y2(3)],'Color',[0 1 0]);
plot3([0, z2(1)],[0, z2(2)],[0, z2(3)],'Color',[0 0 1]);
axis equal;
axis(axisLimits)
view(viewSettings);
title('F2')

x3 = (h01*h12*h23)*x;
y3 = (h01*h12*h23)*y;
z3 = (h01*h12*h23)*z;

subplot(3,2,2)
plot3([0, x3(1)],[0, x3(2)],[0, x3(3)],'Color',[1 0 0]);
hold on;
plot3([0, y3(1)],[0, y3(2)],[0, y3(3)],'Color',[0 1 0]);
plot3([0, z3(1)],[0, z3(2)],[0, z3(3)],'Color',[0 0 1]);
axis equal;
axis(axisLimits)
view(viewSettings);
title('F3 - End Effector')

 function h = DH(theta, alpha)

    h= [cosd(theta), -sind(theta)*cosd(alpha), sind(theta)*sind(alpha);
        sind(theta), cosd(theta)*cosd(alpha), -cosd(theta)*sind(alpha);
        0,           sind(alpha),              cosd(alpha)];

 end
</code>```

Body:
To expand on my comment, the last line of your DH table gives the transform between END_EFFECTOR-1 and END_EFFECTOR frames, right? I'm saying instead of <θ2, 0, 0, 0> to have <180+θ2, 180, 0, 0>.

There's no movement between your end effector and the object you're attaching to the end effector, so there's no point in keeping the end effector frame. Dragging it along through all your calculations isn't going to add anything for you.

The other easy alternative is to add an extra line that defines the relationship between the end effector and the object.

:EDIT:

I modified your script a bit to make some visualizations of the frames. I used subplot in Matlab to try to orient the plots to roughly what you've drawn above, and then I could see immediately where you were having trouble. I changed your theta/alpha values to get the frames to match up, and I renamed h13 to h23 because it's the transform between frames 2 and 3, not 1 and 3.

clear all;
close all;
clc;

inner = 0;
outer = 0;

theta = 90;
alpha = 90;

h01 = DH(theta, alpha);

theta = 180 + outer;
alpha = 90;

h12 = DH(theta, alpha);

theta = 180 + inner;
alpha = 180;

h23 = DH(theta, alpha);

effector = h01*h12*h23;

disp(effector);

x = [1, 0, 0].';
y = [0, 1, 0].';
z = [0, 0, 1].';

viewAZ = 30;
viewEL = 30;
viewSettings = [viewAZ, viewEL];
xMin = -1;
xMax = 1;
yMin = -1;
yMax = 1;
zMin = -1;
zMax = 1;
axisLimits = [xMin, xMax, yMin, yMax, zMin, zMax];

figure(1)
subplot(3,2,5)
plot3([0, x(1)],[0, x(2)],[0, x(3)],'Color',[1 0 0]);
hold on;
plot3([0, y(1)],[0, y(2)],[0, y(3)],'Color',[0 1 0]);
plot3([0, z(1)],[0, z(2)],[0, z(3)],'Color',[0 0 1]);
axis equal;
axis(axisLimits)
view(viewSettings);
title('F0 - Base')

x1 = h01*x;
y1 = h01*y;
z1 = h01*z;

subplot(3,2,3)
plot3([0, x1(1)],[0, x1(2)],[0, x1(3)],'Color',[1 0 0]);
hold on;
plot3([0, y1(1)],[0, y1(2)],[0, y1(3)],'Color',[0 1 0]);
plot3([0, z1(1)],[0, z1(2)],[0, z1(3)],'Color',[0 0 1]);
axis equal;
axis(axisLimits)
view(viewSettings);
title('F1')

x2 = (h01*h12)*x;
y2 = (h01*h12)*y;
z2 = (h01*h12)*z;

subplot(3,2,4)
plot3([0, x2(1)],[0, x2(2)],[0, x2(3)],'Color',[1 0 0]);
hold on;
plot3([0, y2(1)],[0, y2(2)],[0, y2(3)],'Color',[0 1 0]);
plot3([0, z2(1)],[0, z2(2)],[0, z2(3)],'Color',[0 0 1]);
axis equal;
axis(axisLimits)
view(viewSettings);
title('F2')

x3 = (h01*h12*h23)*x;
y3 = (h01*h12*h23)*y;
z3 = (h01*h12*h23)*z;

subplot(3,2,2)
plot3([0, x3(1)],[0, x3(2)],[0, x3(3)],'Color',[1 0 0]);
hold on;
plot3([0, y3(1)],[0, y3(2)],[0, y3(3)],'Color',[0 1 0]);
plot3([0, z3(1)],[0, z3(2)],[0, z3(3)],'Color',[0 0 1]);
axis equal;
axis(axisLimits)
view(viewSettings);
title('F3 - End Effector')

 function h = DH(theta, alpha)

    h= [cosd(theta), -sind(theta)*cosd(alpha), sind(theta)*sind(alpha);
        sind(theta), cosd(theta)*cosd(alpha), -cosd(theta)*sind(alpha);
        0,           sind(alpha),              cosd(alpha)];

 end


问:
How to convert torque in oz-in into the weight it can withstand?
I am looking at servos to make a robot claw, and I want to make sure the one i am getting can turn under a specific amount of weight. The servos specify their torque in oz-in. I am not sure how to read this.

What i need to know is, how to I convert oz-in into the specific weight it can withstand in lbs.

答:
If you are not familiar with the unit of measurement:

1 oz-in = 0.00706 Nm

if you are not familiar with torque:

1 Nm torque translates to 1N of force at a radial distance from the shaft of the motor of 1 m. As 1N gravitational force corresponds to an approx. 0.1kg weight, 1 Nm torque can lift* 0.1kg weight 1m away from the shaft, or 1 kg weight 0.1m away from the shaft.

*Lift in this case means that if such weight is attached to the rotor, the rotor would be in equilibrium, less weight then this would start to rotate.


问:
ROS Navigation stack with Omni-wheel robot
I have worked through navigation stack on diff-drive, I'm wondering how to get the stack running on 4 wheeled Omni-wheel robot equipped with Arduino and how to get odometry from 4 wheel encoders

It would be great if you would give me some hints to get it running. I am especially confused how to setup the 4 omni wheel control

答:
It really depends on your robot kinematics (where is the location of the wheels in the robot frame and what type of wheels it have). There are a lot of resources online to get it from the configuration you have or you can even calculate it yourself. Since you got experience with diff drive then you know that you need to compute something like this for the linear velocity in the x axis of the local frame of your diff drive robot:

```<code>vx = radius_wheel* (vel_wheel_left + vel_wheel_right) / distance_between_wheels;
</code>```

when you get the kinematics for an omnidirectional 4 wheels you can also get such an equation to put it in your arduino and send the info to the main robot computer.

An arduino by itself is not powerful enough to run the full nav stack, you would need at least a raspberry pi to work as the main robot computer and the arduino as a low level controller for the motors and read encoders.

You can start by googling kinematics of 4 wheels omnidirectional robot.

Body:
It really depends on your robot kinematics (where is the location of the wheels in the robot frame and what type of wheels it have). There are a lot of resources online to get it from the configuration you have or you can even calculate it yourself. Since you got experience with diff drive then you know that you need to compute something like this for the linear velocity in the x axis of the local frame of your diff drive robot:

vx = radius_wheel* (vel_wheel_left + vel_wheel_right) / distance_between_wheels;

when you get the kinematics for an omnidirectional 4 wheels you can also get such an equation to put it in your arduino and send the info to the main robot computer.

An arduino by itself is not powerful enough to run the full nav stack, you would need at least a raspberry pi to work as the main robot computer and the arduino as a low level controller for the motors and read encoders.

You can start by googling kinematics of 4 wheels omnidirectional robot.


问:
I'm looking for a simplified control scheme for a game-rendered robotic arm
I'm a programmer, but not savvy with robotics (to lay a baseline for my lack of knowledge). I have a game-simulated arm that allows me to set joint angles which it will automatically move the joints to match, unless blocked. Thus this is a very high-level control scheme; I don't need to worry about forces and actuators directly. For my use-case I also needn't concern myself with how fast the arm can react or the servo delay.

What I need to understand is how I translate joint measurements and allowed angles into linear equations / matrices, and then how to plug in the desired end-effector location/orientation to those matrices to get the set of joint angles as an output (or an error if the desired coordinate cannot be reached with the given arm constraints). I know the full answer must be involved and long, involving multiple chapters of a robotics textbook; a high level explanation plus a pointer to freely published resources is all I'm expecting.

答:
If I understand correctly you are not looking for a control scheme, you are tryin to solve the (inverse) kinematics problem.

In robotics, kinematics is preoccupied with motions, disregarding forces. The simplest kinematic problem, which applies in your case is the forward kinematics problem, which can be formulated as:
How to calculate the position and orientation of the end effector ($X$) from the joint angles ($Q$):
$$X = f(Q)$$

Solving this problem is straight forward for serial robots (the kind that you have). Explanation here

The inverse kinematics problem is the opposite of this, how to calculate the joint angles, given the end effector position and orientation:
$$Q = f^{-1}(X)$$

Now this a a bit more complicates then the forward kinematics. there may or may not exist a closed form solution. In your case at the first sight it seems that you will need a numerical solution. You can take a look at Cyclical Coordinate Descent as a simple numerical way to solve the inverse kinematics problem, and advance to more advanced ways to solve it if needed.


问:
3D reconstruction of a moving object from two camera video stream
I have two synchronized video streams of a moving deformable object from two different cameras (same brand/model type) but two different views.

How can I do the 3D reconstruction of this moving object?

The 3D reconstruction needs not be real-time. I already have done the capture and need to do this as a postprocessing step.

A few more details:

My camera is FLIR SC8000 camera which has thermal videography. The current format of video is sfmov (SAF movie) which has 2 bytes (RGB+ count values -as for thermal aspect) and can also be converted to RGB (1 byte per pixel) too in WMV format. I am also able to convert the video stream using th ResearchIR Max+HSDR software to a series of lossless JPEG images that are called Radiometric JPEG (2 bytes per pixel).

答: First you have to use OpenGL to capture images and process fast While the pictures are JPG technology Very slow to process a single frame taking longer Second, anything that is in the frame of the picture must be transformed into waves An example of this Triangle shape Beginning, rows of pixels of the color type are combined from right to left, and the result is a waveform number one Then rows of pixels of color type are combined from top to bottom, and the result is a vector number two Then, router number one and router number two enter the database, and here the program knows that this data is that this is a triangle shape Even if you enter a large or small triangle, the program will tell you that this is the shape of a triangle And so on the rest of the geometric shapes</p>


问:
How to use SLAM generated map to navigate my robot to the destination?
I am trying to understand various SLAM algorithms.

In my case, I need my robot to start from point A and reach point B with maximum accuracy as well as precision for all the cases.

Note that, as the pic below shows, there are'nt walls around for the conventional SLAM methods to vouch for. The square signifies a reference object ( a table for instance). The pic shows a top-view of the cases. I am aware that either of the cases (I, II or III) will need different SLAM instances, each with its own map.

Once I have the map, maybe using ORB SLAM 2. How does one use the map to control the motors of the robot (can be tank bot) such that the map is utilized to get from A to B ?

答:
Once you have a map, you need to use a planning algorithm to get the robot from point A to point B. I'd reccomend reading up on RRT algorithm.

How to go from point A to point B is mostly independent of how you calculate the map and how you position yourself in the map.


问:
How to calculate Inertia tensor?
I'm trying to obtain dynamics of a 4 DOF robot. Firstly, I calculated all Transformation matrices and Jacobians. While solving Lagrangian there is a term I - Inertia tensor . I couldn't understand the formula and how it is applied to a link (Because I couldn't find any example of Finding inertia tensor for a link instead they are explaining with ordinary rectangular bar).
I wanted to know how to find that Inertia tensor matrix ? So please someone help me</p>

答:
You can calculate the inertia tensor for some primitive geometries of a linkage using known formula. Most of these are listed here. If you do not have a regular shape for which you can find the inertia tensor by a simple formula, you need to obtain this through integration (using the generalised formula). As this is not practicable by hand, most CAD programs (e.g. SolidWorks, Invetor) can calculate the inertia tensor for you for a CAD model. Care must be taken:

Make sure that the inertia tensor is expressed in the coordinate system your dynamical model is expecting it to be expressed in. You can change the coordinate system it is expressed in in the CAD program.

Furthermore, care must be taken to make sure the right material (material density) is selected for the model (as this is not required for any other purposes then static/dynamic load and/or deformation calculations it is often neglected leading to incorrect results)

Also, please be advised that due to modelling inaccuracies, the calculated inertia tensor is usually only close to the actual value, it does not exactly equal it. Reasons behind this are modelling inaccuracies (e.g. motors are modelled as a block, instead of a rotor and a stator with exact dimensions, cables, shafts, gearboxes are not modelled correctly, etc.).

Title: How to calculate Inertia tensor?


问:
How to make a quadcopter hover when tilted forward or backward?
is making a quadcopter hover forwards or backwards possible ? The only two ways I can think of making this happen is by using motors to move the rotors in such a way that they are always vertical and adjusting the thrust accordingly , The second one is using nozzles to direct the flow of air such that it's always downwards , Can any of these methods work and what can be the problems with them ?</p>

答:
A quadcopter tilts in order to point its thrust vector in a direction that is not straight up. This creates a horizontal component to the thrust vector that allows the quadcopter to move along a horizontal plane.

If the motors are typical, i.e. rigidly mounted to the frame, and the rotors are typical, i.e. rigidly mounted to the motor, then tilting the quadcopter frame necessarily creates a horizontal thrust component.

The only way to tilt the frame of the quadcopter and have it hover is to re-point the thrust vector to vertical or to counteract the horizontal component of force. You could do this any number of ways, including gimbals on the motors, swashplates on the rotors (like the main rotor of a helicopter), or with a horizontal fan of some kind that would blow contrary to the horizontal thrust generated by the body rotation.

Of course, the easiest and least expensive way to handle this would be to have a payload or subframe with a gimbal and move your payload. Leave the base quadcopter alone and move just whatever you're trying to move.


问:
How to calculate Current for pancake stepper motor - To change in Pronterface
DISCLAIMER: New to electrical engineering topics. I'm a 3d-printing hobbyist. I don't know all the Jargon being used but trying my best to keep up.

PROBLEM

Recently bought a Nema 17 stepper pancake motor to replace the Ender 3 extrusion stepper. It's only used for direct extrusion with a BMG 3/1 gear ratio, which leads me to believe it doesn't need a lot of juice to have it work optimally.

```<code>*Got this from TriangleLab:*
</code>```

https://www.aliexpress.com/item/32768043304.html?spm=a2g0s.9042311.0.0.27424c4d4HQcug

This thin stepper is running very hot. Via pronterface and/or octoprint, I adjusted the "current" from the default ender 3 E850 to E50, using command M906 and saving with M500.

```<code>It is still running hot and TriangleLab hasn't been very forthcoming.
</code>```

NOTE: i'm not sure what "current" is being referred to, amps or voltage. I just followed this youtuber's advice for the adjustment...

Used this guy's method: https://youtu.be/GHUr1a3nXDU

Question

How do I know if the stepper is running TOO hot?
(not sure what the consequences of a hot stepper might be, other than the thing burning out and becoming a fire hazard.)

Is there a calculation that is better than just eyeballing the situation and doing random tweaks?

Any info would be much appreciated.
Thanks in advance.

```<code>**Triangle Lab's Stepper specifications**

NEMA 17

 - 1.8° Step Angle
 - 200 Steps Per Revolution
 - 1.0 Amp
 - per phase 5.1 Ω 5.9mH
 - 21 N/cm Holding Torque
 - 23mm Body
 - 20mm Output Shaft(5mm diameter)(17mm D-Shaped)
</code>```

......

答:
Current is amps. The set of specifications you gave states

1.0 Amp

so as long as your current is <= 1.0 Amp then it doesn't really matter how hot it's getting because the motor is rated for that current.


问:
What's the correct approach to merging of localization and odometry data?
We've got a mobile platform with a source of odometry and an IMU, which are merged in an EKF filter (robot_localization node), producing continuous odom->base_link transform. The robot is also equipped with a lidar, that we use for SLAM. Now, since the robot's pose estimate coming from SLAM has a known covariance, I used a second EKF, merging the odometry, IMU and SLAM pose and producing the map->odom transform. As you can see, I followed the standard approach to use two EKFs, where the first one is merging continuous data and the second all data.

From what I understood, the pose coming from SLAM is not continuous (similary to GPS signal). On the other hand, I noticed that visual odometry is usually considered continuous, thus only one EKF is used. However, the map->odom transform is not static, so the second EKF looks like a good way to update it dynamically.

If we stick with two separate EKFs as mentioned in the beginning, what are the state of the art techniques to take into account the quality of previous position estimates? For example, if the robot starts at a docking station, the initial position is well known and shouldn't be too much affected by the map->odom transform. Or if the initial position has a large covariance, then the ongoing computation could actually improve it.

Thanks for any suggestion or links to articles regarding this topic.

答:
what are the state of the art techniques to take into account the quality of previous position estimates?

The Kalman filter and extended Kalman filter use the measurement and model covariances to balance the "quality" of estimated (model-based) and measured (feedback-based) position estimates.

From the Wikipedia entry on Kalman filters:

$w_k$ is the process noise which is assumed to be drawn from a zero mean multivariate normal distribution, $\mathcal{N}$, with covariance, $Q_k$

$v_k$ is the observation noise which is assumed to be zero mean Gaussian white noise with covariance $R_k$

and from the Wikipedia entry on extended Kalman filters:

$w_k$ and $v_k$ are the process and observation noises which are both assumed to be zero mean multivariate Gaussian noises with covariance $Q_k$ and $R_k$ respectively.

So the covariances are built into the Kalman filter already. It's all taken care of for you :)


问:
RRT algorithm in C++
I want to implement RRT for motion planning of a robotic arm. I searched a lot on the internet to get some sample code of RRT for motion planning, but I didn't get any. Can someone please suggest a good source where I can find RRT implemented in C++ for any type of motion planning.</p>

答:
Here is the minimalistic implementation of RRT for ROS in C++.

Requirements

You should have ROS (latest version) installed on your system

Use Linux OS to install ROS

Link to the repo:- https://github.com/Safire-AI/RRT

Title: RRT algorithm in C++


问:
How to estimate proper heading angle
I obtain the heading or yaw angle from a source which I am not allowed to modify, but when the angle goes more than +180 or -180, it interchanges either from 180 to -180 or the other way around. Any suggestion on how to overcome this drastic angle changes will be appreciated.

Here is the plot of angle changes over time,

Update after @Chuc comment,
Here is what I feel like desired behaviour

答:
Based on your comment:

if I am able to get 0 to 2pi, would be enough as well.

The following code will do it:

```<code>modifiedHeading = SensorOutput();
if(modifiedHeading < 0)
{
    modifiedHeading += 360f;
}
</code>```

But, as I've mentioned previously, you still have the jump discontinuity, but you've moved it from the 359/1 degree range from the 179/-179 degree range.

Title: How to estimate proper heading angle

Body:
Based on your comment:

if I am able to get 0 to 2pi, would be enough as well.

The following code will do it:

modifiedHeading = SensorOutput();
if(modifiedHeading < 0)
{
    modifiedHeading += 360f;
}

But, as I've mentioned previously, you still have the jump discontinuity, but you've moved it from the 359/1 degree range from the 179/-179 degree range.


问:
IR Sensor to detect fast moving object
I have a somewhat specific need for a project I'm building:  I am trying to create a sensor grid of 1.5m height by 2m wide that has to be able to detect objects, ~10cm in diameter,  in potentially high light that are moving a maximum of 185kmh.

I want this grid to be as tight as possible because I want to then build x/y coordinates out of it through triangulation.

I'm looking for help on finding the correct type of sensors I should be using.  I had considered some IR sensors, but experimenting with them I haven't found any that really give me the correct type of distance I'm looking for.

I have also considered ultrasonic sensors, but it looks like they are too slow to really handle anything moving as fast as I'm looking for.

Could I get some help and get pointed in the correct direction to find the type of sensors I'm looking for?

答:
As-is, the question is off-topic, but if I rephrase it as "Is it possible to use multiple IR sensors near each other?" then the answer is no.

IR sensors are the mix of genius and dumb that I love - it does rangefinding by shining a light and measuring the reflection. That's it. You typically wind up needing to calibrate to particular objects, because shape and surface finish will how the light is reflected back at the sensor.

Generally speaking, intensity falls off with $r^2$, because a point source spreads light over an angular swath, so you can get some decent estimates with an IR sensor for most objects.

The issue comes when you put several IR sensors together. You can get a kind of crosstalk if you don't include shields or hoods - some of the light that was emitted by Sensor A is reflected at Sensor B, which then interprets the reflected light as its own and thus registers an object.

You'll have the same issue with sonar, too, for the same reason. Your best option for a situation like this would be to go with a single-sensor solution; a multiplane lidar is doable but very expensive, but a webcam would probably suit your needs at a reasonable cost.

Title: IR Sensor to detect fast moving object


问:
Difference between Single-Query and Multiple Query Algorithms?
I am spending a lot of time in understanding these two concepts, because in several papers that I read, they define them differently, and I do not know exactly what is the meaning of the two different queries.

I understand, from what I read, that single query algorithm, like RRT, they only compute a single path between an starting point and a goal point, and anything else.

However, multiple query algorithms, like PRM, you construct a roadmap, and once you have it, you can query it for multiples paths, I mean, you can select two points (init and goal), and then if you change your opinion you can change these two points with others.

But I do not know if this approach is correct. I  would love that someone can explain me in layman terms.

答:
To understand this concept, you can compare two famous algorithms, Probabilistic Roadmap (PRM) and RRT.

RRT is a single query algorithm. In other words, it can evaluate a single path when two points are selected, i.e., the path between start and goal point. RRT forms a tree-like structure that branches out in all directions sampling and connecting the points(waypoints).

On the other hand, PRM is more like a planner than a typical algorithm. It forms a graph-like structure that spreads but doesn't branch-like RRT. It can be used to find multiple paths/queries from start to goal. The biggest advantage of using PRM is that it retains the graph structure and reuses it every time you select two points. Although RRT guarantees a feasible path but at the expense of optimality.

Hope this helps.


问:
Motion profile and Motion control scheme, how do they interact?
I'm studying motion control and I start with the simplest case, I have to go from A to B in a straight line using a trapezoidal motion profile.

I understand that in a real case, due to the fact that the controller is discrete I need a position/velocity feedback to reach the desidered position with a good accuracy.

Reading some books I found that the most common control scheme is the one below, in which there are a controller for position, velocity and current (torque).

The questions I have is:

-> How can I use the control scheme with a given motion profile (for instance the trapezoidal) ?

I'm sure it's very trivial but I cannot solve.

At the time being, I understand that if I define the desired position for instance B (in the control scheme) I cannot use a custom motion profile but I'm restricted to the one the control system provide. So for instance if I'm in the deceleration stage (of the trapezoidal profile) the position/velocity/acceleration profiles will be provided by the control scheme and not but my needs.

I feel that what I understand is not correct but I don't know why: practically how to merge the two concepts.

答:
These two concepts are complementary and you use them together, the motion profile providing the input to your control scheme. At each time-step the motion profile gives you the reference values for the control loop scheme (and also some feed forward values if needed).

This goes both for the acceleration and the deceleration phases. in both cases, the motion profile is generating the momentarily set-points at each timestep, which your closed loop control schemes tries to follow.

To understand the need for this you have to imagine a scenario where you want to get to point B, within a certain time (let's say 1 second). Your closed loop control loop is tuned for maximum performance, it would take you there in 0.1 seconds. This is when you need the motion profile, keep the closed loop controls at maximum performance but generate the set points accordingly. (In order to make sure the profile is executed smoothly a feed forward term is used at the acceleration and at the velocity level which is added as on offset at the summing blocks at your cascaded loop.)

The profile you have presented is a simple one (the simplest one which sees limited practical use), but this approach, trajectory planning, extended to mutiple axes and multiple waypoints and even higher degree polynomials is the basis for synchronizing high precision (e.g. CNC Machines) motion control. The profile is used to make sure the axes remain geometrically synchronized while moving with the desired on-path velocity.


问:
What capabilities of industrial robots should be improved to use them for the manufacturing of the telescopic conveyors?
New manufacturing facility of telescopic conveyors has been established one Eastern country of European Union. The managers of the facility are very proud that human workforce is their main asset - all is being done by human hands - they are specifically stating that the following jobs are being done by the human hands: welding, painting, assembling. They are stating also that their facility is the most modern one in the world.

It is quite interesting. Welding, painting, assembling are tasks that are already automated in the car manufacturing and are routinely done by the industrial robots. Why such tasks can not be done for the manufacturing of the telescopic conveyors?

One explanation is that car manufacturing is quite defined and immutable process - robots are programmed for the specific model and few specific models. But the conveyors are adapted for each customer separately. But again - today we have so much work about reconfigurable and adaptable manufacturing. Can we establish software defined pipeline which starts with the CAD files for the conveyors designed together with the customer. Then automatic transformation process generates the specific configuration and plans for the industrial robots for this kind of model, then automatic tests and calibration procedures can be run and at the last stage the plans can be uploaded to the robots and the manufacturing executed.

My question is - what prevents the use of industrial robots in the manufacturing of telescopic conveyors and whether the reconfigurable adaptable manufacturing can be used for the automatic reconfiguration of industrial robots for one-off production of the conveyor from the CAD files?

Is this is the process in the future then how near is such future and what are the main challenges for implementation of such process?

p.s. I am not the expert in robotics in manufacturing, but my efforts are around the machine learning, symbolic computation and automated theorem proving and these are the areas which can be used for the processing of the CAD files and for the generation of the production commands from some kind of meta-rules, meta-knowledge. Though I have not tried to implement that, but may be this is the perspective research and commerce area?

答:
So much to unpack. Let's make sure we understand each other.

You said " today we have so much work about reconfigurable and adaptable manufacturing". My understanding is that you are talking about something like a baxter robot. it is easy to place the robot in a new location, and to teach it a new task. Basically a robot that is easily "trained" for a new task. Instead of a programmer coming in and writing code, a non-technical person can (for example) press a button and guide the arms, and the robot will repeat the motion. One thing to remember is that this is a tool with very limited capability.

you said "Can we establish software defined pipeline which starts with the CAD files for the conveyors designed together with the customer. Then automatic transformation process generates the specific configuration and plans for the industrial robots for this kind of model, then automatic tests and calibration procedures can be run and at the last stage the plans can be uploaded to the robots and the manufacturing executed." OK, there is one core idea here that stands in the way: cost. Regardless of the kind of robot you choose, you are talking about an automated system. With enough money, you CAN create what you suggest, it just will cost an insane amount of money to execute. If you were to take that route, you would have to define all the work the robots need to do (screw every nut, put every bolt in place, attach each component, align sensors, install the belt, lace the belt, etc...), then some company would provide the robot hardware, and program it for your application, and give you an interface to the system (ex: build model A, or model B). This would make no business sense due to cost.

Lets do your question piece by piece.

" what prevents the use of industrial robots in the manufacturing of telescopic conveyors?" in short, it's cost:

Telescoping conveyors are low volume production - anytime we are dealing with low volume production, it doesn't make sense to automate. There is no business case for it.

Manufacturing requires high dexterity & mobility - you need to go under the conveyor, and say pull a cable from here to there. You need to install a cable reel under the unit, you need to install bearings, you need to swing one part of the boom into the other, etc... There is so much "variety" of work, that the cost of automation will be crazy expensive and won't make sense.

"can reconfigurable adaptable manufacturing can be used for the automatic reconfiguration of industrial robots for one-off production of the conveyor from the CAD files?" If you have unlimited money, yes. In real practice no. The real key to automation in the real world is having a robot do a task uninterrupted. Say you need to screw a nut. A $40,000 robot that screws one nut, means you paid 40,000 to get that nut screwed. If it screws 1,000,000,000 nuts, then the price per nut is very cheap, and automation makes sense. The issue is that a robot that can screw a nut, cannot simply "change it's job" as it has to be retooled. it needs to exchange it's nut screwing hardware for some other task, and this switch is mechanically complicated, and complicated from a software perspective. Take for example the steps to building an electrical panel for an extending conveyor:

pick parts

place the panel on the work bench

open the door (you need a key)

pull out the backplate hardware (will be floating around)

pull out the backplate

lay out the parts

cut the din rail

put the terminal block on the din rail

cut cable

strip cable

screw cable into terminal

Just here you can see how much variety of tooling a robot would need to have to build a simple control panel. One robot cannot do it all; so you need many robots. Well how many panels you building per year? 20? not enough to justify automation.

"Adaptable automation" is not very practical. In the future as more software is available for "human" like hardware (ex: hands that can screw a nut, AND pick up tools to tighten it), this will become more of a reality, but at present it's not economically feasible.

"Is this is the process in the future" I think so. When robot hardware is on par with human capability, and the software enables the hardware to do things that we people find "easy" like holding and using tools then you will see robots doing more skilled work.

"how near is such future?" I believe about 40 years, or one giant war away.

"and what are the main challenges for implementation of such process?" the software. you can put a robotiq hand on Boston Dynamic's Atlas, but do you think you will be able to code it to use a screw driver like a human? It comes down to software.

If you can get robots to learn, then the hardware is already there. Really expensive at present, but nothing mass production can't fix. The real issue is software.

The reason why doing one-off automation is not done in the real world is because a robot with specific tooling is needed for every one task. and when you break down building a telescoping conveyor there are thousands of tasks, and the cost of hardware to do those tasks doesn't make sense when you have the option to hire people (where one electrician can build a panel on their own).


问:
Quadcopter PID Controller for distance
I am trying to use a PID controller to stop a quadcopter at a specific location while travelling horizontally, however currently it overshoots/undershoots depending on the max velocity. I have tried manually tuning the P,I and D gains with limited success. Essentially the velocity needs to go from maxSpeed to 0 at the very end of the flight path.

It uses the DJI SDK so the inputs to the quadcopter are very simplistic, the pitch input to the quadcopter is in m/s and I recalculate the distance(m) to the target on each iteration.

I run a loop that executes every 0.1 of a second. Some pseudo code:

```<code>kP = 0.25
kI = 0.50
kD = 90
timeStep = 0.1
maxSpeed = 10

currentError = initialDistanceToLocation - currentDistanceToLocation
derivativeError = (currentError - previousError) / timeStep
previousError = currentError
output = kP * currentError + kI * integralError + kD * derivativeError
integralError = integralError + currentError * timeStep

if >= maxSpeed {
    output = maxSpeed
} else if output <= 0 {
    output = 0
}
return output
</code>```

Is there a way to reliably tune this PID controller to this system that will work for different max velocities, or is it too simplistic and there are other factors I need to consider?

答:
The posted sourcecode measures the current system state and then the control action is determined. Even if the calculation is done 10 times per second it is based on a single measurement in the now. The desired behavior to stop the quadcopter smoothly and avoid overshooting is a multi-stage problem. Multi state means, that more than a single decision and measurement are required. In the simplest case, the source code has to be extended with a second input value, so that the equation takes t and t-1 as input.

From an implementation perspective the architecture has a lot of common with using a recurrent neural network and a pid controller together. This helps to improve the quality of the control actions.

Title: Quadcopter PID Controller for distance


问:
Error when "catkin_make" is run
I cloned a gazebo ROS package from https://github.com/YugAjmera/omni3ros_pkg and if I try to do catkin_make,I get the following error.
I am using Gazebo 11 and ROS Noetic and i've made sure to source the shell.

I am new to ROS and Gazebo. It will be helpful if someone help me resolve this, Thanks!

答:
From the error screenshot you posted:

Add the installation prefix of "gazebo" to CMAKE_PREFIX_PATH or set "gazebo_DIR" to a directory containing one of the above files. If "gazebo" provides a separate development package or SDK, be sure it has been installed.

Since you said that you have gazebo installed, do you have the reference set in gazebo_DIR? Find what gazebo_DIR is currently set to, find where the gazeboConfig.cmake or gazebo-config.cmake files are located on your computer, and check that the two directories match.

Title: Error when "catkin_make" is run


问:
How to calculate potential enegy of manipulator?
I'm trying to obtain dynamics of a 4 DOF robot. Firstly, I calculated all Transformation matrices and Jacobians. While solving Lagrangian there is two main things one is kinetic energy and the other is potential energy . The kinetic energy is simplified into D matrix and Coriolis's factor, which to find the gravitational factor in lagrangian method , we need to find the potential energy. My problem is in that potential energy which is equal to P=mgh . I don't know what does that h correspond to and how to find the value of h .
Could some one help me solving this issue ?

答:
The height h is a height relative to some arbitrary baseline. You can set it anywhere you want, but I think typically the easiest way to choose your baseline height is to set zero as the lowest reachable point for your robot. Then all heights are positive and you can have zero kinetic energy when speed is zero and zero potential energy when your arm is at its lowest point.

:EDIT:

Based on your graphic, it looks like $F_1$, your first joint, is at the top, so you've drawn the arm with as low of a reach as it could have. That means the $h=0$ datum should be through the center of the bottom joint (or center of mass of the end effector, but you don't have a Frame 5 $F_5$ depicted):


问:
Reinforcement train butterfly robot in virtual reality?
Suppose I want to train butterfly robot with reinforcement learning. So I need physically correct simulation of aerodynamics and material physics (because butterfly wings should bend etc). Also I physical correctness is more important that speed, so I can leave limulation to work slowly, no need for real time. Also I need GPU usage.

Which software system I need for this like Gazebo, Unreal etc?

答:
Unreal, Unity and other game engines, Gazebo, Mujoco and other Physics engines are good at simulating multi body dynamics. There is no deep conceptual difference between them. You can use whichever you prefer.

Flying is not only multi body dynamics but also fluid dynamics. This is extremely hard to simulate accurately. It is usually done with CFD (Computational Fluid Dynamics). An open source variant for CFD is OpenFoam.

You can create a simplified version, which you can implement in a muli-body dynamics engine and you can create an even more simplified version and write the simplified equations for it.

Depending on the level of accuracy you need, you can choose your simulation. I would recommend starting simple and increasing complexity gradually.


问:
What is the best to track an object and its relative position in field?
I understand this is very conceptual. I am working on a system when I am trying to track the path taken by an object as it moves across a field. Imagine a maze built on roughly the size of a football pitch. I want to be able to track where someone is with a wearable of somekind. What kind of transmitter and receiver can I use? How can I know the relative positioning of these objects from the center of the pitch.

I cannot use camera or image processing for this because of other limitations.

答:
Some potential ideas you could use are:

GPS + IMU

Probably the easiest solution and depending on how much you want to pay you can adjust for accuracy. You just measure the GPS coordinate of the center pitch, and then just do some simple subtraction to get relative pose.

Another advantage of this combination is that it is a simple system to build yourself. The math is also very well known, and you can find multiple open source projects on github.

Transmitter and Receiver Localization + IMU

There are solutions that work with a transmitter and receiver. So you have some sort of device on the object and beacons around the field. If you want to research them I would look up IPS(Indoor Positioning System) Possible options are:

Ultra WideBand(UWB)

Acoustics

Wifi

Bluetooth

Probably the most accurate one of these is UWB.

However, for all of these you probably have to buy a solution. Making your own is not really an option unless you have a lot of time to develop the hardware and software. It could also be quite expensive to have enough beacons to cover the soccer field.

Embed beacons in the field + IMU:

Similar to the transmitter and receiver option. But instead of having a few beacons surrounding the field you have a ton of beacons embedded in the field. When the object passes by the beacon gets triggered. You can improve results using prediction and interpolation.

Possible options for this could be pressure plates or RFID tags.

Problems are somewhat obvious:

Have to actually modify the field.

Object must stay close enough to the beacons. So if it flies above the field then it won't be detected.

For all options you should if possible always have an IMU on the object. That way you can do some sensor fusion to always improve the results.

Regarding which one is best is up to you. I recommend Option 1, and if it doesn't work for some reason then rethink your camera limitation. Options 2/3 are going to require either money or an extraordinary amount of effort.