问:
How do I set all objects in my scene to be aligned with respect to the camera in Unity 3D?
To elaborate further - How do I fix the camera as the origin of the 3D world?

The context is I am trying to create some synthetic image data for a robotics project, and I have the coordinates of the End Effector in the camera frame (basically the position of the object and its orientation in the camera coordinates) How do I set the Unity setup such that if I set the X, Y, Z and rotation of the object in camera coordinates, it recreates the scene?

[Unity 3D]

答:
I think the function you're looking for is TransformPoint(Vector3 position). You can describe something in coordinates that are local to the camera and use the TransformPoint() method to convert from local camera coordinates to world coordinates.

It sounds like you're trying to make a scene to generate some test data, in which case you'll have to have a list of objects you want to arrange and a list of positions and rotations that are local to the camera. You can try maintaining these as separate objects, but you should consider making the "local objects" into a class of its own. You can use a [System.Serializable] tag before the class definition to have the class be able to populate in the editor.

So, for example, you might have:

```<code>[System.Serializable]
public class LocalObject
{
    public GameObject localObject;
    public Vector3 localPosition;
    public void UpdateTransform()
    {
        if(localObject!=null)
        {
            localObject.transform.position = Camera.main.transform.TransformPoint(localPosition);
        }
    }
}
</code>```

So with that code you have a LocalObject that consists of a GameObject and a Vector3 that describes the transform in local coordinates, and then finally a method that will set the position by transforming the location from main camera coordinates to world coordinates via the TransformPoint() command.

Since it's using the [System.Serializable] tag, it can be exposed in the editor, such that you can have something like:

```<code>public class YourScript : MonoBehaviour
{
    public List<LocalObject> localObjects = new List<LocalObject>();
</code>```

Then later, in Start() or Update(), you can iterate through your list and set the positions:

```<code>void Start()
{
    foreach(LocalObject localObject in localObjects)
    {
        localObject.UpdateTransform();
    }
}
</code>```

The rotations relative to the camera is a going to be a little trickier because Unity represents the rotations as quaternions, but I think the approach I would take would be to use the forward, right, and up properties of the Transform as an input for the Quaternion.AngleAxis command, then build a series of quaternions using that command and setting the rotation that way. For example, by modifying the LocalObject class:

```<code>[System.Serializable]
public class LocalObject
{
    public GameObject localObject;
    public Vector3 localPosition;
    public Vector3 localRotation; // new
    private Transform cam = Camera.main.transform; // new, just to make referencing easier
    public void UpdateTransform()
    {
        if(localObject!=null)
        {
            localObject.transform.position = cam.TransformPoint(localPosition);
            Quaternion roll = Quaternion.AngleAxis(localRotation.x, cam.forward); // new
            Quaternion pitch = Quaternion.AngleAxis(localRotation.y, cam.right); // new
            Quaternion yaw = Quaternion.AngleAxis(localRotation.z, cam.up); // new
            localObject.transform.rotation = yaw*pitch*roll; // new
        }
    }
}
</code>```

I think that would do it, but I'm just typing this into the text box here and haven't tried any of this in Unity. Also Unity uses left-handed coordinates with y-axis as up, but I think most people would be most familiar as entering the angles as roll-pitch-yaw and would like yaw to be about the vertical axis, which again is y in Unity, so there might be some sign errors or something in the above, but this should give you a good idea of how to do what you want.

Body:
I think the function you're looking for is TransformPoint(Vector3 position). You can describe something in coordinates that are local to the camera and use the TransformPoint() method to convert from local camera coordinates to world coordinates.

It sounds like you're trying to make a scene to generate some test data, in which case you'll have to have a list of objects you want to arrange and a list of positions and rotations that are local to the camera. You can try maintaining these as separate objects, but you should consider making the "local objects" into a class of its own. You can use a [System.Serializable] tag before the class definition to have the class be able to populate in the editor.

So, for example, you might have:

[System.Serializable]
public class LocalObject
{
    public GameObject localObject;
    public Vector3 localPosition;
    public void UpdateTransform()
    {
        if(localObject!=null)
        {
            localObject.transform.position = Camera.main.transform.TransformPoint(localPosition);
        }
    }
}

So with that code you have a LocalObject that consists of a GameObject and a Vector3 that describes the transform in local coordinates, and then finally a method that will set the position by transforming the location from main camera coordinates to world coordinates via the TransformPoint() command.

Since it's using the [System.Serializable] tag, it can be exposed in the editor, such that you can have something like:

public class YourScript : MonoBehaviour
{
    public List<LocalObject> localObjects = new List<LocalObject>();

Then later, in Start() or Update(), you can iterate through your list and set the positions:

void Start()
{
    foreach(LocalObject localObject in localObjects)
    {
        localObject.UpdateTransform();
    }
}

The rotations relative to the camera is a going to be a little trickier because Unity represents the rotations as quaternions, but I think the approach I would take would be to use the forward, right, and up properties of the Transform as an input for the Quaternion.AngleAxis command, then build a series of quaternions using that command and setting the rotation that way. For example, by modifying the LocalObject class:

[System.Serializable]
public class LocalObject
{
    public GameObject localObject;
    public Vector3 localPosition;
    public Vector3 localRotation; // new
    private Transform cam = Camera.main.transform; // new, just to make referencing easier
    public void UpdateTransform()
    {
        if(localObject!=null)
        {
            localObject.transform.position = cam.TransformPoint(localPosition);
            Quaternion roll = Quaternion.AngleAxis(localRotation.x, cam.forward); // new
            Quaternion pitch = Quaternion.AngleAxis(localRotation.y, cam.right); // new
            Quaternion yaw = Quaternion.AngleAxis(localRotation.z, cam.up); // new
            localObject.transform.rotation = yaw*pitch*roll; // new
        }
    }
}

I think that would do it, but I'm just typing this into the text box here and haven't tried any of this in Unity. Also Unity uses left-handed coordinates with y-axis as up, but I think most people would be most familiar as entering the angles as roll-pitch-yaw and would like yaw to be about the vertical axis, which again is y in Unity, so there might be some sign errors or something in the above, but this should give you a good idea of how to do what you want.


问:
3D template for irobot-create
Does anyone know where I can find the template of the face plate for the Create 2.0?

I would like to print or laser-cut.

答:
This template can be found in a link within https://www.irobotweb.com/-/media/MainSite/PDFs/About/STEM/Create/Create_2_Deco_Cover_Modification.pdf : it's https://www.irobot.com/~/media/mainsite/pdfs/about/stem/create/createdrilltemplate.pdf.

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

ContentLicense: CC BY-SA 4.0

Title: 3D template for irobot-create


问:
Specification calculation for choosing a proper stepper motor for Ball Lead / Screw system
I'm trying to build a motorized stage which moves in one direction as below picture based on this article.

Desired characteristic properties are:
 1. screw length = 150 mm
 2. screw diameter = 14mm
 3. screw pitch = 2mm
 4. linear velocity = 0.15 mm/seconds
 5. load weight = 10Kg

What should I consider to choose a proper stepper motor?

答:
When looking for motors, you usually are trying to figure out specific things with specific requirements.

Holding Torque

Torque at Speed

Resolution (for steppers)

NEMA size

Positional Accuracy vs speed vs torque

Movement Profile

Budget

So we need a little more info about your system.

You're dealing with a 10kg load and your linear vel. is very slow at 0.15mm/sec...which is 9 millimetres / minute.

A good way to start is to look at what power you need to move the load in general...

$$P\text{:=}\frac{F s}{t}$$

Where F is your force, S your movement distance, and t the time you want to move such a load.

$$P=\frac{10kg*9.81m/s^2*0.15m}{1000s}=0.0147 \text{W}$$

So like, basically nothing. You could sit there and calculate more to be more accurate...including frictional torques and inertia torques or worry about step vibration...as each time you 'step' a small vibration comes into the motor rotor, which can translate to your positional accuracy, if thats something important to you, visible here:

There are other things of course, bearing frictions...'stick and slip' problems.

But we'll ignore that for now....back to your system.

So you need less than a watt and you have an rpm of 9/2...

At this point we can go to a company like nanotec and look for a motor.

As an example:

This Nema17 can give out 0.2Nm at very slow speeds at 48V (the red line)...we didn't really calculate what torques you really need and in praxis these motors always seem to achieve a lot less, especially when you start using microsteps to get higher linear resolution. So barring we don't want to do actual math, we just over size everything, and go to a nema23 motor.

So up to a RPM of 100 (you're only doing 4.5...), you're doing 0.8Nm at 48V...Which is simply way oversized, however guaranteed to match your requirements.

What usually seems to happen at the companies I've worked at, is a methodology such as this. Approximate what is needed, and oversize 2x or more whats required and forget about the rest.

Since acceleration and velocity arn't high requirements on your list. I wouldn't bother doing much as far as proper design goes and just buy the largest motor I can afford and be done with it.

However a proper method would go as follows:

How much power is needed to move the load in the required time?

What motor technology is best for this application?

What’s the velocity, reflected inertia, and reflected load at the (gear) motor output shaft
4.Determine the total reflected inertia, JT, back from the load to the leadscrew shaft

Determine the shaft torque needed to accelerate the load inertia

What are the first-approximation power requirements to drive the leadscrew shaft?

What are the final load parameters at the leadscrew input shaft (acting as the gearmotor output shaft)?

Can the drive and power supply meet the requirements of the load?

What is the motor's (estimated) worst-case temperature under load at an ambient temperature of 30°C?

Courtesy of MachineDesign


问:
ROS MoveIt!, virtual joints, planar joints, prismatic joints
I do have a robotic application, where a 7Dof robot arm is mounted on a omnidirectional mobile platform. My overall goal is to get MoveIt! to calculate a sequence of joint movements, such that the robot EEF reaches a desired goal in Cartesian space.

In order to combine a robot platform with a world, the MoveIt! setup assistant lets you assign virtual joints between the "footprint" of the platform and the world it is placed in.

I do have two strategies. Either

select a planar joint as a virtual joint. (What are the degrees of freedom or respectively the joint information that I can gather from this joint)

or

select a fixed joint and add a (prismatic-x -> prismatic-y -> revolute-z) chain to the robot model.

Are there any significant differences (advantages/ disadvantages) to either of the approaches?

答:
I am assuming that what you want is to to move the eef to any pose in the workspace by moving the robot's base.

If this is the case please refer to the Inverse Reachability Module by OpenRave like @ben suggested.

You might also want to check out the ROS package move_base.

ContentLicense: CC BY-SA 3.0


问:
Effiecient computation of coriollis matrix
I want to perform kinodynamic motion planning on a 6DoF hybrid manipulator. I calculated mass matrix, coriollis matrix etc using the lagrangian method. The coriollis matirx was calculated symbolically from the mass matirx using christoffel symbols. But this calculation takes too much time for me. I was wondering if there is any way by which the coriollis matrix may be calculated in a more faster and efficient way? </p>

答:
You can try to do some optimization of your computations. Things you can try

Simplify the expression in your symbolic computation program. In matlab for example this is done with the 'simplify' command.

If you do not need a super high precision then change the variable type to a lower precision. For example change the double type to float, it will go from 64 bits precision to 32 bits precision.

Usually this computations include a lot of sines and cosines computations but most of them are just repeated computations of them. You can do all the sines and cosines computations prior to compute the coriolis matrix. Then your coriolis computation will only be a set of sums and multiplications. I could reduce to almost half the computation time by doing this trick of computing this values first and later just insert them in the matrix.


问:
Inverse Jacobian to find joint angles
I am trying to implement a joint space control with the UR5 in MATLAB/Simulink and have programmed the forward kinematics of the same.
Now, I want to find out the joint angles of the manipulator using the Inverse Jacobian scheme with the following formula:

q˙=inv(J)(q)*ve

I do understand the math around it and have successfully implemented the Jacobian and obtained the matrix.
The problem I am currently facing is how do I use the above stated formula and program in MATLAB to find out the joint angles.

Do I need to use a for loop or something to iterate through each time step?

答:
If u wanna find the joint angle here what can i explain, using task space. If u really wanna using joint space i will explain later.

What u asked for is Resolved Motion Rate Control, here is the step :

Note that im using Euler Angle as representation of end-effector orientation, thus matrix x will contain (in my case for 6 DOF robot):

while matrix q

xinit = Current end-effector pose

xfinal = end-effector pose goal

in order to obtain end-effector pose, just read the book. If i explain here i will rewrite a book. And because im using euler angle, you need to use analytical jacobian.

Trajectory Planning

Make the manipulator move smoothly

xref = xinit + (xfinal-xinit) * CurrentStep/TotalStep

Find derivative

PD Controller

Control the speed

Inverse Jacobian

Find q acceleration

Double Integral

Now we need q for current state

Memory

And repeat this step until Current step reach total step, hope this help

For translational this step should work(just use 3 upper line of jacobian). And if u wanna control the rotational read my post here

The difference between task space and joint space is in task space we use controller to control end effector position (x,y,z,phi,theta,psi). While in joint space we use controller to control every single joint to reach the goal obtained from inverse jacobian.

Note : if you use euler angle as representation, you could get error because gimbal lock. i didnt how to deal with it until this time.

Reference :

Craig, John. J. (2005). Introduction to Robotic : Mechanics and
Control. Pearson Education Inc.

Corke, Peter P. (2017). Robotics, Vision and Control. Springer.

Siciliano, B. (2009). Robotic Modelling, Planning and Contol.
Springer.

Paul, P.R. (1981). Robot Manipulator : Mathematics, Programming,
and Control. MIT.

Title: Inverse Jacobian to find joint angles


问:
Mechanism for changing gears on a bicycle
I'm looking to make an automatically shifting bicycle for my senior design project (along with some additional features TBD). However, I come from an electrical/software background; not a mechanical one. So I need to figure out a decent way to shift gears. I was thinking of leaving the gear system in place as is and using some sort of motor (servo or stepper motor with worm gears) to pull and release the wire cable as needed. However, I have some concerns with this; namely the amount of torque needed to pull the wire and finding something with enough holding torque. Perhaps my best option is to use the trigger shifters on as well and perhaps use a solenoid. My other concern (namely with the worm gear) is that it'll be too slow.

So I would like to pick your brains here for a moment. Thanks

答:
This might be a stupid idea, but wouldn't using a CVT (continuously variable transmission) be easier to control using an electronic system (both from a mechanical and control points of view)?

I'm just not sure how easy it is to build one. I hope this helps! Good luck! :D


问:
How to calculate the mean of an unsymmetric distribution (Particle Filter)
I'm attempting to implement a variant of Monte Carlo localization in a 2D space with obstacles. While the object is moving around the obstacles the particles flow around the obstacle like in images below. But the weighted  mean (arithmetic) of all particles falls outside the distribution on the obstacle. What are other ways of calculating the mean such that the estimate is actually in the distribution outside the obstacle?

(shaded area is non-free space)

答:
The mean itself is precisely defined and there's no alternative definition for it. It simply is what it is.

Instead you need a different summary statistic; in this case something like a mode might be useful but how do you decide which mode to use if your distribution is multi-modal? I haven't worked with this particular application so can't say what others have done. You might be stuck coming up with your own way of deciding what single position should represent the cloud.

Only real advice I can give is in a proper Bayesian framework like this you can often delay collapsing your state to a single position until very late. e.g. for as many calculations as possible consider all particles weighted by their probability.


问:
What is the difference between ROSberry Pi builds?
I went to go install ROS for my Rassberry Pi and found that there are 5 different variants. What is the difference between them and where can I go to learn about these differences for future updates?

Link to the ROSberryPi downloads I'm talking about:
http://wiki.ros.org/ROSberryPi/Setting%20up%20ROS%20on%20RaspberryPi

答: http://wiki.ros.org/ROSberryPi suggests that we should be running ROS Kinetic on all the newer Raspberry Pis since it supports up to Buster with Raspberry Pi 4.</p>


问:
How to build map for unknown environment?
In order to create a map for unknown environment, we have two solutions:

The size of the area should be given (grid-based maps) so simply we create 2D grid and have our robot to move discrete movement each move represent a cell in the grid and as the robot moves we use it sensors to mark this cell as open or close.

The size of the area is not given (feature-based maps) and so we have to find a way to represent the map.

I am here for the second approach, how to store the map as a programmer? What data structure do I need?

I googled it a lot but I could not find the right answer. I found a similar question, How does a robot efficiently store a map it makes?, but I didn't get what I need.

答: You may want to use SLAM for this task. A good start can be ORB-SLAM. It's open source and state-of-the-art. The ORB-SLAM code can give good idea about data structure required to store maps.</p>


问:
What should i do to rebuild robot salto from Berkeley uni as a mechanical engineering undergrad?
What are the main components of robot salto? What are the necessary skills and knowledges to reproduce it?
Also as you can see, i am a mecheng and i want to reproduce this robot as finishing project with some modifications. I think i need to know  raspberry pi, python, gyroscopic effects and being able to use these effects to balance bot in air and while jumping, good biomechanics to give bot a good initial jumping position. What do you think about my initial analysis? Am i in the right path or wrong path or should i just quit because it is too difficult to do?
Thank you community's great people
https://youtu.be/F25EwtCo2dU
https://robotics.sciencemag.org/content/1/1/eaag2048?utm_source=youtube&utm_medium=digital&utm_campaign=vid-wall-jump-bot-9608
https://www.sciencemag.org/news/2016/12/watch-tiny-robot-do-backflip?utm_source=general_public&utm_medium=youtube&utm_campaign=vid-wall-jump-bot-9606</p>

答:
To be blunt. This is probably beyond your ability...and I appraise that solely on the fact you didn't seem to consider any of the maths, design, coding and control theory that go along with your project.

Building robots, like any engineering project, generally doesn't start with building the thing first then letting it sit there for ages because you can't program it or because the parts you choose randomly are too heavy, arn't fast enough, etc etc etc....because you didn't do any kind of research and modeling ahead of time.....

However..That should be a motivator and not a hinderance.

The best way to find out if you can even do the project is to do a virtual version of it. IE Simulation.

Break out your CAD software and design your robot according to what you think might work...you are after all a mecheng. student...use those inertias and masses as data for your simulations.

Break out your matlab or mathematica or maples and do your research and find the equations of motion for the mechanical system you want to model...run simulations design your control model, simulate more, rinse and repeat.

Matlab and mathematica now can produce C code for many different hardware platforms, so you can avoid even having to learn some programming yourself (for the heavy lifting bits atleast)

If you can achieve a model that works in the simulated world, then you can start building one in the real world and find out your simulated one probably won't work!

But you can try again and again...until it does work!

This is the best kind of project to work on, as it's complicated enough to force you to learn many disciplines, but still fun and cheaply made.


问:
Is This A Colour Sensor?

Hi Iam new to robotics and stack exchange and Iam 13 years old,this is a IR sensor, can you tell me that  is this thing have a colour sensor on it?

答:
I believe this is just IR sensor. This sensor wont able to differentiate color between red, green,blue etc. But you can use this sensor to differentiate black line and white floor (in case u wanna build line follower) because if it was white floor it will reflect more infrared transmitted from this device to its photodiode. U can see the infrared by turning on this sensor and look through your phone camera. You will see purple light.

If you wanna sense another color. You need color sensor. Just google it.

Hope this help :)

Title: Is This A Colour Sensor?


问:
Resolved Motion Rate Control, Rotational Part
I'm controlling 6 DOF robot arm based on image processing. Robot arm will grab the object. Below what my system looks

I can control the translational part of robot very well. But i cant control the rotational part. I mean i want the gripper facing down and rotate according angle of the object. Using jacobian equation
\begin{bmatrix}
dq1 \\
... \\
dq6
\end{bmatrix}= J(q)^{-1}\begin{bmatrix}
dx\\
dy\\
dz\\
drx\\
dry\\
drz
\end{bmatrix}

I try using rotational equation from this paper but still no luck, what should i do for rotational part

Note : To generate the jacobian, im using SerialLink.jacob0 from Matlab Robotic Toolbox by Peter Corke

答:
After a long-long research, i finally able to control the rotational part.

First of all, if you wanna control the orientation part you need to determine what kind of representation of orientation you wanna use. Available options :

Two Vector Representation

RPY Angle

Euler Angle

Unit Quarternion

If you use no 1, you only need geometrical jacobian (the original jacobian). I used the euler angle because 6 DOF robot has wrist joint (recommendation from several website). If using RPY and Euler as orientation, we need analytical jacobian. You can find how to calculate orientation error and analytical jacobian from this book

Corke, Peter P. (2017). Robotics, Vision and Control. Springer.

Siciliano, B. (2009). Robotic Modelling, Planning and Contol.
Springer.

Hope this help anyone in future. Feel free to discuss and correct me


答:
If you have a set of $n$ point $p_i$ with $i=1,2,...,n$, its mean is also the minimum of

$$
J(x) = \sum_{i=1}^n \|p_i - x\|_2^2. \tag{1}
$$

In your case instead of using Euclidean norm you could use the length squared of the shortest valid path from point $p_i$ to $x$ as shown in the figure below. Do keep in mind that this would mean that you would have to solve a optimization problem.

In order to find the shortest path from $p_i$ to the current guess for $x$ you might have to do some path finding, for example by using the A* search algorithm.

Title: How to calculate the mean of an unsymmetric distribution (Particle Filter)

Body:
I'm attempting to implement a variant of Monte Carlo localization in a 2D space with obstacles. While the object is moving around the obstacles the particles flow around the obstacle like in images below. But the weighted  mean (arithmetic) of all particles falls outside the distribution on the obstacle. What are other ways of calculating the mean such that the estimate is actually in the distribution outside the obstacle?

(shaded area is non-free space)


问:
Artificial Intelligence and Open source pipeline for automated design, simulation and analysis of robotics systems
I have heard about open source 3D printed robotics projects (https://www.poppy-project.org/en/ is somehow obsolete example). My question is - are there open source holistic/integrated frameworks of automated design, simulation and analysis of such projects? The pipeline of design/simulation/analysis consists of the following steps:

Open source 3D CAD files for the robot are provided;

Special open source processor receives CAD files of structures and generates mathematical expressions of kinematics and dynamics of the robot (e.g. Jacobian matrices and so on), as well as input files for the simulators (like Gazebo, MoveIt or OpenRave);

Standard mathematical software (Mathematica, Matlab or open source GNU Octave) execute standard derivation of the expressions (from point 2) to determine all the necessary results of analysis (like space of reachability, singularities and so on);

Simulators are used to perform simulations or robot in some standard set of environments, e.g., the industrial cells;

Results from the 3. and 4. are provided to the GNU Octave expressions to determine the quality of the 3D CAD design and the numerical parameters of the design are tuned to arrive at the optimal values of numerical parameters (e.g. length of links and so on);

Results from the 3., 4., 5. (i.e. the overall estimate of the quality) are feeded in the Genetic Programming system as the fitness measure and new generation of the 3D CAD design is generated using evolutionary algorithms whose genes encode the 3D CAD design of the robot. Or alternatively the quality measure is used as the reward for the Reinforcement Learning system that learns the optimal structural 3D CAD design of the robot.

Results from the 6. (i.e. automatically improved 3D CAD design) is feeded into step 1. and the improved robotic structure is analysed again.

There is computational creativity research with automatic exploration of the design space. So, one can consider the design space for the 3D CAD project and automatically explore it for finding the design that operates the most efficiently in the predetermined environments (like industrial cells).

From time to time some generation of the 3D CAD robot can be printed out and put into operation for gathering hard data (that can be feeded into improving the simulation process at step 4.) and for reaping the practical and material reward from the effort.

I am not asking to name the particular open source integrated frameworks (if such exists) (however the references would be great) or the open source components for such framework. My question is about the feasibility and possible obstacles for creating such framework?

E.g. step 2. can be quite esoteric - to generate the Jacobians from the 3D designs, but is it really so hard to do that? There is no need for creativity to do this and it is the standard procedure that every student does in their homework.

And then there is problem about integrated representation of the robot? 3D CAD files usually are used for designing single components, like single link or single join or single structure, cover. But what about whole robot? Can similar 3D CAD files be used for the representation of the whole robot and that representation also include motors, sensors, actuators, wiring, computing units and so on. Only such integrated designs are suitable for the step 2 automatic analysis.

Artificial intelligence is developing and that is why we should try to use both the automation of the mathematical analysis of the robot and also the automatic exploration of the designs space using evolutionary programming and reinforcement learning (which works quite nicely in generation of computer arts).

And all this should be open sourced to improve each component.

What is the state of art of such integrated pipelines?

答:
The state of such a pipeline is that it each and every individual point is difficult and such a fully explored pipeline such as your hypothetical one simply doesn't exist and likely won't for many years to come.

Much like in this answer I mentioned that Fuzzy logic and AI things are plastered on everything under the sun or being marketed that way as an end all be all solution to the worlds problems.

They are not.

I feel your question is inherently misinformed about AI's and their use compared to  'classical' design when it comes to mechanical engineering in a non-academical setting.

There are two main things to think about when designing a product or a machine.

Time and Money.

Can your thing be made in a reasonable amount of time and will it break the bank trying to build it?

A companies budget on one or the other will dictate how deep in the modelling hole one will fall.

At this point to simplify one will now decide how to model your system and it will depend on what development tools one already has, how much is already known about said system, and what time frame all of this has to be done in

A machine will often be designed by entire teams of people who only work on their specific fields of expertise...often on only individual parts or subsystems.

Materials (choosing the correct one, finding new ones, etc)

Electronics, programming

Statics, dynamics of full or subsystem simulations

CAD design of parts and their specific requirements such as:

Safety requirements,

Their simulations of individual parts and subsystems,

Stress analysis, most of which have to be chosen (as in decided upon by a person) and designed specifically to follow standards and laws applicable to the local or international regions.

Control of said full or subsystem(s)

Thermodynamics, Fluid dynamics, etc

And extremely important, verification of models with physical experiments and prototypes.

All of this often done in parallel, with constant communication between each of them...and most of these people being experts...and I definitely didn't write down everything.

As a rule of thumb, 'classical' modelling starts from simple and increases in complexity until a sufficient accuracy in your system has been obtained.

If your system is inherently complicated (think chemical plant) such methods rarely work out regardless of how many parameters your ODE(s) has/have and how many engineers you throw at it. In this case AI's can be / will be used to try and model the dynamics of such systems with varying degrees of success.

To list a few examples of failures in training:

Aircraft Landing:

Evolved algorithm for landing aircraft exploited overflow errors in the physics simulator by creating large forces that were estimated to be zero, resulting in a perfect score

Robot Arm

A robotic arm trained to slide a block to a target position on a table achieves the goal by moving the table itself.

Impossible Superposition

Genetic algorithm designed to find low-energy configurations of carbon exploits edge case in the physics model and superimposes all the carbon atoms

To quote the summary of the book "Nonlinear Problems in Machine Design"

Modern machine design challenges engineers with a myriad of nonlinear problems, among them fatigue, friction, plasticity, and excessive deformation. Today's advanced numerical computer programs bring optimal solutions to these complex problems within reach, but not without a trained and experienced overseer.

Engineering and science is inherently hard and even experts in the designing of AI's make massive mistakes...

With all of that said, each one of your points mostly exists in different forms.

Step files and stls are common formats to use for sharing between different programs, open source software such as FreeCAD exists.

I am not aware of a system even capable of finding a dynamical model from a CAD model, as it has not knowledge of the entire system, their limits, boundries, the space(s) they work in, initial conditions, their ideal or non ideal characteristics...etc etc (if someone knows one..I'd like to hear about it)

Yes, Finding the equations of a system can really be that hard...

Standard softwares as you mentioned are commonly in use today for system simulations and automatic optimizations.

Again such softwares exist..simulink, system modeler, mathematica, ANSYS, countless others

5, 6, 7 Are varying in their inter connections, however I can think of Generative Design as an example where this is mostly what you describe as in, define specific boundries, allow automatic design, iterate, retest...rinse and repeat.

AI is certainly great for many things. But it can't be used for everything...nor does it have to be. Many mechanical (sub)systems can be accurately (enough) solved in the 'classic' method quickly and it would be a waste of time and effort to implement AI's....for now anyways...Judgement Day was just delayed after all...


问:
CMA Net - How to export all statistics ? (In Excel/XLS)
On the lower-right of the screen, there is an "Archive" button, from which I go to the dialog box/window where there are Delete, Delete all, Export and Load options, but there is no "Export All" ...

The robot in question is manufactured by:

https://www.cmarobot.it/intelligent_painting_robot/index.php

If I attach a keyboard to the robot computer, can I mark everything by Ctrl + A keyboard combination ? Or maybe with Shift + Arrow up/down... ?

I can provide more photos if necessary.

Thank you.

答:
Solved !

No need to connect a keyboard.

I went to D:\cmafiles\STATS and there is the whole list of files with the working statistics in XLS format. I've copied all of them on my USB Flash memory.

Thank you everyone.


问:
How does structured light improve accuracy in stereo vision?
In my understanding, in order to improve accuracy for the estimation of depth with a stereo vision camera, patterns of light are projected into the scene, because the resulting texture makes it easier to find point correpondances between the pair of stereo images, thus we can triangulate correct pairs of points and produce a dense and accurate depth map. But as far as I know, we can't see this structured light in the images captured by the stereo camera (nor in the scene), so how does a stereo camera make use of structured light in stereo matching?</p>

答:
The majority of sensors using structured light actually use the deformation of the light to compute the 3D depth directly.  They do not use it to augment/improve another depth estimation technique, such as stereo parallax.  By projecting a known pattern the distortions of the pattern can be converted directly into 3D depth information (after matching the features of the structure, not image pixels).  Typically distortions due to the sensor (e.g. lens) are accounted for by calibrating against known surfaces.
Many systems use multiple cameras so that the structure light can be seen even if obstructed from particular angles (and to provide additional sensing).

If you are referring to sensors that use structured light only to improve on depth information of a technique such as stereo imaging, they may work differently (I'm unaware of any).


问:
Can Swedish wheels be used in two wheeler configuration?
Can we use any of the Swedish 90°/45° Omni or Mecanum wheels in two wheeler configurations? </p>

答:
I suppose yes, one could. They are wheels after all.

This mostly depends on other things, such as your design and how you want to move (in actual omnidirection? keeping balancing will be difficult, but it is possible.) ...a wheel is a wheel, regardless of if it's an omnidirectional one or not.

An example of a spherical wheel being used in a two wheel system I've heard of is the omni directional motorcycle.


问:
What is the minimum number of RC channels required to control a Quad Copter?
Most of the blogs/website say we need a minimum of four channels for a quadcopter (pitch, roll, throttle, yaw):

One channel for throttle

A second channel for turning right and left.

A third channel for pitching forward and backward.

A fourth one for rolling left and right.

But looking at the RC transmitter, I see that at a time you can change a maximum of two sets data (left and right joy stick). Even if you want to send Rudder and Throttle information at the same, can it not be sent in the same packet?

My understanding is two channels should be sufficient to control a quad copter. Please provide more clarity on this.

答: I would have thought the control would only need to transmit a single packet on a single channel which gets sent only when the operator changes something.</p>


问:
Should you learn assembly language for robotics?
I ask this since assembly language is really close to the micro-controller hardware, and what micro-controller would you reccomend.

The bot has to search for object that I show it before and then I 'lose' the object. Note, I do not know anything about micro-controllers.

答: It's nice, but for the most part, unnecessary if you're just dealing with robotics. Maybe if you need some high-end optimization, it may be helpful. But most compilers can optimize better than average humans these days anyway. Unless you really know what you're doing and understand the architecture enough to optimize further, I'd say it's not necessary. Plus, different manufactures have their own instruction sets, many of which behave differently on different MCU's. Another thing to cosider is that syntax varies between different MCU's. For instance, AVR MCU's have a different syntax than MIPS architectures and TI DSP's. It all depends on what you're doing.</p>


答:
This started out as a comment but I ran out of space. Also, I am waiting for the question to be clarified, as morbo has requested of the OP.

Here is an example on YouTube, Lego Technic two-wheeled double track tank r/c omni-wheel, although I must say that the wheels do not look particularly omni to me:

Whilst this is not particular to Omni/Mecanum wheels, it is worth noting that a robot with a two wheeled differential drive can achieve stability if the center of mass is below the wheel axle or if there is a third point of contact striking the floor.

Title: Can Swedish wheels be used in two wheeler configuration?

Body: Can we use any of the Swedish 90°/45° Omni or Mecanum wheels in two wheeler configurations? </p>


问:
building a grid map from gps trajectory poses
I am trying to create a feature grid map with

Images from camera mounted to the top of the car.

Novatel ProPak RTK gps poses

Beforehand, I've checked to ensure that the standard deviations of the latitude/longitude (>5cm) and heading (<0.5 degrees). The steps are I tried are as follows

I use CNN based semantic segmentation to extract out pixels which
       are part of road markers (see sample below).

I use the first gps pose as my origin map frame.

Next, I use the calculated height of camera to calculate a
   homography between the image plane and the ground plane.

Finally, I just accumulate the points into cells as the vehicle
   drives around. The second image below shows the map of an outdoor carpark I created.

Question:
I noticed some parts of my map have significant ghosting or are incorrect. See 3rd image below, the stop line is not straight at all. I have notice that thishappens when the vehicle is turning, as is suspicious of 2 reasons:

I do not know if this is due to the transformation between the camera
and the gps being inaccurate,

or that the transformation between camera and ground being
inaccurate.

I seek advice on what I should do next to verify what is the problem, or what should I do to fix these issues.

答:
I came to this question from your other question, but I think the answer is better suited here.

It looks like your GPS only provides position and no heading information, so that would explain why you're noticing more trouble during vehicle turns.

I don't know if you're filtering your GPS data before use, but the GPS datasheet advertises "sub-meter accuracy," and again there's no heading information. I would suggest using a digital compass to get heading information and to use a filter to smooth your GPS signal.

An IMU could be paired with the GPS for even better positioning accuracy, which I think is probably ultimately what your problem boils down to - your transform chain (on the other question) doesn't have any step at which it adjusts rotation.

If you're looking for a way to validate, then try to setup a scenario where you can recreate and eliminate the bug - try to induce ghosting where you haven't seen it (make a U-turn in the middle of a street where you were getting good data) and try to eliminate ghosting where you have seen it (go straight through the stop intersection instead of turning.) If you're able to reliably recreate and stop the problem, then correct it by adding a rotation measurement (compass/IMU).


问:
solving for unknown 2d rotation + translation
This is a continuation of the question I asked here. I thought I'll ask a more concrete question. So far, this is what I have done to transform from a feature point detected by camera sensor in to a map point, where feature is a 2d homogenous vector.

```<code>map_point = T_world_origin.inverse() * T_world_gps * T_gps_camera * feature_point
</code>```

There is significant ghosting on the map, as shown below, and I suspected that T_gps_camera is inaccurate. I wish to solve for T_gps_camera (3x3 homogoenous matrix) analytically, and I arrive at the equation below,

```<code>M * T_world_origin.inverse() * T_world_gps_t * T_gps_camera * feature_point = T_world_origin.inverse() * T_world_gps_t+1 * T_gps_camera * feature_point
</code>```

where M is a 3x3 matrix I have calculated using ICP of the map points at time t and t+1. Following this, how should I use the ICP information I have to solve for T_GPS_camera?

答:
Assuming your camera is rigidly mounted to your vehicle, and that the GPS is also rigidly mounted to the vehicle, then there should be a fixed transform between the GPS and camera.

Your M matrix is the correction that shifts your data between time steps. This should just have to correct some minor white noise, from GPS noise for example. It should be zero mean. If there is some fixed offset that you haven't modeled, then you should notice your M matrix have some non-zero mean.

I would look carefully at your M matrix over time - consider getting the rotation angle from the 2x2 sub-matrix and the x/y offset from the position vector and look at those values, especially as you make turns. As I mentioned in your other question, I think you're missing a rotation sensor and that is affecting your data especially on turns.

If I'm correct, you should see zero-mean noise during straight sections and then some non-zero mean during turns. Once you get the rotation-induced issues worked out (adding a compass, IMU, etc.), then you should go back to seeing zero-mean rotations and offsets during all maneuvers.

If you're seeing some non-zero means during straight sections, then I would take those average values and update your GPS-camera offset accordingly. You could do this on the fly, by using a low-pass filter to update the GPS-camera transform, but I worry that the turns aren't correct at the moment and it shouldn't be necessary because again everything is fixed.

So, tl;dr - use the mean of your M matrix when you're getting good data to adjust your uncertain transform. Monitor the mean of the M matrix to ensure all your data is being transformed well with your known transforms.


问:
IMU outputs data to Arduino Serial Monitor but ROS hangs when waiting for IMU to boot?
I am trying to use an IMU in a robotic car.

Specific IMU: https://learn.sparkfun.com/tutorials/9dof-razor-imu-m0-hookup-guide?_ga=2.87322972.515701132.1562620054-1210936642.1562620054

Specific ROS package: http://wiki.ros.org/razor_imu_9dof

I am able to get the IMU data to an Arduino serial monitor, but cannot get IMU data in ROS.

When I try to roslaunch a launch file for the IMU, it hangs and does not continue at the following output:

[INFO] [1562691381.293220]: Giving the razor IMU board 5 seconds to boot...

The IMU's port is correctly specified and same as port in Arduino IDE.

Does anyone have any possible explanations as to why my roslaunch waits for the IMU to boot when it seemingly works and is booted?

EDITS:

A mentor for the project I am working on said that he uploaded the ROS package firmware to the IMU already, so I believe that is not the issue.

答:
Welcome to Robotics, Ryan. The ROS page you linked has quite a bit of information, and I am hoping you can please edit your question to clarify the steps you've performed from that page.

Specifically, Step 4.2 Load Firmware into Razor Board:

In this step you copy the Razor firmware from the ROS package and build it and load it into the board using the Arduino IDE.

You stated that you're able to get the IMU data to an Arduino serial monitor, but it's not clear how you're doing that. From the Sparkfun tutorial you linked, it looks like the board comes with some pre-loaded example firmware that will work with the Arduino Serial Monitor, but that software is not the ROS software for that device.

Can you please verify which firmware is running? Is it the example firmware that ships with the board or is it the firmware posted in the ROS tutorial?


问:
Determining position from a 2D map and LIDAR
We need to determine the 2D position of my robot. To do so, we have a LIDAR at a known high, with an horizontal plane, which gives us the distance to the nearest point for each angular degree (so 360 points for one rotation). The environment is known, so I have a map of the position of every object that the LIDAR is susceptible to hit.

My question is, based on the scatter plot that the LIDAR is returning, how can we retrieve the position of my robot in the map ? We would need the x, y position in the map frame and also the theta angle from the map frame to my robot frame.

We have tried to match objects on map with groups of points based on their distance between each other and by identifying those objects and the way the LIDAR "sees" them to retrieve the robot position. But it is still unsuccessful.

To put it in a nutshell, we want to make SLAM without the mapping part. How is it possible, and with what kind of algorithms ?

A first step could be to stop the robot while acquiring data if it seems easier to process.

答:
I just wanted add on to both user12895 and AL-ROBOT's answers.

Based on experience:

What you need is an (Iterative Point Cloud) ICP algorithm.

Do not worry, if the robot cannot detect the entire map when it scans with the lidar, you can just match what ever data you capture to a part of the map depending on your current position.

Great work on getting position working quite well with odometry at the moment, along with ICP it will reduce the error in the pose estimation very well.

Not sure what sort of hardware you are using to do all the processing. Because the execution speed of the processing is what matters when it comes to whether you can process the ICP while moving. In the past I have done this with LabVIEW on a myRIO1900 by NI, and the robot was moving at a decent speed. I have heard from my peers that if you write the ICP in c++ you could run it very fast. I have actually witnessed very fast mobile robots doing ICP very reliably. In both cases mentioned above the LIDARS used were Hokuyo Lidars which are decent. Although they only have a FOV of 120 degrees, so if you cannot find one that has a FOV of 360 degrees. I recommend using two, one at the front and one at the back HOKUYO Lidars.


问:
Strafing of Mecanum wheels
I am part of my college robotics team. We are participating in Robocon 2014 and are thinking about using mecanum wheels. We have done our research but one thing id like to clarify is: Does the number of rollers in the mecanum wheel effect its strafing? if yes then how?</p>

答:
No, the number of wheels does not affect its strafing. Strafing is affected only by the angle of the rollers relative to the wheels, and you shouldn't need to worry about that for standard mecanums. The reason for this is that as your robot moves (let's assume constant velocity), the wheels spin; as they spin, the same velocity is on a different part of the wheel, which continues to spin freely. No net effect, besides a minor bump, will occur from rolling a wheel forward.

Of course, everything with a limit. The number of rollers will affect the bumpiness of the movements. The more rollers, the less vibration your frame will undergo. Obviously, for instance, four rollers won't work. However, again, most commercial mecanums have at least enough for decent smoothness.

Title: Strafing of Mecanum wheels


问:
e6 Stock to Create Platform?
Can a new iRobot Roomba e6 (WiFi enabled, scheduling robot) be hacked like the iRobot Create, while allowing it to do a bit of vacuuming during non programming time?</p>

答:
I think turning a roomba 980 into a create may answer your question; at this time, only 5xx - 8xx series are compatible with the Create 2 Open Interface.
Please note that I am an iRobot employee, but the postings on this site are my own and don't necessarily represent iRobot's positions, strategies, or opinions.

Title: e6 Stock to Create Platform?


问:
How to get a wired live feed from camera to phone
I need a clear video live feed from a camera to an android phone. The connection does not have to be wireless because i have to use it without any internet. The camera and phone will be 2 or 3 meters apart at most. It also has to be battery powered for at least 3 hours.

I also want the video displayed on my phone without anything else on the screen, just the live feed.

Which camera is best suitable, and what else do I need?

答:
You could use an IP camera like @FooBar suggested and use an app like  IP Cam Viewer Lite - Android Apps on Google Play.

This app will let you communicate to the IP cam over the internet and also to IP cams in the same local network as the phone.


问:
Sourcing catkin workspace populates ROS_PACKAGE_PATH with individual package paths
When creating a new catkin workspace, building it and then sourcing devel/setup.sh, the ROS_PACKAGE_PATH is populated with paths from individual packages instead of only the root directory that contains all the packages. The packages are still found when calling roslaunch and all works fine, but my understanding is that ROS_PACKAGE_PATH should only contain the root directory. For example, I create a new catkin workspace:

```<code>source /opt/ros/melodic/setup.bash
echo <span class="math-container">$ROS_PACKAGE_PATH # prints /opt/ros/melodic/share
mkdir -p $</span>HOME/test_ws/src
cd <span class="math-container">$HOME/test_ws/src
catkin_init_workspace
#copy / create packages pkg1, pkg2, ...
cd $</span>HOME/test_ws
catkin build
source devel/setup.bash
echo <span class="math-container">$ROS_PACKAGE_PATH # at this point, i would expect
#$</span>HOME/test_ws/src:/opt/ros/melodic/share, instead i get
#<span class="math-container">$HOME/test_ws/src/pkg1:$</span>HOME/test_ws/src/pkg2:/opt/ros/melodic/share

</code>```

Is this the normal behavior or am I doing something wrong here?

答:
Seems like this is the expected behavior of catkin build as stated on the  Migrating from catkin_make website:

It generates .catkin files where each source package is listed, individually, instead of just listing the source space for the workspace. This leads to similar ROS_PACKAGE_PATH variables which list each package source space.

If using the catkin_make, however, it does add only the root/source path of the workspace, as i expected initially.


问:
Gazebo: SetPosition() function in the Joint class doesn't set the joint position and returns false sometimes
I am trying to initialize the positions of my robot using Gazebo Plugins. SetPosition() function of the Joint class is supposed to set the joint angle (all my joints are revolute joints). However, the function doesn't do anything. The function returns false indicating the action is unsuccessful. I have attached a simplified version of my code. I don't understand why it returns false always. Any help is appreciated.

```<code>#include <map>
#include <functional>

#include <ignition/math/Vector3.hh>

#include <gazebo/common/common.hh>
#include <gazebo/gazebo.hh>
#include <gazebo/physics/physics.hh>

namespace gazebo {
class RobotInitialization : public ModelPlugin {
 public:
  void Load(physics::ModelPtr _parent, sdf::ElementPtr) {
    this->model = _parent;

    auto joint = this->model->GetJoint("revolute-joint");
    joint->SetPosition(0, 1.0, true);
    std::cout << joint->Position(0) << std::endl;
  }

 private:
  physics::ModelPtr model;
};
GZ_REGISTER_MODEL_PLUGIN(CassieInitialization)
}  // namespace gazebo
</code>```

Edit:

Thanks for the suggestion. I checked the joint limits and this helped for 6 out of 16 joints on my robot. I set velocities for all joints using SetVelocity() and that works for all the joints but SetPosition() doesn't. I also checked DOF of the joints using joint.DOF() and it returns 1 for all my joints.

Edit:
I am using bullet as the solver.

答:
It's returning false because it's failing to set the joint angle. I would try to troubleshoot this by stepping through the different reasons it could fail.

The first thing that I think of, especially when I see a Get<something>() that has a string input, is that the name changed, isn't spelled correctly, etc. I would check first if you're actually getting a valid joint from your GetJoint() command:

```<code>if(joint==nullptr)
{
    std::cout<<"Joint not found!"<<std::endl;
}
else
{
    <your code here>
}
</code>```

The next thing I would check is whether your joint has any degrees of freedom to actually move - that it's not fully constrained:

```<code>if(joint.DOF()==0)
{
    std::cout<<"Joint has zero degrees of freedom!"<<std::endl;
}
else
{
    <your code here>
}
</code>```

I can't see in the documentation what units the inputs to SetPosition() are, but Position() returns radians and I'm assuming that SetPosition() is also expecting radians. You're inputting 1.0 radians, which is about 60 degrees, so I don't know if there are some kinematic constraints that are preventing that rotation.

Please do these checks and edit your question to post the results.

:EDIT:

It looks like there's an open bug for setting joint states when using SimBody, but it looks like maybe using ODE as the solver instead works.

Also, there's another post that suggests using a joint controller and setting the joint position target instead of trying to set the joint position directly.

Body:
It's returning false because it's failing to set the joint angle. I would try to troubleshoot this by stepping through the different reasons it could fail.

The first thing that I think of, especially when I see a Get<something>() that has a string input, is that the name changed, isn't spelled correctly, etc. I would check first if you're actually getting a valid joint from your GetJoint() command:

if(joint==nullptr)
{
    std::cout<<"Joint not found!"<<std::endl;
}
else
{
    <your code here>
}

The next thing I would check is whether your joint has any degrees of freedom to actually move - that it's not fully constrained:

if(joint.DOF()==0)
{
    std::cout<<"Joint has zero degrees of freedom!"<<std::endl;
}
else
{
    <your code here>
}

I can't see in the documentation what units the inputs to SetPosition() are, but Position() returns radians and I'm assuming that SetPosition() is also expecting radians. You're inputting 1.0 radians, which is about 60 degrees, so I don't know if there are some kinematic constraints that are preventing that rotation.

Please do these checks and edit your question to post the results.

:EDIT:

It looks like there's an open bug for setting joint states when using SimBody, but it looks like maybe using ODE as the solver instead works.

Also, there's another post that suggests using a joint controller and setting the joint position target instead of trying to set the joint position directly.


问:
Native ROS vs ROS compatible via API
I am looking to buy a cobot for a research project (budget about 20k€). I happened to see some cobots (e.g. Mara) that claim running ROS natively, some others (e.g. Aubo i5) that is compatible with ROS via API. </p>

<p>Since I am not a programmer, could anybody explain me the difference, if any? </p>

答:
If your top priority is ROS compatibility and not performance, then I would go for the Hardware-ROS "approved" arm.

In my view, running ROS "natively" would mean that the robot has a Linux PC which has a ROS core raised and handles communication with its parts and with the outside world via ROS topics.

On the other hand, having only a ROS API would mean running whatever OS to coordinate sensors, actuators and tasks (or even go completely bare-metal RTOS), but have suitable communication libraries which allow reading and writing onto (specific) ROS topics.

Title: Native ROS vs ROS compatible via API


问:
Does Monte Carlo Localization need a predefined map?
So I'm doing some reading on Monte Carlo Localization, and it sounds like the approach is based on using a predefined map, but I just need to make sure (because I haven't read anywhere that it absolutely needs a predefined map). I just want to make 100% sure that my understanding is correct:

Does it absolutely need a predefined map?

[maybe I need to add the below stuff as another question, but here goes nothing]
And what other localization approaches are there that don't need a predefined map? So far I've only read about SLAM (which sounds to me like a general approach instead of a specific implementation).

Thanks in advance!

答:
Yes, as defined in literature, all localization requires a prior map.

This is because the goal of localization is to localize a robot with respect to some feature. If you don't know where the feature is, you can't know where the robot is.

If you are uncertain about the features, then you are doing Simultaneous Localization and Mapping (SLAM).


问:
disparity error to x and y accuracy
This question talks about the depth error ($\Delta$Z) as a function of disparity error ($\Delta$D).

I want to do the same for X and Y

How would we quantify $\Delta$X and $\Delta$Y w.r.t. $\Delta$D

答:
I think I understand the question - you're looking for how the 3D position of the object is affected if you have mis-judged the depth.

I think the answer lies in considering the nature of the camera system - it's kind of like polar (spherical) coordinates being mapped to a plane, such that each pixel represents a particular azimuth and elevation angle.

If your camera has a field of view of 60 degrees (+/- 30 degrees), then each pixel is going to represent some sliver of angle of your field of view, where the particular angular delta is the inverse of your resolution.

Consider this graphic:

Say you're looking at a house exterior (black) and the interior wall (red/green) through some open doors or windows. Red would be the incorrect depth estimate to the interior wall and green is the corrected estimate.

:EDIT: - Totally botched the math earlier, so I rewrote the paragraph below:

Since you're projecting your angular view onto that distance, the object in front of you has no x/y shift if you've estimated the depth wrong because $x = r\sin{\theta} = 0$ if your $\theta = 0$, regardless of $r$. However, as your objects get more on the edge of your field of view, the look angle $\theta$ gets larger and your x/y estimates get worse.

:EDIT: - I actually screwed up these equations originally. My mistake was starting with $x = z\cos{\theta}$, when it doesn't - it's polar, which doesn't use $z$! It uses $r$! Consider then the relationship between $\Delta z$ and $\Delta r$:

Now you can see that $\Delta z$ is the vertical/depth projection of the change in radial distance $\Delta r$ (theta is defined as the look angle away from broadside):

$$
\Delta z = \cos{\theta} \Delta r \\
$$

which can be restated as:

$$
\Delta r = \frac{1}{\cos{\theta}} \Delta z \\
$$

Now this makes more sense. By this definition, too, $x$ is the horizontal projection of the radial distance, as stated above:

$$
x = r \sin{\theta} \\
$$

Keep in mind that it looks like the sine/cosine functions are flipped, but that's because the look angle is away from broadside/vertical.

Continuing on to the equations as they should have been:

$$
x_{est} = r_{est} \sin{\theta} = \frac{1}{\cos{\theta}} z_{est} \sin{\theta} \\
x_{act} = r_{act} \sin{\theta} = \frac{1}{\cos{\theta}} z_{act} \sin{\theta} \\
\Delta x = x_{act}-x_{est} = \frac{1}{\cos{\theta}} z_{act} \sin{\theta} - \frac{1}{\cos{\theta}} z_{est} \sin{\theta} \\
$$

Now you can reduce $\frac{1}{\cos{\theta}} \sin{\theta}$ down to $\tan{\theta}$ and continue along as:

$$
\Delta x = z_{act} \tan{\theta} - z_{est} \tan{\theta} \\
\Delta x = \Delta z \tan{\theta} \\
$$
where, from the question you linked,

$$
\Delta z = \frac{z^2}{b f}\Delta D \\
$$

Title: disparity error to x and y accuracy


问:
Why was the Shadow robot hand been utilized for teleoperation?
With a deep neural network it's possible to convert a camera signal into the movement trajectory of a dexterous robotics hand.[1] In contrast to previous attempts in teleoperation, which are working with a dataglove or a joystick, the visual shape of the hand controls the robot. The human operator uses it's own hand to make a hand sign and the Shadow hand is doing the same action.

In this setup, a human operator is in the loop, which means, it has nothing to do with Artificial Intelligence. A real AI system would control the robot with software, a motion planner and can grasp objects by it's own. If the sensor signals are taken from a human, the system is only semi-autonomous. Does this make sense if the aim is to program autonomous robots? Wouldn't it be better to program an AI which controls the hand autonomously?

[1] Li, Shuang, et al. "Vision-based teleoperation of shadow dexterous hand using end-to-end deep neural network." arXiv preprint arXiv:1809.06268 (2018).

答:
Teleoperation is about letting the human do what humans do best, and letting the robot do what automation does best.  There are some situations in which it would take too long, or cost too much, to construct an effective AI system to do certain tasks.  Check out, for example, Betczy’s work at JPL, Sheridan’s at MIT, and Hamel’s at Oak Ridge.   The idea is to not need to program the entire human intelligence about the task, but instead allow the operator to respond to dynamic task scenarios as if they were present at the task, while taking advantage of the increased strength, stability, and the like from the robot.

As AI continues to progress, the line marking the efficiency of implementing telerobots vs complete automation will continue to move toward increasing amounts of automation.  But it will be very challenging to efficiently build an AI engine that can accommodate the unexpected things that a human can handle, in a reasonable amount of time, when the tasks are quite variable and in dynamic environments (think wartime, or catastrophic outside environments, or highly specialized surgeries).


问:
Avoid to hit corners on diagonal steps using A* algorithm
I'm using ROS melodic with Gazebo 9.9.0 on an Ubuntu 18.04.2 LTS.

I'm implementing an autonomous node that uses A* algorithm to move a robot from one position to another. The robot will be on a Gazebo World.

My problem is when moves on diagonal, sometimes it hits a corner and can not continue moving.

For example, I want to move from cell (1,1) to cell(10,12). I'm using an ones and zeros grid that it is represented in Gazebo and I translate the cells into Gazebo world's locations. Moving from (1,1) to (10,12), I get this path:

The Path is -> (1,1) -> (2,2) -> (3,3) -> (4,4) -> (4,5) -> (5,6) ->
  (6,6) -> (7,6) -> (8,7) -> (9,7) -> (10,7) -> (11,7) -> (12,8) ->
  (11,9) -> (11,10) -> (10,11) -> (10,12)

Cell (1,1) is the top most left cell in map. The problem comes when it tries to move from (4,5) to (5,6). In the following picture, the robot is on cell (4,5) facing to cell (5,6), and if it moves, it will hit the corner:

This is the route given by the algorithm where you can see the diagonal step:

Is there any way to solve this problem or this is a problem attached to A* algorithm?

答: The simplest solution is not to allow your A* program to make diagonal steps.</p>


问:
What is the relation between FOV, Focal Length and Sensor size in a Pin hole Camera Model?
I aim to recreate the camera parameters of my camera in the Unity rendering system, which has the following variables:

1) I tweaked the focal length and saw that the Field of View is changing (inversely) which makes intuitive sense. But I also notice that the FOV is changing when I am changing Sensor size - how is that possible? FOV should be fixed for a fixed focal length, right?

2) Is the Sensor size related to cx, cy - principal point in the Pin Hole Camera model?  Ref

3) The camera parameters I have are of this format:

where fx,fy are the focal length in pixel units. Unity though needs the actual focal length(in meters). Is there a way to mathematically deduce focal length from fx, fy?

答:
The field of view can be shown to be
$$
\theta = 2 \tan^{-1} \frac{D}{2f}
$$
where $D$ is the dimension of the sensor (width or height) and $f$ is the focal length.

You can derive this easily using similar triangles as in the figure below, where $\phi$ is the half field of view.  Since the sensor is typically rectangular, do this twice (once for sensor width, once for height) to get the horizontal and vertical field of view angles.


问:
Why Euler Angle is set to be in ZYZ order?
We have 3 DOF for rotation in 3D space. So to describe an arbitrary rotation, we need to describe its 3 DOF. Euler angle does this by dividing a rotation in 3 steps, first rotate along the Z axis of the world frame ($z_0$), then rotate along Y axis of current frame ($y_1$), and finally rotate along the Z axis of the current frame($z_2$).

And of course we have other conventions like z-x-z, x-y-x, y-z-y, x-z-x, y-x-y.

And my question is, why the euler angle is define in this "ZYZ" manner? Why the first and third rotation are about the same axis (of course the first Z and the last Z are in different frames) ? Why not to use ZYX?

答:
Euler's rotation theorem states that:

Any two independent orthonormal coordinate frames can be related by a
  sequence of rotations (not more than three) about coordinate axes,
  where no two successive rotations may be about the same axis.

That means there are a total of 12 rotation sequences possible, and we divide those into two groups of six. The Eulerian type involves repetition, but not successive, of rotations about one particular axis: XYX, XZX, YXY, YZY, ZXZ, or ZYZ. The Cardanian type is characterized by rotations about all three axes: XYZ, XZY, YZX, YXZ, ZXY, or ZYX.

There is a lot of inconsistency across the literature and many fields have their own specific conventions.  What are commonly called "Euler angles" in robotics are the ZYZ sequence -- this is really quite arbitrary but it's useful if we all agree on it!  Roll-pitch-yaw angles are of the Cardanian type and typically either XYZ or ZYX.  It seems XYZ is common for robot arms and ZYX for mobile robots.


问:
How does structured light improve accuracy in stereo vision?
In my understanding, in order to improve accuracy for the estimation of depth with a stereo vision camera, patterns of light are projected into the scene, because the resulting texture makes it easier to find point correpondances between the pair of stereo images, thus we can triangulate correct pairs of points and produce a dense and accurate depth map. But as far as I know, we can't see this structured light in the images captured by the stereo camera (nor in the scene), so how does a stereo camera make use of structured light in stereo matching?</p>

答:
@DavidJ is referring to sensors like the Kinect1, Asus Xtion, Intel SR300 which project a pattern of IR dots and observe the deformation with a monocular camera over a baseline.

Stereo cameras like the Intel D415 use stereo vision plus an IR pattern projector.  Stereo algorithms match patterns of pixels between the two views but if the surface is very plain, ie. a white wall, the matching fails.  The IR patter projector provides an artificial texture which allows the stereo to succeed.  With the RealSense SDK you can turn the projector on/off and see the difference in stereo performance.  The projector has a limited range but works well indoors where ambient IR from the sun is not a problem and where textureless surfaces are prevalent.  Outdoors, the projector is less effective (it has to compete with the sun) but the world is generally much more textured.


问:
Is finished plywood a comparable prototyping substitute for polyoxymethylene?
I'm working on a robot with a team, and we're building our robot out of acetal polyoxymethylene (POM) (specifically, delrin) plastic. However, we'd like to prototype the robot before we build it out of POM, as POM is somewhat expensive.

There are several critical areas that plywood would be used in place of POM:

Over sliding surfaces

Around gearboxes

Under weight stress

We'd like to take into account the friction coefficients, smoothness, and rigidity of the materials in deciding whether plywood is a valid prototype substitute. The material will be 1/4" thick.

What differentiates plywood from acetal POM with respect to the relevant points?

答:
Plywood is available in various grades (A, B, C),  sanded and unsanded, veneer core or MDF core, and with surfaces of various kinds of woods.  I'm not aware of any plywood that will emulate the friction coefficient of Delrin (polyoxymethylene).

With some hard, tightly grained, or oily woods (eg ironwood, ebony, teak) or Baltic Birch plywood, it might be possible to polish the wood to a point that its smoothness approaches that of  polyoxymethylene.  Note that those woods might cost more than polyoxymethylene does.

For other woods, it might be possible to use a filler and an epoxy finish to emulate some properties of Delrin, but if your project is about building your robot and not about accurately emulating properties of polyoxymethylene, I don't recommend the approach of experimenting with different finishes on plywood.

Instead, it may be best to purchase several polyethylene cutting boards and cut them up for use as polyoxymethylene testing standins.  Large cutting boards often are available cheap on Ebay, and small cutting boards can be found at thrift stores.

Note that polyoxymethylene is significantly stronger, harder, and more wear-resistant than the polyethylene in cutting boards, but polyethylene's properties are so much closer to polyoxymethylene's than plywood's are, that the prototyping fit should be much closer.  For a still-closer fit, you can buy  “drops” (small cutoffs) of  UHMWPE (ultra high molecular weight polyethylene) that in some applications will work as a Delrin replacement.


问:
Effiecient computation of coriollis matrix
I want to perform kinodynamic motion planning on a 6DoF hybrid manipulator. I calculated mass matrix, coriollis matrix etc using the lagrangian method. The coriollis matirx was calculated symbolically from the mass matirx using christoffel symbols. But this calculation takes too much time for me. I was wondering if there is any way by which the coriollis matrix may be calculated in a more faster and efficient way? </p>

答: The Robotics Toolbox for MATLAB has a CodeGenerator class which takes a serial-link robot model SerialLink expressed in terms of Denavit-Hartenberg parameters and generates efficient C code for all the dynamic terms: mass matrix, Coriolis/centripetal and gravity.  It uses recursive Newton-Euler and the method of Orin and Walker, the equations are computed symbolically, simplified and then converted to C code.


答:
ROS's costmap_2d allows you to inflate obstacles.  Typically, you inflate obstacles by at least half of the robot's width.

For example:

Inflated obstacles in light grey.  New path in blue.

Typically, occupancy grids like these are much finer resolution because they are obtained with a LIDAR sensor.  The map is stored as an array in memory similar to an image which allows you to perform operations like erosion and dilation in OpenCV.

Inflating obstacles manually shouldn't be too hard or costly if your grid isn't too large.  You should first increase the resolution of your map as shown.

Title: Avoid to hit corners on diagonal steps using A* algorithm

Body:
I'm using ROS melodic with Gazebo 9.9.0 on an Ubuntu 18.04.2 LTS.

I'm implementing an autonomous node that uses A* algorithm to move a robot from one position to another. The robot will be on a Gazebo World.

My problem is when moves on diagonal, sometimes it hits a corner and can not continue moving.

For example, I want to move from cell (1,1) to cell(10,12). I'm using an ones and zeros grid that it is represented in Gazebo and I translate the cells into Gazebo world's locations. Moving from (1,1) to (10,12), I get this path:

The Path is -> (1,1) -> (2,2) -> (3,3) -> (4,4) -> (4,5) -> (5,6) ->
  (6,6) -> (7,6) -> (8,7) -> (9,7) -> (10,7) -> (11,7) -> (12,8) ->
  (11,9) -> (11,10) -> (10,11) -> (10,12)

Cell (1,1) is the top most left cell in map. The problem comes when it tries to move from (4,5) to (5,6). In the following picture, the robot is on cell (4,5) facing to cell (5,6), and if it moves, it will hit the corner:

This is the route given by the algorithm where you can see the diagonal step:

Is there any way to solve this problem or this is a problem attached to A* algorithm?


问:
How Can A Total Beginner Become A Skilled Roboticist?
Say the only computer skill you have is programming in C/C++...what all things would you have to learn in order to be an adept full stack roboticist, one who can single-handedly build an autonomous/AI robot from the ground up(hardware, firmware, and software). How would you build your curriculum? Do you know any free or cheap online resources that can teach those things?

I want to learn this field deeply but have a hard time starting. Thanks

答:
Robotics is a mixture of things like mechanical engineering, electronics engineering and software engineering! Knowing C++ is a big head start in this area! Because I strongly believe that amongst all three engineering categories software is the one thing you will spend the most time on when developing an autonomous robot.

So to start, learn computer-aided design! So you can design mechanical components. I recommend Solidworks! There are also other software like Inventor and Creo that you can use.

The mechanical design component of building a robot will be a very iterative process, you can keep modifying your design until you are happy with it.

The best way to start off with electronics I think is to purchase an Arduino kit or a Raspberry Pi kit. Then follow along with tutorials that are online. Trust me there are heaps! This will help you understand how to program electronic components, and how to select them.

Then you will need a great deal of knowledge about electronics. How to select actuators, batteries, the right sensors and how to integrate all of them in the most effective way. You can learn about how to do these by posting on forums such as this, or doing some googling. So once you have a mechanical design, put together a simple block diagram of components. Once you have this, select the right components and draw up a simple wiring diagram. Once you have this, wire it up using a breadboard and test if the components work through an Arduino code or a python script on an RPi. Once you are more confident, start with a Vero board design. If you would like to be more advanced pickup a software like Eagle CAD and design your wiring as a Printed Circuit Board and send it off to China for low volume manufacture. Designing a PCB reduces so much wiring you will have to do and will reduce the amount of wasted space, also makes it easy to fault find.

Regarding the software or algorithms, I would recommend reading some research papers about the relevant topics you are interested in to understand the concepts. You can find these on google scholar or research gate. Another great platform to learn robotics is Peter Corke's Robot Academy. He goes through some of the most basic yet important and advanced robotics concepts and related mathematics.

Since you already know C++ I highly recommend using ROS. Within ROS you can model, and simulate your robot in RViz. You could write several scripts to simulate algorithms for Simultaneous Localisation and Mapping, Obstacle avoidance, A star path planning, etc. This will help you understand the algorithms quicker because you are actually practicing the concepts.

Here are some links to learn ROS that I have used in the past.

https://levi-armstrong.github.io/

http://docs.ros.org/kinetic/api/moveit_tutorials/html/index.html

Regarding hardware for autonomous robots:

These robots mainly require a mechanical design for steering, batteries, actuators and sensors. Learn more about the different kinds of steering mechanisms for mobile robots such as Ackermann Steering, Omni Directional Steering, Mechanum Wheeles steering, etc. This will help you with the mechanical design, given that you are planning to build a ground-based robot.

Then spend some time thinking about how the robot will sense the world it's in. This could be done by LIDARS, SONARS, IMUs, Encoders, Cameras, Stereo Cameras, etc. Once you have the sensing capability/capabilities chosen, you can select which exact algorithms to use.

Also, you might want to equip yourself with some tools such as a 3D Printer, hand tools, power tools, soldering iron, multimeter, and a benchtop power supply and perhaps a low-cost oscilloscope.

Hope all of this helps!


问:
I want to actuate a motor based on a wav file, but it has too many samples per second
I am trying to actuate a simple DC motor based on a wav file. At the moment I am using the "cat vs dogs sounds" from Kaggle.

One of the wav files in this DB looks like this:

These audio files are just a few seconds. The sample rate is 16KHz.

My first idea was to just actuate the motor based on the amplitude, but at 16KHz this doesn't make any sense. Also, the signal goes constantly from + to - (this is sort of ok because the motor can move in both directions), but from a human POV, what the motor does doesnt make any sense, because the movements are too rapid. I then tried to "decimate" the signal into a few points per second, but the signals seem to be badly destroyed.

DC motors are actuated using an Adafruit board, using Arduino, and then I have a Python script that interfaces with the Arduino through serial. I have this working fine, and I can make for example a loop from python that increases the speed every few seconds. My idea was to go forward or backwards based on the amplitude of the signal (if it is negative or positive), I am no expert on audio, so this might make no sense. I won't react to other sounds, only to the input wav files.

I don't really know what is the best way of transforming an audio signal of 16KHz into something that can be use to actuate a motor. At the moment I am using a DC motor, but the idea in the near future is to use leds instead, and change their intensity based on the audio signals

答:
You want to feed a lot of data to a slow consumer. Of course, you need to adapt somehow the two ends. I see the following options.

You decide a sample frequency to feed data to the motor, suitable to the motor. The .wav file plays normally, when the time comes, you feed to the motor whatever sample happens to be current. Almost 100% that you will violate the Nyquist law, and whatever gets to the motor is "random" data.

You apply low-pass filter to the .wav file, with a cut frequency adjusted according to the Nyquist law to the sampling frequency for feeding the motor. The data fed to the motor will be highly simplified, but somehow still related to the original stream.

You play the .wav file at a speed which the motor can handle. I mean, you deliver all samples, but at (e.g.) 50Hz instead of 16kHz.


问:
Mapping of dynamic environment
I want to do path planning in dynamic environment in which obstacles keep changing. Could you suggest me good path planning algorithm for this? . Is D* algorithm suitable for me to achieve this in simulation?</p>

答: Have you considered using the Vector Field Histogram (VFH) algorithm for path planning in an environment with dynamic obstacles?</p>

Title: Mapping of dynamic environment


问:
How do you control the end effector of a rigid body system using keyboard keys?
So in my lab, I am to create a rigid body tree robot that has an end effector that can be teleoperated by keyboard commands. I found a function called waitforbuttonpress that allowed me to give the user the ability to select a specific keyboard key and then use that key to change the position vector to a different value. I placed the inverse kinematics solver inside of the function below because I believed that the function would solve the new angle joints based off of every time the position of the end effector changed, though for some reason I am getting some error in the inverse kinematics solver saying: Error using trvec2tform Expected t to be an array with number of columns equal to 3. I am using the home configuration of the robot as input for the kinematic solver function. Any advice is welcome below is the entire code of both the rigid body system as well as the kinematic solver function.</p>

```<code>pbot = robotics.RigidBodyTree('DataFormat','column','MaxNumBodies',2);

body1 = robotics.RigidBody('body1');
joint1 = robotics.Joint('jnt1','revolute');
joint1.JointAxis = [1 1 1];
setFixedTransform(joint1,trvec2tform([0 0 2]));
body1.Joint = joint1;
addBody(pbot,body1,'base')

s0 = homeConfiguration(pbot);
weights = [0, 0, 0, 1, 1, 1];
ik = robotics.InverseKinematics('RigidBodyTree',pbot);

sInitial = s0;

disp(body1)
keyboard_move(s0);

show(pbot)

function keyboard_move(x)
k = waitforbuttonpress;
p = get(gcf, 'CurrentCharacter');
while p ~= 'q'
    if p == 'a'
        x = x + [0 -.1 .1];
        k = waitforbuttonpress;
        p = get(gcf, 'CurrentCharacter');
    elseif p == 's'
        x = x + [-.1 0 .1];
        k = waitforbuttonpress;
        p = get(gcf, 'CurrentCharacter');
    elseif p == 'd'
        x = x + [0 .1 .1];
        k = waitforbuttonpress;
        p = get(gcf, 'CurrentCharacter');
    elseif p == 'w'
        x = x + [.1 0 .1];
        k = waitforbuttonpress;
        p = get(gcf, 'CurrentCharacter');
    else
        fprintf("Please enter a correct key: 'a', 's', 'd', 'w'")
    end
    mover = ik('body1',trvec2tform([0 0 1 + x]), weights, s0);
    sInitial = mover;
end
end

end
</code>```

答:
for some reason I am getting some error in the inverse kinematics solver saying:

Error using trvec2tform Expected t to be an array with number of columns equal to 3.

Correct - you're not providing an array to trvec2tform with number of columns equal to 3. You're not using any punctuation (COMMAS!) in your vector definitions, which makes my eye twitch, and Matlab's also having a hard time with it.

It's not clear what x is, since it's an input to your function, but when you use it on other lines you've got it as x = x + [dx dy dz] (I'm assuming) However, when you use it as an input to trvec2tform, you're not doing x + [something], you're doing [something + x], all together in the same square brackets.

That is, you're including what appears to be a positive x, i.e., + x in the "fourth column" position, because you're using whitespace as your delimiter in your vector definition.

So, if your x vector is an accumulation of little steps, say x = [Dx Dy Dz], and you're trying to pass some initial positions [x0 y0 z0] plus your accumulation of steps, then what you are telling Matlab is:

```<code>[x0 y0 z0 + x]
</code>```

Which Matlab is interpreting as:

```<code>[x0 y0 z0 +Dx +Dy +Dz]
</code>```

where you appear to instead mean:

```<code>[x0 y0 z0] + x
</code>```

which Matlab would the interpret as:

```<code>[x0 + Dx, y0 + Dy, z0 + Dz];
</code>```

The line I wrote above would work fine because I included commas, so it's clear to Matlab where the columns are broken up, however even if you put commas in as-is, you would see that there's no clear way to interpret what you've written, i.e.:

```<code>[x0, y0, z0 + x]
</code>```

would probably be interpreted as:

```<code>[x0, y0, z0 + Dx, z0 + Dy, z0 + Dz];
</code>```

There's no way to include that x term inside the definition of your origin vector (which again is what I'm assuming the [0 0 1] is meant to be).

Body:
for some reason I am getting some error in the inverse kinematics solver saying:

Error using trvec2tform Expected t to be an array with number of columns equal to 3.

Correct - you're not providing an array to trvec2tform with number of columns equal to 3. You're not using any punctuation (COMMAS!) in your vector definitions, which makes my eye twitch, and Matlab's also having a hard time with it.

It's not clear what x is, since it's an input to your function, but when you use it on other lines you've got it as x = x + [dx dy dz] (I'm assuming) However, when you use it as an input to trvec2tform, you're not doing x + [something], you're doing [something + x], all together in the same square brackets.

That is, you're including what appears to be a positive x, i.e., + x in the "fourth column" position, because you're using whitespace as your delimiter in your vector definition.

So, if your x vector is an accumulation of little steps, say x = [Dx Dy Dz], and you're trying to pass some initial positions [x0 y0 z0] plus your accumulation of steps, then what you are telling Matlab is:

[x0 y0 z0 + x]

Which Matlab is interpreting as:

[x0 y0 z0 +Dx +Dy +Dz]

where you appear to instead mean:

[x0 y0 z0] + x

which Matlab would the interpret as:

[x0 + Dx, y0 + Dy, z0 + Dz];

The line I wrote above would work fine because I included commas, so it's clear to Matlab where the columns are broken up, however even if you put commas in as-is, you would see that there's no clear way to interpret what you've written, i.e.:

[x0, y0, z0 + x]

would probably be interpreted as:

[x0, y0, z0 + Dx, z0 + Dy, z0 + Dz];

There's no way to include that x term inside the definition of your origin vector (which again is what I'm assuming the [0 0 1] is meant to be).


答:
This is not a great error message and it only happens if you are using the MATLAB rather than the (100x) faster MEX version of the dynamics.

The error occurs because the motor inertias are not set, and they default to []. To fix this I ran this code after the robot was defined

>> for i=1:3
robot.links(i).Jm = 0;
end
```

<p>but you could build it into your initialisation code. The acceleration is</p>

<pre class="lang-matlab prettyprint-override"><code>>> robot.accel(q, zeros(1,3), zeros(1,3))

ans =

   -0.0000
   22.6479
  -11.5237
</code>```

Title: 3-DOF Robot Dynamics error in Robotics Toolbox

Body:
I am trying to compute dynamics of 3 DOF robot using Robotics Toolbox by executing this code:

```<code>robot.accel(q, zeros(1,3), zeros(1,3))
</code>```

But I am getting this error: Assignment has more non-singleton rhs dimensions than non-singleton subscripts

My robot is:

```<code>L(1)= Link([0 0.03 0 -pi/2]);
L(2)= Link([0 0 0.28 0]);
L(3)= Link([0 0 0.2 0]);
L(1).m = 1;
L(2).m = 4;
L(3).m = 3;
L(1).r=[0 0 -0.015];
L(2).r=[0.14 0 0];
L(3).r=[0.1 0 0];

ax1=0.03; ay1=0.03; az1=0.03;
ax2=0.28; ay2=0.05; az2=0.05;
ax3=0.2; ay3=0.05; az3=0.05;
I1=1/12*[ay1^2+az1^2 0 0; 0 ax1^2+az1^2 0; 0 0 ax1^2+ay1^2];
I2=4/12*[ay2^2+az2^2 0 0; 0 ax2^2+az2^2 0; 0 0 ax2^2+ay2^2];
I3=3/12*[ay3^2+az3^2 0 0; 0 ax3^2+az3^2 0; 0 0 ax3^2+ay3^2];
L(1).I=I1;
L(2).I=I2;
L(3).I=I3;

q=[0 0 0]

robot=SerialLink(L);
</code>```

Body:
This is not a great error message and it only happens if you are using the MATLAB rather than the (100x) faster MEX version of the dynamics.

The error occurs because the motor inertias are not set, and they default to []. To fix this I ran this code after the robot was defined

>> for i=1:3
robot.links(i).Jm = 0;
end

but you could build it into your initialisation code. The acceleration is

>> robot.accel(q, zeros(1,3), zeros(1,3))

ans =

   -0.0000
   22.6479
  -11.5237


答:
There are a few dimensions to being a roboticist:

is knowledge of theory about robot perception (understanding the world through sensors such as cameras, signal processing and machine learning), planning(how the robot should move) and action (how things move in space, kinematics, dynamics, control theory, reinforcement learning etc.). There are a lot of resources aimed at school/hobbyist level or at graduates, not much in between.  I would humbly suggest you take a look at the QUT Robot Academy which is over 200 free online video lessons on a range of topics around arm robots and vision which are aimed at university undergraduates and would at least build understanding of some technical concepts and get you started on the road to becoming a roboticist.

is what I think of the craft or skill, being able to code and these days also being familiar with commonly used tools such as Python, C++, OpenCV, PCL, ROS, Tensorflow/Torch etc. @JJerome's post has good links to ROS resources.

an awareness of the ethics and societal impact of what you are doing.

Title: How Can A Total Beginner Become A Skilled Roboticist?

Body:
Say the only computer skill you have is programming in C/C++...what all things would you have to learn in order to be an adept full stack roboticist, one who can single-handedly build an autonomous/AI robot from the ground up(hardware, firmware, and software). How would you build your curriculum? Do you know any free or cheap online resources that can teach those things?

I want to learn this field deeply but have a hard time starting. Thanks


问:
Transform this matrix of distances into a more general one
I need to make the navigation and guidance of a vehicle (a quadcopter) in a platform. This platform can be seen like this:

where the blue dots are the center of each square, and the $x$ distances are all the same, and the $y$ distances are all the same.

I need the distance between each blue dot to the center (the blue dot of the $(2;2)$), but that distance depends on the $yaw$ angle. For example, if $yaw=0^\circ$, the situation is like this:

and the distances are:

$$d_{1;1} = (-d_x; -d_y)$$
$$d_{1;2} = (-d_x; 0)$$
$$d_{1;3} = (-d_x; d_y)$$

$$d_{2;1} = (0; -d_y)$$
$$d_{2;2} = (0; 0)$$
$$d_{2;3} = (0; d_y)$$

$$d_{3;1} = (d_x; -d_y)$$
$$d_{3;2} = (d_x; 0)$$
$$d_{3;3} = (d_x; d_y)$$

If the situation is with $yaw=180^\circ$:

the distances are the same but with the opposite sign, i.e,

$$d_{1;1} = (d_x; d_y)$$
$$d_{1;2} = (d_x; 0)$$
$$d_{1;3} = (d_x; -d_y)$$

$$d_{2;1} = (0; d_y)$$
$$d_{2;2} = (0; 0)$$
$$d_{2;3} = (0; -d_y)$$

$$d_{3;1} = (-d_x; d_y)$$
$$d_{3;2} = (-d_x; 0)$$
$$d_{3;3} = (-d_x; -d_y)$$

If $yaw=90^\circ$, the situation is like this:

and the distances (see the difference between $d_x$ and $d_y$) would be:

$$d_{1;1} = (-d_y; d_x)$$
$$d_{1;2} = (-d_y; 0)$$
$$d_{1;3} = (-d_y; d_x)$$

$$d_{2;1} = (0; -d_x)$$
$$d_{2;2} = (0; 0)$$
$$d_{2;3} = (0; d_x)$$

$$d_{3;1} = (d_y; -d_x)$$
$$d_{3;2} = (d_y; 0)$$
$$d_{3;3} = (d_y; d_x)$$

If $yaw = -90^\circ$:

the distances would be:

$$d_{1;1} = (d_y; d_x)$$
$$d_{1;2} = (d_y; 0)$$
$$d_{1;3} = (d_y; -d_x)$$

$$d_{2;1} = (0; d_x)$$
$$d_{2;2} = (0; 0)$$
$$d_{2;3} = (0; -d_x)$$

$$d_{3;1} = (-d_y; d_x)$$
$$d_{3;2} = (-d_y; 0)$$
$$d_{3;3} = (-d_y; -d_x)$$

I need to write a matrix that uses the information of the $yaw$ angle and returns the distances from each angle (not just 0, 90, -90 and 180, but also 1, 2, 3, ...)

I tried to write it but I couldn't find the solution.

Thank you very much. I really need this help

Edit: please note that the coordinate frame moves with the quadcopter, like in this image:

Edit 2: for example, if $yaw=45^\circ$, then the distance from $(3;3)$ to $(2;2)$ is $\sqrt{d_x^2+d_y^2}$ in $x$ and $0$ in $y$.

答:
Place a fixed coordinate system at the upper left corner of your grid, with the x axis pointing down and y to the right.   Call this the 0 coordinate system.

Imagine the origin of the moving coordinate system to be located at the origin of the 0 coordinate system.  Unfortunately you have defined that coordinate system to have the x axis pointing up, and the y axis pointing to the left.  We’ll handle that, but the math would be a bit simpler if the coordinate systems were aligned when $yaw = 0$.  Call the moving coordinate system the 1 system.

Define a rotation matrix $R_{01}$, where $$ \vec {p_1} = R_{01} \vec {p_0}$$

The above equation, then, can be used to map vectors from the 0 coordinate system (your grid) to vectors in the rotating coordinate system.

Beginning kinematics can be used to find that

$$
  R_{01} =  \begin{bmatrix}
    - \cos(yaw) & \sin(yaw) \\
    - \sin(yaw) & - \cos(yaw) \\
    \end{bmatrix}
$$

Note that each element’s sign would be the opposite of what it is above had the two coordinate systems aligned when $yaw = 0$.

Vector math gives:

$$x_1 = - \cos(yaw) x_0 + \sin(yaw) y_0$$
$$y_1 = - \sin(yaw) x_0 - \cos(yaw) y_0$$

where $x_0$ is what you call $d_x$, and $y_0$ is your $d_y$.


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

答:
I think what you said in your question is correct so far.

Single and multi query planning refers to the number of planning tasks you are about to execute. That means, the number of different paths you want to plan, given an unchanging environment.

PRM constructs a graph-structure (roadmap) of the free configuration space. Instead of exploring the c space every time you plan a path like RRT does, PRM is able to use the generated roadmap multiple times as long as the environment it is based on does not change.


问:
Joint torque sensor vs end-effector force sensor
I am trying to understand the difference between joint torque sensors, and force sensors, in a robot arm. From what I understand, joint torque sensors estimate the torque at each joint, whereas a force sensor estimates the joint at the end-effector.

But isn't it true that you can use the joint torque sensors to estimate the force at the end-effector, using forward kinematics? And if so, then why would you need to use a force sensor, if you already have joint torque sensors? Or would you typically only have one, i.e. only a set of joint torque sensors, or only a single force sensor?

The reason I am questioning this is that at https://blog.robotiq.com/robotiq-ebook-summary-force-sensors-in-robotics-research, it says:

Force sensors are designed to detect forces applied between their base and sensing plate

But then at https://studywolf.wordpress.com/2013/09/02/robot-control-jacobians-velocity-and-force/, it says:

Jacobians allow us a direct way to calculate what the control signal is in the space that we control (torques), given a control signal in one we don’t (end-effector forces)

Therefore, it seems to me that joint torque sensors and force sensors do the same thing, and you would never need both of them. Is this correct? Or do they play complimentary roles?

答: If everything were ideal, then your thinking is correct. In practice, though, there are many accumulated errors both in the sensors and in the real vs modelled Jacobian. So if what you care about most is force applied at the end-effector then it is much more accurate to have a sensor located at the end effector. Unfortunately that would also add weight, and possible be more expensive, so for practical reasons you may only have joint torque sensors even though it's less accurate.</p>