答:
The 0.5 ms limit might be a bit harsh. Usually 1 ms should be enough for solving the IK numerically on reasonable hardware (industrial PC, maybe RasPi as a worst case).

Numerical solutions always depend on the initial guess the calculations are starting from. Calibration is meant to compensate for the small misalignments in the joints. It can be concluded that the "distance" from the point in joint space obtained by the analytical (ideal) inverse kinematics and the numerical inverse kinematics (for the real DH values) is small. This can be exploited and the ideal analytical IK can supply the initial guess for the real numerical IK. Since the distance is small the numerical IK will converge in 3-5 iterations to a solution that is below the acceptable precision threshold.

Industrial robot controllers (e.g. ABB, Kuka) have a cycle time of 2 - 16 ms. A significant amount of the cycle time is spent on calculating different calibration and compensation functions (e.g. joint misalignment compensation, static load deflection compensation, gear backlash compensation, thermal dilatation compensation, etc.)

Title: Robot Calibration using DH parameters

Body:
I'm new in robotics. My problem is the next one: I have a 6DOF robot manipulator and because the implementation was for real-time application my calculation time had to be really fast so that I used Wrist Center position(Geometrical solution). After using some calibration machine(I don't know much about this machine) I got the real DH parameters of the robot and of course are not the same.
I can't use the real DH parameters in my IK cause is no longer valid for the new DH parameters and If I implement a numerical solution I don't know really how much time it will take. So, my questions are :

Do you know any IK method for this case with no more than 0.5ms for each IK calculation?

Is there any information about how can compensate the position without change the IK but knowing the real DH information?

Do you know any other solution to this problem?

Finally, I was reading kinematics calibration. I think I got the idea but in the end is the same problem, you got new DH parameters and How to use those new DH parameters or maybe I understood wrong this information, basically is using this equation:

Thanks for help!!!


问:
Position Sensor
During my design of a simple robotic arm, where I 3D printed most of the parts, then used these HS-422 servos, it turned out that for a better control precision and to be able to apply Inverse Kinematic Modeling on my arm, I need feedback positions from these servo, which HS-422 do not provide.

I want to keep using these Servos because the parts are designed to fit them, what options do I have to include feedback position sensors without changing the servos and re-designing the arm's parts? Or is there any servo with feedback position and close dimensions to HS-422 that I can replace with?

答:
The suggestion posted by N. Staub worked well for me, I was able to perform the hack onto the HS-422 where the min and max readings of the servo potentiometer were [0.34-2.04 Vdc] and by using Arduino MEGA 2560, which has the option to provide an interval voltage reference of 2.56V, as fellows:

```<code>analogReference(INTERNAL2V56) #Arduino MEGA Only
</code>```

With this setup I could get a good resolution of 0-2.56V/0-1023 counts.

For other boards, you can provide an External Aref, using a voltage divider rule, keeping in mind that the max External Aref cannot be more than 5V otherwise you will damage the chip.

ContentLicense: CC BY-SA 3.0

Title: Position Sensor

Body:
The suggestion posted by N. Staub worked well for me, I was able to perform the hack onto the HS-422 where the min and max readings of the servo potentiometer were [0.34-2.04 Vdc] and by using Arduino MEGA 2560, which has the option to provide an interval voltage reference of 2.56V, as fellows:

analogReference(INTERNAL2V56) #Arduino MEGA Only

With this setup I could get a good resolution of 0-2.56V/0-1023 counts.

For other boards, you can provide an External Aref, using a voltage divider rule, keeping in mind that the max External Aref cannot be more than 5V otherwise you will damage the chip.


问:
Quadcopter application underwater
Just out of curiosity, can the concept of a Quadcopter be applied to an ROV? Would it work the same way underwater as it would be in Air? If not what kind of modifications it would take to implement that idea, underwater?</p>

答:
Is an underwater quadrotor possible?  Absolutely.  Whether it's practical in that configuration is a different matter.

In air, viscosity and buoyancy are negligible; in water, they are not.  An aerial quadrotor will expend energy fighting gravity, while an underwater quadrotor can simply rely on positively bouyant materials to keep it from sinking.  You can experience this yourself — you can swim in water (or use a small piece of foam for flotation), but not in air.

An underwater quadrotor will expend energy fighting the water's fluid friction, while an aerial quadrotor will move easily.  You can experience this effect as well — try throwing a frisbee in air, then see how far you can "throw" it underwater.

If you were to actually operate a quadrotor underwater, you would mostly likely fly it with the rotors oriented horizontally — in the direction of travel, instead of being vertical and just tilting slightly in the direction of travel.

Update 2015-12-21: Someone did this exact thing.

While a torpedo shape typically favored for cruising in a forward direction, there are other vehicles with 4 thrusters (positioned for maneuverability), such as Bluefin's HAUV:

Title: Quadcopter application underwater


问:
How to locate an object on a known surface
I am building a small robot on wheels. The robot will be moving at a small speed in a square area of known dimensions. I need to locate the robot and know its position at any given moment so I can correct its trajectory.
I can add parts to the robot, like some sort of flag or lighting object.
It's preferable not to put any border around the area, since it would limit the flexibility of the project.

Added Info

The size of the robot is about 28 x 25 x 11cm. It will go on land and
the surface will be ideally flat (but since the friction between the
surface and the wheels can vary in different places, I need to know
if the robot arrived to the destination or not, and corrections need
to be done respectively).

I can place beacons around the field or any sort of sensors, as long as I can remove them easily and transport them.

The surface will be about 1.5x1.5m, depending on the range of the sensors, or the method used for localization.

The robot can start from a determined position.

Some methods

I thought of triangulating the position using two ultrasonic sensors placed at the two edges of the field. Although I am not sure if the US sensors will provide a sufficient angle and range to cover the entire area. I am also concerned about the precision.

Someone pointed to me that I could use two infrared sensors placed at the two edges, and make them turn 90deg both ways and scan the area. As soon as they find something, the position of the object can be found using triangulation.
Although I still don't know if these methods work well for a moving object.

If you think that one of the methods that I described is the way to go, please give me more insight on how to implement it in my project.

Here is an illustration of the path that the robot should go along. The basic idea of the project is that the robot should sow seeds at regular intervals, for example every 10cm; this is why I need to know if the robot really covered 10cm after the seed before, and if it has to turn.

I thought of making an imaginary grid: I tell the robot the position that it has to reach, then knowing the position of the robot I can make it turn until it is pointing in the direction of the arriving point and then it covers the distance between it's position and the arriving point.

I am very new to robotics, therefore I would really appreciate a detailed answer.

答: I suggest to use a color sensor and place some RGB colours in different parts as grid to let the robot know its position.</p>


问:
Which USB interface for Android device I can use for motor driver
I am new to robotics,
I will be controlling DC motors from Android device through USB

For this I have selected L298N motor controller(After watching YouTube videos )
And got some DC motors

I have no idea how do I connect this to Android device via USB cable

Help appreciated

Ref:
https://www.bananarobotics.com/shop/L298N-Dual-H-Bridge-Motor-Driver
https://youtu.be/XRehsF_9YQ8

PS: All I know is programming android

答: You can control DC motors from an Android device without a separate micro controller. The two ways I've seen this done are through a USB to parallel printer cable or through a headphone jack. Read more about these approaches at http://terakuhn.weebly.com/phone_usb_controller.html and https://makezine.com/projects/make-34/smartphone-servo/ respectively. However, I'm not familiar with the L298N motor controller so I'm not sure if you could use that with either of these approaches.</p>


问:
What's the term for 2 Dimensional tracks similar to the ones used on 3D printers?
I'm trying to do some research on a project that I'd like to work on.  My problem is that I am doing a terrible job googling, because I don't know what this technology is called.

Once I know what it's called, I feel like finding systems I can buy, or build, will be much more simple.

答:
By the word "tracks" I would assume you meant the guide rails on which
the 3D printers extruder is placed on.The rods which support the movement of the extruder are smooth linear shafts.

They are connected to a servo motors.Hope this helps....


问:
Depth sensing for a pick-and-place robot
I am supposed to design a pick-and-place robot. I have a prismatic joint to go down to a particular depth to pick an object which is located in 2D using computer vision. What is the recommended way to detect the height at which the object is placed? The object can be at a maximum vertical distance of 15 inches (around 38 cm).

What do you think is easier to implement  for sensing this height? Any suitable cheap sensors for this arrangement? Or a stereo camera system?

答: One of the experimental methods is to mount the camera on the actuator itself(called eye in the hand). Then use vision algorithms to detect the object of interest using edge detection techniques and use the images for visual odometry.</p>


问:
good laser scanner/ lidar for 4 wheel robot?
i was wondering what could be a good laser scanner can someone get for as much as 180$ ? i am planning to use it from SLAM to build a map, so this is why i wanted to ask here ? have anyone tried something that gives a good result?</p>

答:
My suggestion would be to buy a cheap, second-hand, Neato Robotics XV-15 robot vacuum-cleaner and use the LIDAR from that (you may even be able to buy the LIDAR unit separately).

A lot of guides to using the Neato LIDAR for robots have been published. For example this one from Hackaday describes how to use the Neato LIDAR with the Raspberry Pi.

Just type Neato Lidar robot into Google for more (this will also get you lots more useful background information about the LIDAR sensor itself, which is a bonus).


问:
Converting wired USB connection to a Bluetooth connection
Is there a way to convert usb wired signals to wireless Bluetooth signals?

For example, can a usb keyboard be converted into a wireless Bluetooth keyboard using something that the keyboard can plug into that converts the wired USB signals to wireless Bluetooth signals that can be transmitted to a Bluetooth enabled device, such as a laptop or Raspberry Pi.

答:
Likely it would be easier to use a Bluetooth keyboard to begin with.

There might be easier methods, but one approach may be to terminate the USB HID protocol to extract the key board data.  Then emulate a Bluetooth keyboard in order to complete the connection between the USB keyboard and Bluetooth device.

It would help to know that there are several different underlying protocols in both USB and Bluetooth.  Each is designed for a specific purposes.

There are several USB protocols to handle the many USB Device Classes.  For example, USB uses a different protocol for a keyboard (USB HID) then for a Thumb Drive (USB MSC).  Therefore there is no one generic solution to terminating a USB connection.  This is why most low powered embedded devices can only terminate a specific USB device.  For example a printer may only accept a Thumb Drive or a camera that looks like a Thumb Drive but nothing else.

Similarly, Bluetooth has a number of different underlying protocols.  One for two channel stereo music with high latency.  Another for two way phone conversations with low latency.  And many more. Again, it would be difficult to create a generic Bluetooth interface for all situations.


答: That is called a gantry robot. </p>

Title: What's the term for 2 Dimensional tracks similar to the ones used on 3D printers?

Body:
I'm trying to do some research on a project that I'd like to work on.  My problem is that I am doing a terrible job googling, because I don't know what this technology is called.

Once I know what it's called, I feel like finding systems I can buy, or build, will be much more simple.

Body: That is called a gantry robot.


问:
Quadcopter holding algorithm
I am working on a project related to quadcopter. I have also build a algorithm based on PID controller for controlling climb sink rate and also holding but it did not work correctly. My function to correct the motor is throttle += pid_output with the error is computed from taking the error of height and velocity by the function: error = K1*(target altitude - measure altitude) - K2*(velocity). Currently My velocity is calculated by taking the different between current altitude and the past  while altitude is measured from barometric sensor only. Does anyone here have the experience on building a holding algorithm for quadcopter before ? Could you please to have a look at my algorithm or share with me the ideas of altitude control algorithm.

Many thanks,

答:
I believe you are implementing PID incorrectly. For starters, you shouldn't be increasing your throttle by pid_output, you should be setting it to it.

```<code>for each measurement step:
    error = target altitude - measured altitude
    integ = integ + error
    velocity = error - olderror
    olderror = error
    throttle = Kp * error + Ki * integ + Kd * velocity
</code>```

The assumption made here is that the target altitude won't change, if it does, it should be handled properly.
There are more things to consider like prefilter, integral windup handling, etc.

https://en.wikipedia.org/wiki/PID_controller

Title: Quadcopter holding algorithm

Body:
I believe you are implementing PID incorrectly. For starters, you shouldn't be increasing your throttle by pid_output, you should be setting it to it.

for each measurement step:
    error = target altitude - measured altitude
    integ = integ + error
    velocity = error - olderror
    olderror = error
    throttle = Kp * error + Ki * integ + Kd * velocity

The assumption made here is that the target altitude won't change, if it does, it should be handled properly.
There are more things to consider like prefilter, integral windup handling, etc.

https://en.wikipedia.org/wiki/PID_controller


问:
Programming the Formula Allcode to run a circuit
In our engineering science lesson, my class has been tasked with programming the Formula Allcode buggy to run a pre-specified circuit with smooth turns.

The issue we are having is that we do not know how to do this whatsoever.

Most of us are doing this in scratch, but to explain the code a little...

there is a function called SetMotors that allows us to set the speed of the wheels as a percentage. We don't know what its maximum speed is and we don't know how to make the buggy turn at a specific angle, nor how to straighten it out at a specific time.

The circuit has a lot of smooth corners so using the functions Left and Right are out as they simply pivot the vehicle, rather than allow it to turn while moving. It's supposed to be a race!

Hopefully I've given you enough information, but I'll be glad to clarify on things as needed.

答:
I would suggest that you attempt to determine the values empirically. Create a start/finish line of fixed distance (1 meter, 5 meters, etc.), then time how long it takes the vehicle to cross it. Be sure to have the vehicle cross the starting line already at top speed or else you'll add the time it takes to accelerate and that will screw up your measurements.

Once you have a top speed, you can then measure the wheel base (distance between tire axial centers) and the wheel radii and use differential drive equations to calculate how to achieve a particular turning radius.

A note from experience: centrifugal forces may cause tire slip when cornering at high speed ("drifting"), but you won't be able to measure how far you drift. I would highly recommend you thoroughly test your cornering capabilities first and lower your cornering speeds accordingly. Professional drivers will slow down right before cornering, then begin to accelerate about halfway through the turn for this reason.

So, where wheel speeds of (50-5)% and (50+5)% might get you the desired wheel speed difference to make a turn, the forward speed could be faster if you did (100-10)% and (100)% instead. You still get a net 10% speed difference, so the turning radius would be the same. However, cornering at a net 95% speed might cause wheel slip. Consider lowering the net speed to something like (80-5)% and (80+5)% instead, etc. Again, test, test, test. The more testing you do up front, the better you will be able to perform come race day.


答: Your picture is of linear bearings on what looks to me to be stainless steel shafting. You can also use guide rails, which use a more specialized shaft than just a rod. </p>


问:
integrating perfect rate gyro data (noiseless)
Having a perfect gyro (with no noise/drift or bias), the gyro produces angular velocities in the form (wx, wy, wz) in rad/sec.

I would like to convert the rate gyro readings (which are expressed in gyro's case frame) to be in the inertial frame(earth)

At the beginning, i have a quaternion q the represents the rotation from earth's frame to gyro's starting orientation.

I am looking for a way to convert the (wx, wy, wz) rates the gyro produces to be in the inertial frame using the quaternion q.

Thank you,

答:
I think you can just convert the quaternions into a rotation matrix,

and multiply the gyro vector by that. I have used this to adjust linear acceleration in the past, and I think it should work for rotation, but please let me know how it goes.

The quaternion should be normalized first, meaning the sum of the squares should equal one. This is standard for quaternion orientation outputs. I discuss some quaternion basics here, if you're unfamiliar.


问:
Calculating motor power and motor needs for 200 lbs load
I'm trying to make a load carrying robot which will follow a line and will have capacity to carry 200 lbs on concrete surface. What should be the horsepower for electrical motor to handle this on 0 degree incline and 4 degree incline? Can I control it with Arduino or similar boards?

Thank you very much in advance

答:
Here is a link
 to Drive Wheel Motor Torque Calculations which is used to decide torque required by mobile robot.

Hope this helps.....


问:
How do I model a simple robot arm as a plant?
How do I model a simple robot arm as a plant?. I know how to model motors but, I think, controlling individual motors may not be enough; and in order to control the the arm as a plant I need to model it as a plant. In the block diagram below my trouble is in finding the hardware model of the robot arm.

答:
Each joint of your robot is one motor. They are coupled though kinematic relations and dynamic physics.

One straight forward way is to derive these so called 'equations of motion' using the euler-lagrange formalism. Once you obtained your equations you can create for example a Matlab function to solve them dynamically.

But back to the modelling part, check out the slides in Dynamic model of robots: Lagrangian approach, by Prof. Alessandro De Luca .


问:
DC servo motor shake/vibrate too much
I have a servo motor (details are here). I wrote a code in Arduino to rotate it in some defined angles and position. Code is given below:

```<code>void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  Serial1.begin(9600);
  Serial1.println("M40");
}

void loop() {
  // put your main code here, to run repeatedly:
  if (Serial.available() > 0)
  {
    Serial1.println(Serial.readString());
  }
  if (Serial1.available() > 0)
  {
    Serial.println(Serial1.readString());
  }
}
</code>```

Initially, the motor rotates fine and gave me feedback also. But, since last week whenever I gave a command to rotate motor it starts shaking/vibrating. I don't know why? I used same circuit, same power source etc. as I used earlier. I contacted company's people but they are also not getting what the problem is? Using multimeter, I checked voltage and found out 12.9 V which is within the range.

Can anybody help to find out the reason behind these? I have 2 motors and both are showing this behavior.

Thanks.

答: You did not specify how the motor was being controlled. If done through analog, a noisy analog signal could be the smoking gun. If done through some other (I2C or UART) there could be some interruption in the signal.</p>

Title: DC servo motor shake/vibrate too much


问:
Understanding the Robot Jacobian
Although I have an understanding of what Jacobians are in general and how to calculate Jacobians, I fail to understand how the idea of Jacobian came for use in kinematics and why they are used for turning angles into end effector position.

I'm also wondering how we change current angles into angular velocities and use that information to calculate the end effector position, while we lack information regarding time in such a problem.

答:
Jacobian defines the dynamic relationship between two different representations of a system. For example, if we have a 2-link robotic arm, there are two obvious ways to describe its current position:

The end-effector position and orientation(Let it be X)  and

As the set of joint angles.(Let it be Q)

The Jacobian for this system relates how movement of the elements of Q causes movement of the elements of X. Here Jacobian is a transform matrix for velocity.

Click here for a detailed note on how Jacobian helps with time derivatives to convert angle positions into angle velocities.

Hope this helps...

Title: Understanding the Robot Jacobian


答:
Let's start from the forward kinematics equation
$$x = f(q),$$
where $x \in \mathbf{R}^6$ is the end-effector position, $q$ is the joint angles, and $f$ is a (usually highly nonlinear) forward kinematics mapping. Due to the nature of $f$, computing the image of $q$ under $f$ (i.e. $f(q)$) is not difficult but computing the preimage of $x$ under $f$ (i.e. $f^{-1}(x)$) is a very challenging task. It is often very difficult, if not impossible, to have a closed-form formula of $f^{-1}$.

Fortunately, regardless of how nonlinear and complicated the forward kineamtics function $f$ is, when taking the time derivative of the above equation, we always have
$$
\begin{align}
\frac{dx}{dt} &= \left( \frac{d f}{d q} \right)\frac{dq}{dt}\\
\dot{x} &= J(q)\dot{q}
\end{align},$$
which is always a linear relation (i.e. a joint velocity is mapped to an end-effector velocity by a matrix $J$). Its linearity makes it very appealing.

Now when given an end-effector position $x^*$ and we want to compute a corresponding $q^*$, we can do so by using the following procedure:

Suppose the manipulator is at a an end-effector position $x_\text{current}$ and joint angles $q_\text{current}$

Compute $dx$ as an increment from $x_\text{current}$ towards $x^*$

Compute the Jacobian $J(q_\text{current})$

Compute the increment in joint angles $dq$ from $dx = Jdq$.

Update $q_\text{current}$ and $x_\text{current}$

If $f(q_\text{current}) = x^*$, terminates. Otherwise, go to step 2.

The above procedure is, roughly speaking, pretty easy to follow and implement compared to computing directly $f^{-1}$.

Title: Understanding the Robot Jacobian

Body:
Although I have an understanding of what Jacobians are in general and how to calculate Jacobians, I fail to understand how the idea of Jacobian came for use in kinematics and why they are used for turning angles into end effector position.

I'm also wondering how we change current angles into angular velocities and use that information to calculate the end effector position, while we lack information regarding time in such a problem.


问:
How does a clustered particle filter work?
Suppose we want to track multiple objects (robots, roads, people...) using clustered particle filtering (because we don't have an idea about how many objects there'll be, and the number of these may change over time). In the literature, there's a great deal of complicated formulas that explain how the weights of the clusters are calculated and involved in the calculation of the weights of the particles... Could someone explain (in very simple terms):

The main idea of clustered particle filtering

How particles are grouped into clusters

How weights are calculated (for particles and clusters)

答:
I am going to give a 5 minutes answer because I am still wondering how do I got to this page.... =P

Assuming you know Particle Filter concept.

1 - What is  "Clustered Particle Filter"?

The main idea of "Clustered Particle Filter" is to keep hypotheses alive! Imagine that in your environment you have two regions that are very similar. Almost the same. But in one of them you have a table and not in the other. Lets say your Particle Filter has converge to this two location. Now, you see clearly two "groups of particles" in your localization.
Then your laser sees something very similar to a table. Increases the probability of the group of particles in the room with the table and kill all particles in the room without a table. Ops, too bad, it was only a person walking and now all your particles are in one room without be sure where exactly the robot should be.
The idea of Clustered Particle Filter is to, when kill a particle, respawn it inside the same cluster. This way, you will probably keep covered more than one spot in the map, if the particles tend to converge.
This is general idea. Now: How to create new clusters? how to kill clusters? When do it?? I strongly advise you to read in papers or books about more deep answer. If the mathematical is hard, skip it for a moment, until you get the idea.

For instance: https://www.aaai.org/Papers/AAAI/2002/AAAI02-087.pdf
Go directly to Clustered-MCL section.

2 - How they are clustered?

Several ways to do it. For instance, you could initialize your particles in clusters already! In different positions in the map. Or you could start it as one cluster only (and in a SLAM approach) and when your clustering method see two or more clusters that are separate over a specific threshold, you could start to consider more than one cluster. Let your imagination fly!

3- How weights are calculated? For particles and clusters?

Both. What determines if a particle will keep alive is its probability. What determines if a cluster if a cluster should keep alive is its probability.

Now, you are asking if you should weight your particles inside of a cluster or globally. It depends on the method. But normally, to compute the probability of a cluster, you should weight the particles inside that cluster globally even if the weight used to determine if a particle should be kept alive  is computed only in respect to its cluster.

Have a nice day!

ContentLicense: CC BY-SA 4.0


问:
robotic arm DOF
I'm working on an assignment and was wondering aobut the degrees of freedom this system has.
The generalized coordinates are:
$\underline{q}:$
\begin{bmatrix}
x  \\
\theta_{1}  \\
\theta_{2}  \\
\end{bmatrix}
A revolute joint connects both rods. Furthermore, there is a horizontal actuation force $F_{1}$ in the revolute joint and a vertical actuation force $F_{2}$ in $CM_{1}$

I know that there are 2 bodies so 6 DOF in total.
The revolute joint constraints 2 DOF, and both sliders also constrain 1 DOF each. The actuation focres also remove 1 DOF each. which means that the total number of DOF is $0$. Is this correct?

I'm not sure what the spring at the bottom does.

Thanks in advance for any help

答:
The system has 2 DOF!
Your assumption The actuation focres also remove 1 DOF each. is wrong.

Generally you can always use a simple proof about the DOF.
In your system you have 3 generalized coordinates. If you fix one of them (e.g. the $x-$coordinate) you can still move the joint via $F_1$. The angles $\theta_1, \theta_2$ would change then.
If you fix another coordinate, lets say $x$ and $\theta_1$ you will not be able to move anything in the system anymore. Therefore the system has 2 degrees of freedom.

Title: robotic arm DOF


问:
DC Servos moving randomly
First time asking a question on this Stackexchange, I hope I don't sound too dumb...

My daughter saw a documentary about robots and immediately asked me to build her a robotic arm. I found a nice one on Thingiverse: https://www.thingiverse.com/thing:2433

I'm done building it and I just finished wiring it up. I want to drive it from one of the Arduino Unos I have lying around at home. Starting the Sketch from the example found at Arduino.cc (https://www.arduino.cc/en/Tutorial/Knob) something unexpected happened when I connected just one of the DC servos it has (I haven't connected any other): as I plugged it on the board nearly ALL seven servos have begin to move erratically and for no reason at all. Not just the one I was trying to calibrate, but most of the. Even if the PWM cable of the motor was not even near to the Arduino pin.

The setup I have, is approximately the following

If someone could help me to understand what's missing, I would greatly appreciate it. Again, please be kind. I'm just a hobbyist trying to make my little girl happy.

Thanks in advance!

答:
I'm not sure what the design behavior is with no reference input, but that might be a contributing problem. The servo is expecting a pulse every 20ms. It might also be that your battery pack is dead. It might also be that they're wired incorrectly.

Please measure and report the voltage on the battery pack output while the servos are jittering. Please also take an actual picture of your setup and post the actual code you're using.

My guess is the battery pack is (near) dead and not supplying the correct voltage.

Title: DC Servos moving randomly


问:
Use data from gyroscope to calculate orientation
From a gyroscope I'm getting angular velocities [dRoll, dPitch and dYaw] as rad/s, sampled at intervals dt = 10ms.

How do I calculate the short term global orientation (drift ignored) of the gyroscope?

Pseudo code would be helpful.

答:
Short answer: A gyroscope by itself cannot determine its global reference frame. You either need to start the device in a known initial global orientation and measure how much the orientation changes, or you need other devices to determine the "initial" or periodic global reference frame.

Long answer:

A gyroscope only gives you angular velocities, which then can be integrated into relative yaw, pitch, and roll from a starting point. This is a 3 degrees of freedom (3dof) system.

This can be combined with an accelerometer which measures the acceleration. If your device starts in a stationary position, the accelerometer can then be used to measure the direction of gravity and establish the initial "down" direction towards gravity. You now know the initial direction of down (but not north/south/east/west). This is a 6dof system.

Next, you can combine the above two with a magnetometer. This detects magnetic fields including magnetic north. Your device in its stationary starting position can determine which direction is north. You now know the initial down position and the initial north direction in the global reference frame. This is a 9dof system.


问:
Finding the manufacturer for a sensor
We're building a smart camera and one of our competitors is using a depth sensor we're interested in using. If we open up the product, is it common to be able to see manufacturer information for specific parts like sensors? </p>

答:
Warning: I know nothing about depth sensors in cameras.

With that caveat out of the way, it really depends on who your "competition" is. I know that designing and building systems takes way more effort than you (unless you did the work) can imagine. Having said that, if your competitor has a massive research and development department, and they do massive volume (enough to justify making their own IC chips), then even a single proprietary IC can really mess up your hopes of copying a part of their design. Having said this, I would think that if you are a true competitor, simply looking at how they achieved their objective should give you enough information to achieve your objective. If they are a large volume manufacturer, they will have proprietary IC chips, but they will also have common off-the-shelf ICs. If you are capable of achieving the task on your own (your team has the skills), then having a "look see" will allow you an advantaged position to consider the pro's and con's and go your own way. However if you are looking to simply copy everything chip for chip... then I would avoid refering to anyone who already created a product as "your competition".

If your competition is someone who does not have a massive budget or massive volume, then for sure, they are using off the shelf IC chips; and opening their product will allow you to see the part numbers they are using, and you can have a really good idea how to achieve your task.

My advice is: if you can't do it on your own, you probably won't be able to copy someone else's design. It usually takes a lot of skill to reverse engineer products. If you have the skill to reverse engineer products, you have the skill to build it on your own and you wouldn't be asking this question. If all you need is a part number, then this is not the place to find it.

Sorry if I sound feisty... I am only trying to save you a ton of effort. I have built systems before, and it's a lot of work. If you have no clue how to do something, looking at someone else's design won't save you....

Good luck.

Title: Finding the manufacturer for a sensor


问:
Depth cameras with varying illuminations
We realized that depth cameras (IFM) tend to create a lot of noise when exposed in areas with direct sunlight. Are there any approaches to deal with illuminations? Eliminating pixels for instance?</p>

答:
depth cameras are super cool. I have never worked with them before, but guess what? I have an opinion! lol.

Have you considered using a lens to filter out the direct sunlight as a "cover" (kind of a baseball hat brim). I recall when there was an eclipse we looked at it through a welder's mask and it was super cool as you could see the actual eclipse! maybe putting a filter to prevent the sun hitting your sensor is the way to go; you could use the same principle to prevent the sun hitting your sensor.

With most chips, the light intensity of direct sun is going to give you such a high value on those pixels that it will blind your sensor, and you won't be able to do squat about that unless you use a light filter... but then you could end up filtering the light your camera senses..

I have no idea what your application is, but touch base with your sensor manufacturer and see what they can suggest for your issue. Another "in the dark" idea is using an IMU to know when you are facing upwards at the sun, and knowing your data is compromised.

As a closing thought, unless the light emitted by the camera is light that is outside the spectrum emitted by the sun, you cannot look at the sun and get a valid distance read (thats how "anti-cop" radar blinders work).

If the manufacturer has no help, I would focus on either:

figuring out when I am looking at the sun and looking away

Blocking the sun out using filters as a kind of roof over the sensor.

Good luck in your adventure.


问:
Measurement model for Kalman filter but non-zero mean
I'm fusing two vision-based algorithms using the Kalman filter to estimate the state of a vehicle $X=(x,y,\theta)$ where $x$ and $y$ are the coordinates in the plan and $\theta$ the heading.
The problem is with the matrix $R$ of the 2nd algorithm taken as the measurement model. $R$ refers to the noise covariance matrix$$
R
=
\begin{bmatrix}
\sigma_{x}^2 & 0 & 0 \\
0 & \sigma_{y}^2 & 0 \\
0 & 0 & \sigma_{\theta }^2 \\
\end{bmatrix}
$$

In order to evaluate the variances, I tested the algorithm for example for the random variable $x$ and compared its retuned $x_{m}$ against the ground truth $x_{gt}$. Here is the histogram of $e(x)=\sqrt{{(x_{m}-x_{gt})}^2}$ in meters for $107$ measurements

The error is not zero-mean gaussian noise. For the gaussian shape is it correct to use maximum likelihood estimation to fit a gaussian to data, and how to deal with the non-zero mean issue?
Is it possible to use non-zero mean noise for measurement with unscented kalman filter?

答:
There are actually several issues in this question which I will answer separately.

1) Error is: $$\sqrt{(x_m-x_{gt})^2}$$

No, error is just $$(x_m - x_{gt})$$ This may be part of your problem with zero means because any error distribution will have a positive mean if you force all errors to be positive.

2) My error distribution does not have zero mean. How do I compensate for that?

Even after fixing that first issue, you may still have a non-zero mean. This can be fixed.

Determine the actual mean and use that to adjust any values that you receive from the sensor. This is called sensor calibration. So if you know that your sensor has a mean error of 8.3 and you receive a sensor measurement of 15, then you should treat that as a sensor measurement of 6.7 (15 - 8.3).

3) My error distribution is not gaussian. Is it okay to fit a gaussian to that distribution anyway?

Real error distributions are rarely gaussian, so fitting a gaussian is necessary. Unfortunately this does create a tradeoff for you to consider. If your gaussian is a good fit for the data in the 0-20 range then I think it will underestimate the probability of the outliers in the 30-50 range. That would cause your kalman filter to be overconfident and bounce around. Fitting a gaussian with larger sigma to include those values in the 30-50 range will result in smoother, but less precise output. The best result probably lies somewhere in between, so you'll need to experiment with that.


问:
How to proceed whith this design problem?
I'm intermediate python coder who is using Ubuntu 16.04 and has just finished the beginner tutorial from ROS wiki and I have realized I know very less. I pursuing my own design problem: Designing a bio-inspired spider that can operate with or without operator .

Can any one guide me through on what to do/learn next so that I'm completely ready to work on my design problem thereby saving my time in figuring out the road map for the same?

Sincerely

答:
1) StackExchange is really not intended for the side-by-side mentoring it seems you are looking for.  It is a good place to ask questions about specific problems you run into.

2) Python is not the programming language I would recommend for the real-time control needed for a robotics/mechatronics project, especially for a beginner.  I recommend you start with something simpler like Arduino.  If you need more advanced features, you could later add an Android phone that talks to the Arduino.  This is becoming easier as Android Studio is free and picking up an obsolete Android phone can be really cheap.  Android phones have a lot of advanced capabilities like a user interface, a display, GPS, accelerometers,  cameras, and WiFi.  You could even use a 2nd phone as a remote control by using WiFi Direct to talk to the Arduino on the robot.

3) Look locally for a mentor/club.  Depending on your location and age, you could find a High School robotics team to join, maybe take a class at a local university,  or find a local robotics or 3D printing club.  If all those are not a possibility, consider building a heavy DIY kit.  A really good option is buying a 3D printer then building a 3D printed design.

Ex: 3D-Printed Arduino Spider Robot

4) Get a 3D Printer or at least find a way to access one!  I mentor a Robotics Team and 3D Printing has been a huge advance in helping me develop the students.  It allows them to take their ideas to reality very quickly and learn what works and what doesn't; and, when something doesn't work it allows them to quickly modify their design and try again.

5) Accept that learning something like this is going to take a LOT of time, passion, and commitment.  Don't expect that a mentor is going to reduce that for you.  Mentors are often passionate about helping others grow; but, generally they have a lot of other demands for their time as well.  If they see they are putting more effort into your project than you are, expect that they may move on to more fertile ground.


问:
AUV Lipo Battery capacity
I'm making an AUV that requires 15-20 minutes of operating time. I'm using 6 of these motors (Blue Robotics T200 Thrusters) for propulsion; I'm looking for 6S lipo batteries (22.2V) but i don't know how to calculate the capacity (mAh) I need to run my vehicle. Is there any formula that allows me to calculate the required parameter?

Parameters required: Battery capacity, Maximum underwater operation time @ given load.

答:
You don't gave all information that are needed for such calculations. However, the technical details of the Thrusters give a peak consumption of 350 Watts each. So you have 6 of them, makes overall 2.1kW/h.

Lets assume your Batteries have the following details: 6S 22.2V 3300mAh.
Therefore the amount of energy the Batterie stores is: 22.2V*3.3Ah = 73.26W/h.

Moreover assume that you will drive only 25% full-speed in Average, 2.1kW/h * 0.25 = 525W/h.

Let's calculate the runtime under these assumptions: 73.26W/h / 525W/h = 0.139542857h * 0.6 = 0,083725714 minutes runtime.

So if you want to archive 20minutes operation time reaarange the formula:
525W/h * (1/3h) ((== 20 minutes)) = ~158Wh / 22.2V = ~7.1Ah

So you need a battery which have at least 7.1Ah capacity at 22.2V, assuming an average load of 0.25%.

Please consider, you will have a peak-load of 25A * 6 = 150A. This means the given battery (7100mAh) needs to support a minimum discharge current of 150A/7.1A = 21.12C.
If you don't respect these you battery might begin to burn, causing harm to your vehicle and the Environment".

Moreover you don't gave information about the consumption of any electronics inside the AUV, therefore this are not in the scope of this post.

Title: AUV Lipo Battery capacity


问:
How to control the speed of servo?
I am using FPGA board and servo, I read that with PWM I can control where the servo will rotate. If the duty cycle in PWM is 1.5 ms it goes to the center, if it is 2 ms it goes to clockwise and if it is 1 ms it rotates to counter-clockwise. But, I couldn’t find any clue on how to control the speed of the servo. Can you help me please?</p>

答:
Vary the voltage to the servo.
If your servo operates full power at 5V at 2.5V it will operate at half speed.

If your FPGA can output an analogue signal you could use that to drive the motor speed, otherwise you'll need to put in a DAC to get the analogue signal.

Title: How to control the speed of servo?


答:
Many of the dedicated servo-controlling boards include an option to set the speed for each servo. I know for a fact that the Pololu Maestro boards do (as I've used those myself), and I'd expect that the Lynxmotion and Adafruit branded boards also have that feature. But, FPGA boards don't have it built in. You'll need to create your own function to send a signal for incremental movements at an interval.

Lowering the voltage can work, but I believe that it lowers the torque as well, so that may not be ideal for your situation.

Title: How to control the speed of servo?

Body: I am using FPGA board and servo, I read that with PWM I can control where the servo will rotate. If the duty cycle in PWM is 1.5 ms it goes to the center, if it is 2 ms it goes to clockwise and if it is 1 ms it rotates to counter-clockwise. But, I couldn’t find any clue on how to control the speed of the servo. Can you help me please?</p>


答:
Short answer: your power supply is insufficient. You would be better off using a common wall wart charger.

If the servos are connected properly, they can move under three conditions: when they are first connected to power, when the power supply is insufficient, and when they are commanded to move. If you are using 4 AA batteries to control 6 or 7 standard servos, then I bet you don't have enough amps from those batteries.

When they are first connected (or re-connected) to power, they can move to the last position they were set at. Sometimes the servo head can be rotated (often accidentally) when the servo is off; so those heads will move back when they receive that power. They should stop once they have returned to that position. I'm not certain if they move to a location stored inside the servo's circuitry, or if that location is stored on the control board - it would make a difference, but either way this movement lasts maybe a tenth of a second so it's not really important.

Your case: BUT, when the power supply is insufficient, things can get weird - very weird. I've had servos jump up and down (when lifting a light load) as the batteries struggle to provide enough power. The servo was commanded to lift and did so for a bit, but then reached an angle where it didn't have sufficient torque, so the load fell instead, and this used the motor as a generator and pushed electricity back towards the batteries. After the load had fallen, less force was required to start the lift again and some of that returned power could be used, so the arm went up again - and the process repeated. AA batteries have decent amp-hours (which we incorrectly use to indicate total capacity), but really bad amperage (the actual flow rate of the energy). In fact, for usage at 1 amp, they absolutely suck. And with that many servos, you probably need 2 amps or more.

Otherwise, if the servos are moving on their own, then they are receiving a command from somewhere. It's possible/probable that they are not connected correctly, and thus are receiving signals when you don't think you are sending them. I think your diagram is correct - but keep in mind that the wiring color on these things isn't actually standardized (most of my servos are brown-red-orange, some are black-red-yellow, and some are black-red-white). It's easy to have something in backwards.

Fun fact: most wall wart chargers are 5v or 6v, and 2 amps. The specs should be printed somewhere on the charger. You can use one instead of (or in addition to) the batteries, at least if they are the same voltage. If you need more than that (and for an arm, you will), I suggest a dedicated power supply. You can get a 6V 10Amp (or 5Amp would be sufficient) supplies from Amazon/wherever fairly cheap. Or if you have a spare old computer sitting around, the computer's power supply has a +5V output with very good amperage if you want to use it.

Source: the chart on the lower-right of the first page of Duracell's AA datasheet: http://media.professional.duracell.com/downloads//datasheets/product/Ultra%20Power/Ultra-Power_AA_MX1500.pdf  that shows that AA cells, at 1.5V and 1000 mA, have a service life of practically no time at all. At anything above 100 mA, they are incredibly ineffective. Alkaline cells simply don't have the chemistry to deliver high current and high voltages at the same time.

Title: DC Servos moving randomly

Body:
First time asking a question on this Stackexchange, I hope I don't sound too dumb...

My daughter saw a documentary about robots and immediately asked me to build her a robotic arm. I found a nice one on Thingiverse: https://www.thingiverse.com/thing:2433

I'm done building it and I just finished wiring it up. I want to drive it from one of the Arduino Unos I have lying around at home. Starting the Sketch from the example found at Arduino.cc (https://www.arduino.cc/en/Tutorial/Knob) something unexpected happened when I connected just one of the DC servos it has (I haven't connected any other): as I plugged it on the board nearly ALL seven servos have begin to move erratically and for no reason at all. Not just the one I was trying to calibrate, but most of the. Even if the PWM cable of the motor was not even near to the Arduino pin.

The setup I have, is approximately the following

If someone could help me to understand what's missing, I would greatly appreciate it. Again, please be kind. I'm just a hobbyist trying to make my little girl happy.

Thanks in advance!


问:
Inverse kinematic orientation problem
I am trying IK for 5-DOF robot all revolute joint.

I am working IK with Jacobian inverse i.e

end effector velocity = J inverse * error vector.

In error vector I am feeding (x,y,z) positional error; this gives me correct positioning by first 3 joints only. later 2 joints are pitch and roll used for end effector orientation. How can I input my required orientation and calculate orientation error.

I have Jacobian matrix[6 X 5]  considering all 5 joints; so J inverse will be [5 X 6] matrix. Error vector [6 X 1] consisting first 3 element of positional error, but for last 3 element what should I feed to get required orientation for my robot and how would I calculate the orientation error and in which form I should input my orientation of end effector.

please help me out.

答:
Referring to the equation $\dot{x} = J(q)\dot{q}$, what the last three elements of $\dot{x}$ should be depends on what kind of Jacobian you are using.

Geometric Jacobian:
Suppose your Jacobian is computed as

$$J = \begin{bmatrix}J_1 & J_2 & \cdots J_n\end{bmatrix},$$

where

$$J_i = \begin{cases}
\begin{bmatrix}z_{i - 1}\\0_{3\times1}\end{bmatrix} & \text{the $i^\text{th}$ joint is revolute}\\
\begin{bmatrix}z_{i - 1} \times (o_n - o_{i - 1})\\z_{i - 1}\end{bmatrix} & \text{the $i^\text{th}$ joint is prismatic (linear)}
\end{cases},$$
$z_i$ is the axis of the $i^\text{th}$ joint and $o_i$ is the origin of the $i^\text{th}$ frame. This Jacobian is called the geometric Jacobian. In this case, the last three elements of $\dot{x}$ should be the angular velocity of the end-effector described w.r.t. the base frame.

Analytical Jacobian: This kind of Jacobian is computed based on representation of the orientation of the end-effector frame. This Jacobian ($J_a$) is related to the geometric Jacobian by $J_a = GJ$, for some matrix $G$. If the simulator is using this kind of matrix, the last three elements of $\dot{x}$ will depend of which representation of orientation is used to calculate the Jacobian.

The easiest way to see what the three elements of $\dot{x}$ should be may be just to try out different orientation representations and see the result.

The terminology here is quoted from Chapter 5 of Robots Dynamics and Control (Spong et al.).

Title: Inverse kinematic orientation problem


问:
Wheel odometry simulation using ground truth
I'm tracking the state of a robot $X=(x,y,\theta)$ where $x$ and $y$ are the ground coordinates and $\theta$ the heading angle.
I have the ground truth states $X_{gt}=(x_{gt},y_{gt},\theta_{gt})$.

I want to simulate the wheel odometry using the available gound truth data.
How to do it? Is it possible to only add random gaussian noise the $X_{gt}$?

In this case, how much should the variances be?

答:
You can't just take the ground truth states and get wheel encoder positions, or vice-versa, because the robot is nonholonomic. Nonholonomic is a fancy word that means "path dependent," essentially, and generally happens in robotics when you have fewer axes of control than degrees of freedom.

Consider a typical car (that uses Ackermann steering). In the car, you can go forward or backward (one axis of control), and you can turn the wheels left and right (a second axis of control). However, you can move sideways too, with a specific combination of moving forward and backward AND turning the wheels left and right. This is called parallel parking and is used to preserve the heading of the vehicle (parallel to the road) after moving the car to the outboard edge of the road.

So, in your car, you can change the forward/backward position, and the orientation, and the side-side position. The same goes with a differential steering robot - you can control the left and right sides independently, so only two axes of control.

With a differential steering robot (like a tank), you could turn right 90 degrees, move forward 10 meters, then turn left 90 degrees. The end effect is as though you translated sideways 10 meters. You could also turn right then left, then move forward 10 meters. The two turns "cancel" and the end result is that you've moved forward 10 meters.

So you can't look at rotations independent of linear translations. Going 100 miles and turning 180 degrees is a lot different than turning 180 degrees and going 100 miles. Similarly, just because the robot is at, say, a local origin, doesn't mean you can determine the wheel encoder counts. There may have been no motion (no encoder counts), or a forward/backward motion, or a circular motion.

Driving a circle would have the outboard wheels have higher counts than the inboard wheels, but both would be some net positive number of counts. Forward/backward would give net zero counts and both encoders would be even.

All this is to point out why it's not possible to go straight from position to absolute encoder counts or vice-versa. As with any path-dependent problem, the solution is to take an integral.

It's not clear how your robot is setup or how you're getting and changing the ground coordinates, but you need to convert the vehicle speed at the center of the vehicle to the linear speed at each wheel. You can then convert that to angular speed of the wheel (by dividing by the wheel circumference). Then you integrate. Multiply the angular speed of the wheel by however long the time step is in your simulation and add it to an existing "position" variable.

If you're going for high fidelity simulations, then I would personally opt to "bin" the results based on your simulated wheel encoder resolution than to just add bulk noise to the signal. If you had an 8 bit wheel encoder, then one rotation gets divided into 2^8 = 256 segments. Each segment is then (2*pi/256) = 24.5 mradians. You can keep an internal state that tracks the true wheel rotations, but only update the simulated wheel encoder if it rolls over into the next bin.

Consider the following code:

```<code>wheelLinearSpeed = <your wheel speed>;
angularSpeed = wheelLinearSpeed/wheelCircumference;
angularPosition = angularPosition + angularSpeed*dT;
encoderResolution = (2*pi) / (2^8);
encoderCounts = floor(angularPosition/encoderResolution);
</code>```

Another way to consider the last two lines is, instead of:

```<code>encoderResolution = (2*pi) / (2^8);
encoderCounts = floor(angularPosition/encoderResolution);
</code>```

you instead inverted encoderResolution and multiplied:

```<code>encoderCounts = floor(angularPosition * ((2^8) / 2*pi)) );
</code>```

This may be cleverly regrouped as:

```<code>encoderCounts = floor( (angularPosition/(2*pi)) * (2^8));
</code>```

Hopefully that expression makes it a little more clear - you're making a ratio of the current angular position to a complete revolution (angularPosition/(2*pi)), and using that to find the percentage of the total number of counts for one revolution.

Body:
You can't just take the ground truth states and get wheel encoder positions, or vice-versa, because the robot is nonholonomic. Nonholonomic is a fancy word that means "path dependent," essentially, and generally happens in robotics when you have fewer axes of control than degrees of freedom.

Consider a typical car (that uses Ackermann steering). In the car, you can go forward or backward (one axis of control), and you can turn the wheels left and right (a second axis of control). However, you can move sideways too, with a specific combination of moving forward and backward AND turning the wheels left and right. This is called parallel parking and is used to preserve the heading of the vehicle (parallel to the road) after moving the car to the outboard edge of the road.

So, in your car, you can change the forward/backward position, and the orientation, and the side-side position. The same goes with a differential steering robot - you can control the left and right sides independently, so only two axes of control.

With a differential steering robot (like a tank), you could turn right 90 degrees, move forward 10 meters, then turn left 90 degrees. The end effect is as though you translated sideways 10 meters. You could also turn right then left, then move forward 10 meters. The two turns "cancel" and the end result is that you've moved forward 10 meters.

So you can't look at rotations independent of linear translations. Going 100 miles and turning 180 degrees is a lot different than turning 180 degrees and going 100 miles. Similarly, just because the robot is at, say, a local origin, doesn't mean you can determine the wheel encoder counts. There may have been no motion (no encoder counts), or a forward/backward motion, or a circular motion.

Driving a circle would have the outboard wheels have higher counts than the inboard wheels, but both would be some net positive number of counts. Forward/backward would give net zero counts and both encoders would be even.

All this is to point out why it's not possible to go straight from position to absolute encoder counts or vice-versa. As with any path-dependent problem, the solution is to take an integral.

It's not clear how your robot is setup or how you're getting and changing the ground coordinates, but you need to convert the vehicle speed at the center of the vehicle to the linear speed at each wheel. You can then convert that to angular speed of the wheel (by dividing by the wheel circumference). Then you integrate. Multiply the angular speed of the wheel by however long the time step is in your simulation and add it to an existing "position" variable.

If you're going for high fidelity simulations, then I would personally opt to "bin" the results based on your simulated wheel encoder resolution than to just add bulk noise to the signal. If you had an 8 bit wheel encoder, then one rotation gets divided into 2^8 = 256 segments. Each segment is then (2*pi/256) = 24.5 mradians. You can keep an internal state that tracks the true wheel rotations, but only update the simulated wheel encoder if it rolls over into the next bin.

Consider the following code:

wheelLinearSpeed = <your wheel speed>;
angularSpeed = wheelLinearSpeed/wheelCircumference;
angularPosition = angularPosition + angularSpeed*dT;
encoderResolution = (2*pi) / (2^8);
encoderCounts = floor(angularPosition/encoderResolution);

Another way to consider the last two lines is, instead of:

encoderResolution = (2*pi) / (2^8);
encoderCounts = floor(angularPosition/encoderResolution);

you instead inverted encoderResolution and multiplied:

encoderCounts = floor(angularPosition * ((2^8) / 2*pi)) );

This may be cleverly regrouped as:

encoderCounts = floor( (angularPosition/(2*pi)) * (2^8));

Hopefully that expression makes it a little more clear - you're making a ratio of the current angular position to a complete revolution (angularPosition/(2*pi)), and using that to find the percentage of the total number of counts for one revolution.


问:
Robotics Toolbox: Display all DH link frames in Seriallink.plot()
I am using the Robotics Toolbox by Peter Corke to create a plot of a simple four-link robot. For an assignment, I want a figure of the robot with all frames according to the DH-convention. Though even after reading through the documentation and googling for an hour, I couldn't find an option.

Seriallink.plot(...) offers the options 'jaxis' and 'jvec', though they only display the joint axes, not the complete xyz-frame per link.

How can I get a plot of a robot with all DH frames included?

If this is not possible, is there any other way to quickly render such a plot from a DH table? I am almost tempted to do it on paper after already wasting so much time on such an easy task.

答: The easiest way to do this would be to use the trplot function (documented for v9 at http://www.petercorke.com/RTB/r9/html/trplot.html). You can simply call this function with the transformation matrices for each link and it will add frame axes in those locations.


问:
How can I estimate depth of a feature point / object using single camera?
I am trying to estimate depth of a feature point that i find in my image. I read this paper that estimates the depth using a motionless camera and an object of known height to calculate horizon line. I was wondering if its possible to use the same approach for a camera thats moving and object thats stationary.</p>

答:
Researchers from Davide Scaramuzza's group authored a paper in 2014 about a probabilistic technique called REMODE that estimates depth from a single moving camera. The algorithm performs per pixel depth estimation from a camera stream and regularization based on uncertainty estimation. It should be suitable for your application involving a moving camera and a stationary object.

The paper can be found here, and the implementation of the algorithm can be found at this repository. The implementation uses CUDA libraries, so you'd need access to an NVIDIA GPU to run it.


问:
Error starting image_view video_recorder using launch file
To record .avi video, I am using video_recorder for the image_view package. I want to do this through the launch file. Here is the how I put it in there

```<code><node pkg="image_view" type="video_recorder" name="video_record_$(arg camera_name)" machine="$(arg machine)" if="$(eval record and enable_camera)">
             <arg name="fps" value="$(arg frame_rate)" />
             <arg name="codec" value="HFYU" />
             <arg name="encoding" value="$(arg image_encoding)" />

     </node>
</code>```

I get error:

```<code>WARNING: WARN: unrecognized 'arg' child tag in the parent element:
</code>```

Unfortunately I could not find a go-to syntax for this and I am new to ROS. Any help is appreciated. Feel free to ask for more details.

答:
Those values are parameters, not arguments. You can refer to http://wiki.ros.org/image_view#image_view.2BAC8-diamondback.video_recorder for documentation about video_recorder. In that case, your launch file should treat them as parameters with the <param> tag.

```<code><node pkg="image_view" type="video_recorder" name="video_record_$(arg camera_name)" machine="$(arg machine)" if="$(eval record and enable_camera)">
     <param name="fps" value="$(arg frame_rate)" />
     <param name="codec" value="HFYU" />
     <param name="encoding" value="$(arg image_encoding)" />
</node>
</code>```

Notice the distinction between param and arg. 'arg' is an argument you're receiving from the commandline, which you're encoding as a parameter and sending to the node.

Body:
Those values are parameters, not arguments. You can refer to http://wiki.ros.org/image_view#image_view.2BAC8-diamondback.video_recorder for documentation about video_recorder. In that case, your launch file should treat them as parameters with the <param> tag.

<node pkg="image_view" type="video_recorder" name="video_record_$(arg camera_name)" machine="$(arg machine)" if="$(eval record and enable_camera)">
     <param name="fps" value="$(arg frame_rate)" />
     <param name="codec" value="HFYU" />
     <param name="encoding" value="$(arg image_encoding)" />
</node>

Notice the distinction between param and arg. 'arg' is an argument you're receiving from the commandline, which you're encoding as a parameter and sending to the node.


问:
Help with DC Gearmotor Specs
I need help understanding the specs of this RS Pro DC Geared Motor, Brushed, (RS: 238-9670).  It has an operating range of 4.5-15V and a nominal voltage of 12V, so does that mean that it provides 0.59Nm of torque and 84RPM when it's running at 12V?

If the voltage is reduced, the torque will go up and RPM will go down and if it's increased the RPM will go up and torque will go down?

答:
Yes, it will provide 0.59Nm of torque and 84RPM when it's running at 12V.

If voltage is reduced, RPM will go down and vice versa.

However, torque does not go up or down according to voltage. Torque is related to current. Higher torque is needed to lift heavier load, so the motor draws the required amount of current it needs from the battery to produce the torque needed.

Title: Help with DC Gearmotor Specs


问:
What are human-friendly terms for mobile-robot orientation and relative direction of non-robot objects?
Within robotics programming, orientation is primarily given in terms of x, y, & z coordinates, from some central location.  However x, y, z coordinates aren't convenient for rapid human understanding if there are many locations from which to select (e.g., {23, 34, 45}, {34, 23, 45}, {34, 32, 45}, {23, 43, 45} is not particularly human friendly, and is highly prone to human error).  Yet more common English orientation descriptors are frequently either too wordy or too imprecise for rapid selection (e.g.,  "front-facing camera on robot 1's right front shoulder" is too wordy; but "front"/ "forward" is too imprecise - is the camera on the leading edge or is it pointing forward?)

In the naval and aeronautical fields vehicle locations are generically talked about as fore, aft (or stern), port, and starboard. While, direction of movement that is relative to the vehicle is frequently given in reference to a clockface (e.g., forward of the the fore would be "at 12", rear of the aft would be "at 6", while right of starboard and left of port would be "at 3" and "at 9", respectively).  This language supports rapid human communication that is more precise than terms such as "front" and "forward".  Are there equivalent terms within mobile robotics?

答:
Roll, pitch and yaw and they could be understood by following images

Explanation 1

Explanation 2

Explanation 3


问:
Hacker friendly vacuum robots
I'm considering buying a vacuum robot.  At first I got excited at finding out that Roomba has an Open Interface.  Apparently this was taken out around model 800+ (?)   The newest models do not have an Open Interface.   What robot vacuums are open / hackable?   </p>

答: iRobot actually offers a robot geared toward developers/hackers, and is fairly affordable at $199: http://store.irobot.com/default/create-programmable-programmable-robot-irobot-create-2/RC65099.html?cgid=us&_ga=2.47072295.1402319966.1513450326-1687721061.1509919043 </p>

Title: Hacker friendly vacuum robots


问:
catkin_make unable to build and throws "Makefile:138: recipe for target 'all' failed make: *** [all] Error 2 Invoking "make -j4 -l4" failed"
I have been trying to build my ROS workspace using catkin_make, where i have cloned a repo/PACKAGE. I tried many of the things mentioned in previous answers to questions similar to my issue but without any progress. I tried building another package and it worked well. I am new to ROS and Linux, and this issue has been impeding me for a 3 days now.

Many thanks in advance!

```abouseif@abouseif-ThinkCentre-M92p:~/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws$ catkin_make
Base path: /home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws
Source space: /home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src
Build space: /home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/build
Devel space: /home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/devel
Install space: /home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/install
####
#### Running command: "cmake /home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/install -G Unix Makefiles" in "/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/kinetic
-- This workspace overlays: /opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.8
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 3 packages in topological order:
-- ~~  - gazebo_grasp_plugin
-- ~~  - kuka_arm
-- ~~  - kr210_claw_moveit
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'gazebo_grasp_plugin'
-- ==> add_subdirectory(RoboND-Kinematics-Project/gazebo_grasp_plugin)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   thread
--   signals
--   system
--   filesystem
--   program_options
--   regex
--   iostreams
--   date_time
--   chrono
--   atomic
-- Found Protobuf: /usr/lib/x86_64-linux-gnu/libprotobuf.so
-- Boost version: 1.58.0
-- Looking for OGRE...
-- OGRE_PREFIX_WATCH changed.
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for module 'OGRE'
--   Found OGRE, version 1.9.0
-- Found Ogre Ghadamon (1.9.0)
-- Found OGRE: optimized;/usr/lib/x86_64-linux-gnu/libOgreMain.so;debug;/usr/lib/x86_64-linux-gnu/libOgreMain.so
-- Looking for OGRE_Paging...
-- Found OGRE_Paging: optimized;/usr/lib/x86_64-linux-gnu/libOgrePaging.so;debug;/usr/lib/x86_64-linux-gnu/libOgrePaging.so
-- Looking for OGRE_Terrain...
-- Found OGRE_Terrain: optimized;/usr/lib/x86_64-linux-gnu/libOgreTerrain.so;debug;/usr/lib/x86_64-linux-gnu/libOgreTerrain.so
-- Looking for OGRE_Property...
-- Found OGRE_Property: optimized;/usr/lib/x86_64-linux-gnu/libOgreProperty.so;debug;/usr/lib/x86_64-linux-gnu/libOgreProperty.so
-- Looking for OGRE_RTShaderSystem...
-- Found OGRE_RTShaderSystem: optimized;/usr/lib/x86_64-linux-gnu/libOgreRTShaderSystem.so;debug;/usr/lib/x86_64-linux-gnu/libOgreRTShaderSystem.so
-- Looking for OGRE_Volume...
-- Found OGRE_Volume: optimized;/usr/lib/x86_64-linux-gnu/libOgreVolume.so;debug;/usr/lib/x86_64-linux-gnu/libOgreVolume.so
-- Looking for OGRE_Overlay...
-- Found OGRE_Overlay: optimized;/usr/lib/x86_64-linux-gnu/libOgreOverlay.so;debug;/usr/lib/x86_64-linux-gnu/libOgreOverlay.so
CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:166 (message):
  catkin_package() DEPENDS on 'gazebo' but neither 'gazebo_INCLUDE_DIRS' nor
  'gazebo_LIBRARIES' is defined.
Call Stack (most recent call first):
  /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
  RoboND-Kinematics-Project/gazebo_grasp_plugin/CMakeLists.txt:32 (catkin_package)

-- +++ processing catkin package: 'kuka_arm'
-- ==> add_subdirectory(RoboND-Kinematics-Project/kuka_arm)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- kuka_arm: 0 messages, 1 services
-- +++ processing catkin package: 'kr210_claw_moveit'
-- ==> add_subdirectory(RoboND-Kinematics-Project/kr210_claw_moveit)
-- Configuring done
WARNING: Target "trajectory_sampler" requests linking to directory "/opt/ros/kinetic/lib/roslib".  Targets may link only to libraries.  CMake is dropping the item.
-- Generating done
-- Build files have been written to: /home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/build
####
#### Running command: "make -j4 -l4" in "/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/build"
####
Scanning dependencies of target trajectory_msgs_generate_messages_lisp
Scanning dependencies of target actionlib_msgs_generate_messages_lisp
Scanning dependencies of target trajectory_msgs_generate_messages_nodejs
Scanning dependencies of target trajectory_msgs_generate_messages_py
[  0%] Built target trajectory_msgs_generate_messages_nodejs
[  0%] Built target actionlib_msgs_generate_messages_lisp
[  0%] Built target trajectory_msgs_generate_messages_lisp
[  0%] Built target trajectory_msgs_generate_messages_py
Scanning dependencies of target trajectory_msgs_generate_messages_eus
Scanning dependencies of target gazebo_msgs_generate_messages_py
Scanning dependencies of target dynamic_reconfigure_gencfg
Scanning dependencies of target dynamic_reconfigure_generate_messages_py
[  0%] Built target trajectory_msgs_generate_messages_eus
[  0%] Built target dynamic_reconfigure_generate_messages_py
[  0%] Built target gazebo_msgs_generate_messages_py
[  0%] Built target dynamic_reconfigure_gencfg
Scanning dependencies of target dynamic_reconfigure_generate_messages_cpp
Scanning dependencies of target dynamic_reconfigure_generate_messages_eus
Scanning dependencies of target dynamic_reconfigure_generate_messages_lisp
Scanning dependencies of target tf2_msgs_generate_messages_nodejs
[  0%] Built target dynamic_reconfigure_generate_messages_cpp
[  0%] Built target dynamic_reconfigure_generate_messages_eus
[  0%] Built target dynamic_reconfigure_generate_messages_lisp
[  0%] Built target tf2_msgs_generate_messages_nodejs
Scanning dependencies of target tf2_msgs_generate_messages_lisp
Scanning dependencies of target tf2_msgs_generate_messages_eus
Scanning dependencies of target tf2_msgs_generate_messages_cpp
Scanning dependencies of target dynamic_reconfigure_generate_messages_nodejs
[  0%] Built target tf2_msgs_generate_messages_lisp
[  0%] Built target tf2_msgs_generate_messages_eus
[  0%] Built target tf2_msgs_generate_messages_cpp
[  0%] Built target dynamic_reconfigure_generate_messages_nodejs
Scanning dependencies of target std_srvs_generate_messages_cpp
Scanning dependencies of target _catkin_empty_exported_target
Scanning dependencies of target roscpp_generate_messages_nodejs
Scanning dependencies of target tf_generate_messages_eus
[  0%] Built target std_srvs_generate_messages_cpp
[  0%] Built target _catkin_empty_exported_target
[  0%] Built target roscpp_generate_messages_nodejs
[  0%] Built target tf_generate_messages_eus
Scanning dependencies of target geometry_msgs_generate_messages_nodejs
Scanning dependencies of target std_msgs_generate_messages_lisp
Scanning dependencies of target roscpp_generate_messages_lisp
[  0%] Built target geometry_msgs_generate_messages_nodejs
Scanning dependencies of target geometry_msgs_generate_messages_lisp
[  0%] Built target std_msgs_generate_messages_lisp
[  0%] Built target roscpp_generate_messages_lisp
Scanning dependencies of target std_srvs_generate_messages_lisp
Scanning dependencies of target geometry_msgs_generate_messages_eus
[  0%] Built target geometry_msgs_generate_messages_lisp
Scanning dependencies of target roscpp_generate_messages_cpp
[  0%] Built target std_srvs_generate_messages_lisp
[  0%] Built target geometry_msgs_generate_messages_eus
Scanning dependencies of target actionlib_msgs_generate_messages_py
Scanning dependencies of target std_msgs_generate_messages_py
[  0%] Built target roscpp_generate_messages_cpp
Scanning dependencies of target gazebo_msgs_generate_messages_nodejs
[  0%] Built target actionlib_msgs_generate_messages_py
[  0%] Built target std_msgs_generate_messages_py
Scanning dependencies of target gazebo_msgs_generate_messages_cpp
[  0%] Built target gazebo_msgs_generate_messages_nodejs
Scanning dependencies of target std_msgs_generate_messages_nodejs
Scanning dependencies of target geometry_msgs_generate_messages_py
[  0%] Built target gazebo_msgs_generate_messages_cpp
Scanning dependencies of target trajectory_msgs_generate_messages_cpp
[  0%] Built target std_msgs_generate_messages_nodejs
[  0%] Built target geometry_msgs_generate_messages_py
Scanning dependencies of target geometry_msgs_generate_messages_cpp
[  0%] Built target trajectory_msgs_generate_messages_cpp
Scanning dependencies of target sensor_msgs_generate_messages_nodejs
Scanning dependencies of target rosgraph_msgs_generate_messages_cpp
[  0%] Built target geometry_msgs_generate_messages_cpp
Scanning dependencies of target rosgraph_msgs_generate_messages_nodejs
[  0%] Built target sensor_msgs_generate_messages_nodejs
[  0%] Built target rosgraph_msgs_generate_messages_cpp
[  0%] Built target rosgraph_msgs_generate_messages_nodejs
Scanning dependencies of target roscpp_generate_messages_eus
Scanning dependencies of target std_msgs_generate_messages_eus
Scanning dependencies of target std_srvs_generate_messages_py
Scanning dependencies of target gazebo_msgs_generate_messages_eus
[  0%] Built target roscpp_generate_messages_eus
[  0%] Built target std_msgs_generate_messages_eus
[  0%] Built target std_srvs_generate_messages_py
[  0%] Built target gazebo_msgs_generate_messages_eus
Scanning dependencies of target rosgraph_msgs_generate_messages_eus
Scanning dependencies of target std_srvs_generate_messages_eus
Scanning dependencies of target tf_generate_messages_cpp
Scanning dependencies of target actionlib_generate_messages_eus
[  0%] Built target rosgraph_msgs_generate_messages_eus
[  0%] Built target tf_generate_messages_cpp
[  0%] Built target actionlib_generate_messages_eus
[  0%] Built target std_srvs_generate_messages_eus
Scanning dependencies of target rosgraph_msgs_generate_messages_lisp
Scanning dependencies of target std_srvs_generate_messages_nodejs
Scanning dependencies of target gazebo_ros_gencfg
Scanning dependencies of target rosgraph_msgs_generate_messages_py
[  0%] Built target rosgraph_msgs_generate_messages_lisp
[  0%] Built target gazebo_ros_gencfg
[  0%] Built target rosgraph_msgs_generate_messages_py
[  0%] Built target std_srvs_generate_messages_nodejs
Scanning dependencies of target tf_generate_messages_lisp
Scanning dependencies of target roscpp_generate_messages_py
Scanning dependencies of target tf_generate_messages_py
Scanning dependencies of target tf_generate_messages_nodejs
[  0%] Built target tf_generate_messages_lisp
[  0%] Built target roscpp_generate_messages_py
[  0%] Built target tf_generate_messages_py
[  0%] Built target tf_generate_messages_nodejs
Scanning dependencies of target sensor_msgs_generate_messages_cpp
Scanning dependencies of target gazebo_msgs_generate_messages_lisp
Scanning dependencies of target sensor_msgs_generate_messages_lisp
Scanning dependencies of target sensor_msgs_generate_messages_py
[  0%] Built target sensor_msgs_generate_messages_cpp
[  0%] Built target gazebo_msgs_generate_messages_lisp
[  0%] Built target sensor_msgs_generate_messages_lisp
[  0%] Built target sensor_msgs_generate_messages_py
Scanning dependencies of target tf2_msgs_generate_messages_py
Scanning dependencies of target actionlib_generate_messages_cpp
Scanning dependencies of target std_msgs_generate_messages_cpp
Scanning dependencies of target actionlib_msgs_generate_messages_nodejs
[  0%] Built target actionlib_generate_messages_cpp
[  0%] Built target tf2_msgs_generate_messages_py
[  0%] Built target actionlib_msgs_generate_messages_nodejs
[  0%] Built target std_msgs_generate_messages_cpp
Scanning dependencies of target actionlib_msgs_generate_messages_cpp
Scanning dependencies of target sensor_msgs_generate_messages_eus
Scanning dependencies of target actionlib_generate_messages_py
Scanning dependencies of target actionlib_generate_messages_nodejs
[  0%] Built target sensor_msgs_generate_messages_eus
[  0%] Built target actionlib_msgs_generate_messages_cpp
[  0%] Built target actionlib_generate_messages_py
[  0%] Built target actionlib_generate_messages_nodejs
Scanning dependencies of target actionlib_generate_messages_lisp
Scanning dependencies of target actionlib_msgs_generate_messages_eus
Scanning dependencies of target graph_msgs_generate_messages_lisp
Scanning dependencies of target octomap_msgs_generate_messages_cpp
[  0%] Built target actionlib_generate_messages_lisp
[  0%] Built target actionlib_msgs_generate_messages_eus
[  0%] Built target octomap_msgs_generate_messages_cpp
[  0%] Built target graph_msgs_generate_messages_lisp
Scanning dependencies of target object_recognition_msgs_generate_messages_nodejs
Scanning dependencies of target object_recognition_msgs_generate_messages_lisp
Scanning dependencies of target octomap_msgs_generate_messages_py
Scanning dependencies of target moveit_msgs_generate_messages_lisp
[  0%] Built target object_recognition_msgs_generate_messages_nodejs
[  0%] Built target object_recognition_msgs_generate_messages_lisp
[  0%] Built target octomap_msgs_generate_messages_py
[  0%] Built target moveit_msgs_generate_messages_lisp
Scanning dependencies of target moveit_msgs_generate_messages_eus
Scanning dependencies of target object_recognition_msgs_generate_messages_eus
Scanning dependencies of target visualization_msgs_generate_messages_lisp
Scanning dependencies of target moveit_msgs_generate_messages_cpp
[  0%] Built target object_recognition_msgs_generate_messages_eus
[  0%] Built target visualization_msgs_generate_messages_lisp
[  0%] Built target moveit_msgs_generate_messages_eus
Scanning dependencies of target object_recognition_msgs_generate_messages_py
[  0%] Built target moveit_msgs_generate_messages_cpp
Scanning dependencies of target graph_msgs_generate_messages_cpp
Scanning dependencies of target _kuka_arm_generate_messages_check_deps_CalculateIK
[  0%] Built target object_recognition_msgs_generate_messages_py
Scanning dependencies of target shape_msgs_generate_messages_cpp
[  0%] Built target graph_msgs_generate_messages_cpp
Scanning dependencies of target graph_msgs_generate_messages_py
[  0%] Built target shape_msgs_generate_messages_cpp
Scanning dependencies of target moveit_msgs_generate_messages_nodejs
Scanning dependencies of target shape_msgs_generate_messages_py
[  0%] Built target moveit_msgs_generate_messages_nodejs
[  0%] Built target graph_msgs_generate_messages_py
[  0%] Built target shape_msgs_generate_messages_py
Scanning dependencies of target visualization_msgs_generate_messages_cpp
Scanning dependencies of target visualization_msgs_generate_messages_py
[  0%] Built target _kuka_arm_generate_messages_check_deps_CalculateIK
[  0%] Built target visualization_msgs_generate_messages_cpp
Scanning dependencies of target visualization_msgs_generate_messages_eus
[  0%] Built target visualization_msgs_generate_messages_py
Scanning dependencies of target object_recognition_msgs_generate_messages_cpp
Scanning dependencies of target visualization_msgs_generate_messages_nodejs
[  0%] Built target visualization_msgs_generate_messages_eus
Scanning dependencies of target octomap_msgs_generate_messages_eus
[  0%] Built target object_recognition_msgs_generate_messages_cpp
[  0%] Built target visualization_msgs_generate_messages_nodejs
[  0%] Built target octomap_msgs_generate_messages_eus
Scanning dependencies of target moveit_msgs_generate_messages_py
Scanning dependencies of target octomap_msgs_generate_messages_lisp
Scanning dependencies of target graph_msgs_generate_messages_eus
Scanning dependencies of target shape_msgs_generate_messages_lisp
[  0%] Built target moveit_msgs_generate_messages_py
[  0%] Built target octomap_msgs_generate_messages_lisp
[  0%] Built target graph_msgs_generate_messages_eus
Scanning dependencies of target kuka_arm_generate_messages_py
[  0%] Built target shape_msgs_generate_messages_lisp
Scanning dependencies of target shape_msgs_generate_messages_eus
[  8%] Generating Python code from SRV kuka_arm/CalculateIK
Scanning dependencies of target octomap_msgs_generate_messages_nodejs
Scanning dependencies of target kuka_arm_generate_messages_eus
[  8%] Built target shape_msgs_generate_messages_eus
[ 16%] Built target octomap_msgs_generate_messages_nodejs
[ 16%] Generating EusLisp code from kuka_arm/CalculateIK.srv
Scanning dependencies of target moveit_ros_planning_gencfg
[ 25%] Generating EusLisp manifest code for kuka_arm
[ 25%] Built target moveit_ros_planning_gencfg
Scanning dependencies of target graph_msgs_generate_messages_nodejs
[ 25%] Built target graph_msgs_generate_messages_nodejs
Scanning dependencies of target moveit_ros_manipulation_gencfg
[ 25%] Built target moveit_ros_manipulation_gencfg
Scanning dependencies of target kuka_arm_generate_messages_cpp
[ 33%] Generating C++ code from kuka_arm/CalculateIK.srv
Scanning dependencies of target kuka_arm_generate_messages_nodejs
[ 41%] Generating Javascript code from kuka_arm/CalculateIK.srv
[ 50%] Generating Python srv __init__.py for kuka_arm
[ 50%] Built target kuka_arm_generate_messages_nodejs
Scanning dependencies of target shape_msgs_generate_messages_nodejs
[ 50%] Built target shape_msgs_generate_messages_nodejs
Scanning dependencies of target gazebo_grasp_fix
[ 50%] Built target kuka_arm_generate_messages_py
Scanning dependencies of target kuka_arm_generate_messages_lisp
[ 58%] Generating Lisp code from kuka_arm/CalculateIK.srv
[ 58%] Built target kuka_arm_generate_messages_cpp
[ 58%] Built target kuka_arm_generate_messages_lisp
[ 75%] Building CXX object RoboND-Kinematics-Project/gazebo_grasp_plugin/CMakeFiles/gazebo_grasp_fix.dir/src/GazeboGraspFix.cpp.o
[ 75%] Building CXX object RoboND-Kinematics-Project/gazebo_grasp_plugin/CMakeFiles/gazebo_grasp_fix.dir/src/GazeboGraspGripper.cpp.o
[ 75%] Built target kuka_arm_generate_messages_eus
Scanning dependencies of target kuka_arm_generate_messages
Scanning dependencies of target trajectory_sampler
[ 75%] Built target kuka_arm_generate_messages
[ 83%] Building CXX object RoboND-Kinematics-Project/kuka_arm/CMakeFiles/trajectory_sampler.dir/src/trajectory_sampler.cpp.o
/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src/RoboND-Kinematics-Project/kuka_arm/src/trajectory_sampler.cpp: In constructor ‘TrajectorySampler::TrajectorySampler(ros::NodeHandle)’:
/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src/RoboND-Kinematics-Project/kuka_arm/src/trajectory_sampler.cpp:180:43: error: cannot convert ‘moveit::planning_interface::MoveItErrorCode’ to ‘bool’ in initialization
     bool success = move_group.plan(my_plan);
                                           ^
/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src/RoboND-Kinematics-Project/kuka_arm/src/trajectory_sampler.cpp:224:15: error: cannot convert ‘moveit::planning_interface::MoveItErrorCode’ to ‘bool’ in assignment
       success = move_group.execute(my_plan);
               ^
/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src/RoboND-Kinematics-Project/kuka_arm/src/trajectory_sampler.cpp:291:39: error: cannot convert ‘moveit::planning_interface::MoveItErrorCode’ to ‘bool’ in initialization
         bool worked = move_group.move();
                                       ^
/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src/RoboND-Kinematics-Project/kuka_arm/src/trajectory_sampler.cpp:313:13: error: cannot convert ‘moveit::planning_interface::MoveItErrorCode’ to ‘bool’ in assignment
     success = move_group.move();
             ^
/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src/RoboND-Kinematics-Project/kuka_arm/src/trajectory_sampler.cpp:339:13: error: cannot convert ‘moveit::planning_interface::MoveItErrorCode’ to ‘bool’ in assignment
     success = move_group.move();
             ^
/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src/RoboND-Kinematics-Project/kuka_arm/src/trajectory_sampler.cpp:351:13: error: cannot convert ‘moveit::planning_interface::MoveItErrorCode’ to ‘bool’ in assignment
     success = move_group.plan(my_plan);
             ^
/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src/RoboND-Kinematics-Project/kuka_arm/src/trajectory_sampler.cpp:375:15: error: cannot convert ‘moveit::planning_interface::MoveItErrorCode’ to ‘bool’ in assignment
       success = move_group.execute(my_plan);
               ^
/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src/RoboND-Kinematics-Project/kuka_arm/src/trajectory_sampler.cpp:452:39: error: cannot convert ‘moveit::planning_interface::MoveItErrorCode’ to ‘bool’ in initialization
         bool worked = move_group.move();
                                       ^
/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src/RoboND-Kinematics-Project/kuka_arm/src/trajectory_sampler.cpp:497:13: error: cannot convert ‘moveit::planning_interface::MoveItErrorCode’ to ‘bool’ in assignment
     success = move_group.move();
             ^
/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src/RoboND-Kinematics-Project/kuka_arm/src/trajectory_sampler.cpp: In member function ‘bool TrajectorySampler::OperateGripper(const bool&)’:
/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src/RoboND-Kinematics-Project/kuka_arm/src/trajectory_sampler.cpp:543:33: error: cannot convert ‘moveit::planning_interface::MoveItErrorCode’ to ‘bool’ in initialization
   bool success = eef_group.move();
                                 ^
RoboND-Kinematics-Project/kuka_arm/CMakeFiles/trajectory_sampler.dir/build.make:62: recipe for target 'RoboND-Kinematics-Project/kuka_arm/CMakeFiles/trajectory_sampler.dir/src/trajectory_sampler.cpp.o' failed
make[2]: *** [RoboND-Kinematics-Project/kuka_arm/CMakeFiles/trajectory_sampler.dir/src/trajectory_sampler.cpp.o] Error 1
CMakeFiles/Makefile2:3178: recipe for target 'RoboND-Kinematics-Project/kuka_arm/CMakeFiles/trajectory_sampler.dir/all' failed
make[1]: *** [RoboND-Kinematics-Project/kuka_arm/CMakeFiles/trajectory_sampler.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 91%] Linking CXX shared library /home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/devel/lib/libgazebo_grasp_fix.so
[ 91%] Built target gazebo_grasp_fix
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed
```

答:
Met similar problem.

Changed
    bool success = move_group.move()
to
    bool success = move_group.move() == moveit::planning_interface::MoveItErrorCode::SUCCESS

<s>Perhaps the update is messing with the code.</s> https://robotics.stackexchange.com/a/14949/19080


问:
Optimal Control for a simple pendulum
I'm studying various optimal control methods (and implements them in Matlab), and as test case I choose (for now) a simple pendulum (fixed to the ground), which I want to control to the upper position.

I managed to control it using "simple" feedback method (swing-up based on energy control + LQR stabilization for the upper position), and the state trajectory is show in figure (I forgot the axis description: x is theta, y is theta dot.

Now I want to try a "full" optimal control method, starting with an iterative LQR method (which I found implemented here http://homes.cs.washington.edu/~todorov/software/ilqg_det.m)

The method requires one dynamic function and one cost function (x = [theta; theta_dot], u is the motor torque (one motor only)):

```<code>function [xdot, xdot_x, xdot_u] = ilqr_fnDyn(x, u)
    xdot = [x(2);
        -g/l * sin(x(1)) - d/(m*l^2)* x(2) + 1/(m*l^2) * u];
    if nargout > 1
        xdot_x = [ 0, 1;
            -g/l*cos(x(1)), -d/(m*l^2)];
        xdot_u = [0; 1/(m*l^2)];
    end
end

function [l, l_x, l_xx, l_u, l_uu, l_ux] = ilqr_fnCost(x, u, t)
    %trying J = x_f' Qf x_f + int(dt*[ u^2 ])
    Qf = 10000000 * eye(2);
    R = 1;
    wt = 1;
    x_diff = [wrapToPi(x(1) - reference(1)); x(2)-reference(2)];

    if isnan(t)
        l = x_diff'* Qf * x_diff;
    else
        l = u'*R*u;
    end

    if nargout > 1
        l_x = zeros(2,1);
        l_xx = zeros(2,2);
        l_u = 2*R*u;
        l_uu = 2 * R;
        l_ux = zeros(1,2);

        if isnan(t)
            l_x = Qf * x_diff;
            l_xx = Qf;
        end
    end
end
</code>```

Some info on the pendulum: the origin of my system is where the pendulum is fixed to the ground. The angle theta is zero in the stable position (and pi in the unstable/goal position).
m is the bob mass, l is the rod length, d is a damping factor (for simplicity I put m=1, l=1, d=0.3)

My cost is simple: penalize the control + the final error.

This is how I call the ilqr function

```<code>tspan = [0 10];
dt = 0.01;
steps = floor(tspan(2)/dt);
x0 = [pi/4; 0];
umin = -3; umax = 3;
[x_, u_, L, J_opt ] = ilqg_det(@ilqr_fnDyn, @ilqr_fnCost, dt, steps, x0, 0, umin, umax);
</code>```

This is the output

Time From 0 to 10. Initial conditions: (0.785398,0.000000). Goal: (-3.141593,0.000000)
   Length: 1.000000, mass: 1.000000, damping :0.300000

Using Iterative LQR control

Iterations = 5;  Cost = 88230673.8003

the nominal trajectory (that is the optimal trajectory the control finds) is

The control is "off"... it doesn't even try to reach the goal...
What am I doing wrong? (the algorithm  from Todorov seems to work.. at least with his examples)

答:
Without going through all your code (that would be too much like real work), my gut feel is that you have weighted your control effort heavily enough that the least-cost thing to do is to do nothing and live with the error.

Yes, I know -- all your explicit weights are unity.  But still -- try giving the control effort a lower weight, or the position error a higher one.

Again without getting deeply into your code, your ilrq function may not "understand" the nonlinear nature of the thing you're controlling.  As such, it may not see a way to get to the pendulum upright position, and again, it may fail.

The approach that you first tried, to put just the right amount of energy into the pendulum, then regulate optimally once the pendulum is erect, is probably the best way: you know that in the absence of friction, a system with just the perfectly right amount of energy is going to end up standing still on top (however briefly), so that would seem a sensible place to start.

Title: Optimal Control for a simple pendulum


问:
Questions about SLAM: bundle adjustment, covariance etc
I have been recently studying about the SLAM family of algorithms, with the idea of implementing some for a multi-robot framework I have. With regards to the concept, I have a couple of related questions. For the sake of the questions, I am assuming a camera based SLAM framework.

I read that bundle adjustment in SLAM is usually performed in the pose graph formulation of the problem (say, when a loop closure is detected, or when keyframes are added), as opposed to the EKF type of SLAM. Is that correct? How can a pose graph formulation/BA framework keep track of the covariances of the robot(s)? Assuming I am not interested in the uncertainty of the map points, but only the quality of the poses of the robot(s).

Assuming I have a known map of 3D points, and a robot that is navigating by observing these points, while computing its pose through the PNP algorithm or an equivalent. Is it possible to refine each pose individually by solving the non linear least squares problem of minimizing the reprojection error?

If I have multiple sensors on the robot, or if I have multiple robots with access to relative measurements, the conventional way of performing sensor fusion or fusion between relative and individual measurements (covariance intersection etc.) is usually geared towards a Kalman filter framework. Can additional information such as this be incorporated in a graph based SLAM as well?

答:
An answer to Question 2:
Yes, you can refine each pose individually. PNP algorithm needs 3D-2D correspondences. Since your 3D points are known, if their corresponding pixel positions in one particular image are known, then the camera pose for that image can be solved by PNP. It is used by the researchers of this paper: https://www.graphics.rwth-aachen.de/publication/0315/

The way to find the correspondence in your case in a computer vision problem. You can compute 2D image feature descriptors while forming the 3D map and assigning these features to the 3D points. Let's call them $F_1$. Compute descriptors $F_2$ for any new image, whose pose you need to compute. Match these descriptors and then you have correspondences.