答:
What I think you are asking:

Given a map of the environment (e.g., the positions of landmarks), and a sensor that can measure the location of these landmarks, is odometry required when the position of the robot can be uniquely determined from the landmark measurements?

My answer:

In short, yes. If every measurement can be uniquely associated with a large enough set of landmarks, you can get a unique estimate of your position. Note I said "estimate" of your position. Of course there will still be uncertainty of your estimate because your measurement of the landmarks will not be perfect. However, here are a couple reasons having odometry in this situation would be helpful anyway:

As an initial guess. A lot of data association algorithms work much better if you have a good initial guess. Having odometry here helps increase the likelihood of a good match. It helps you make the correct choice between two possible matches, for example.

To help deal with infrequent or highly uncertain landmark measurements. There are often situations where your landmark measurements won't be very good for stretches of time. Maybe you briefly were in an unmapped or poorly mapped area. Maybe the environment has changed. Maybe something is interfering with how your sensor is working (e.g., different lighting). If you are not constantly getting good updates based on measurements of the environment, it could lead to unrecoverable errors. Odometry gives you a (dead-reckoning) estimate during this time, making recovery easier when you start to get good landmark measurements again.

In short, you need to ask yourself: Is the map very good? Does it full cover the operational area (i.e., is it possible for the robot to take measurements of things not in the map)? Is it possible the map has changed? Does the sensor work well in different conditions? Is the data association algorithm reliable for different amounts of noise? Will the updates provided by the sensor be frequent enough based on how fast the robot is travelling? Etc.

Title: Need of Kalman filters in unimodal measurement model

Body: I have recently been studying Kalman filters. I was wondering that if sensor model of a robot gives a unimodal Gaussian ( as is assumed for LKF) and the environment is pre-mapped, then the sensor reading can be completely trusted( ie. max value of Kalman gain), removing the need for odometry for localization or target tracking purposes and hence the need for the Kalman filter. Please Clarify.


问:
Best practice to write a ROS service for a serial-communication class with many options
I have been asked to write code to implement serial communications with a camera in order to control its pedestal (movable base) as well as set a few dozen other camera options. The catch is that I have to make it usable by ROS.

What would be the best practice to implement this functionality in ROS? I understand  the concept of services, but I think that there should be a better way than creating a different service/file for each option.

Thanks,
Daniel.

答:
Why not write a subscription based node? It could take messages from whoever then passes the information on to the camera. From what you've said, it seems like a service wouldn't be necessary.  </p>

<p>Response. Yes. Create a new message that has all the necessary fields and a new topic, maybe /camera_parameters. </p>

ContentLicense: CC BY-SA 3.0

Body:
Why not write a subscription based node? It could take messages from whoever then passes the information on to the camera. From what you've said, it seems like a service wouldn't be necessary.

Response. Yes. Create a new message that has all the necessary fields and a new topic, maybe /camera_parameters.


问:
Does RRT* guarantee asymptotic optimality for a minimum clearance cost metric?
The optimal sampling-based motion planning algorithm $\text{RRT}^*$ (described in this paper) has been shown to yield collision-free paths which converge to the optimal path as planning time increases. However, as far as I can see, the optimality proofs and experiments have assumed that the path cost metric is Euclidean distance in configuration space. Can $\text{RRT}^*$ also yield optimality properties for other path quality metrics, such as maximizing minimum clearance from obstacles throughout the path?

To define minimum clearance: for simplicity, we can consider a point robot moving about in Euclidean space. For any configuration $q$ that is in the collision-free configuration space, define a function $d(q)$ which returns the distance between the robot and the nearest C-obstacle. For a path $\sigma$, the minimum clearance $\text{min_clear}(\sigma)$ is the minimum value of $d(q)$ for all $q \in \sigma$. In optimal motion planning, one might wish to maximize minimum clearance from obstacles along a path. This would mean defining some cost metric $c(\sigma)$ such that $c$ increases as the minimum clearance decreases. One simple function would be $c(\sigma) = \exp(-\text{min_clear}(\sigma))$.

In the first paper introducing $\text{RRT}^*$, several assumptions are made about the path cost metric so that the proofs hold; one of the assumptions concerned additivity of the cost metric, which doesn't hold for the above minimum clearance metric. However, in the more recent journal article describing the algorithm, several of the prior assumptions weren't listed, and it seemed that the minimum clearance cost metric might also be optimized by the algorithm.

Does anyone know if the proofs for the optimality of $\text{RRT}^*$ can hold for a minimum clearance cost metric (perhaps not the one I gave above, but another which has the same minimum), or if experiments have been performed to support the algorithm's usefulness for such a metric?

答:
*Note, $a|b$ is the concatenation of paths $a$ and $b$. Then $c(\cdot)$ defined as the minimum clearance implies $c(a|b)=min(c(a),c(b))$

You refer to (in reference 1):

Theorem 11: (Additivity of the Cost Function.)
  For all
  $\sigma_1$,$\sigma_2$ $\in X_{free}$
  , the cost function c satisﬁes the following:
  $c(\sigma_1|\sigma_2) = c(\sigma_1) + c(\sigma_2)$

Which has become (in reference 3, Problem 2):

The cost function is assumed to be monotonic, in the sense that
  for all $\sigma_1,\sigma_2\in\Sigma:c(\sigma_1)\leq c(\sigma_1|\sigma_2)$

Which is still not the case for minimum clearance distance.

Update: Given the relaxed restriction on path costs, your suggested exp(-min_clearance) seems fine.


问:
Help with code that is supposed to drive a servo controller
I posted a similar question before as I was just getting started with the project but I wasn't specific enough so got a weak response from the SE community. But now I am at a point where I have Python code which is supposed to rotate a servo through Pololu's Maestro Serial servo controller (https://www.pololu.com/product/207). Based on the "Serial Interface" section of the user's guide (https://www.pololu.com/product/207/resources), I sent a sequence of numbers starting with decimal 170 and 12, which are the "first command byte" and the "device number data byte", respectively. The user guide says that 12 is the default device number, so I tried changing it to 18 because that's how many servos my servo controller can drive. But that doesn't make much difference because the servo doesn't rotate at all. The numbers after that are the same as the example from the user's guide. I am not sure what the 4, 112 and 46 are doing, but the 0 targets the servo port "0" on the servo controller (the port to which my servo is connected). The servo doesn't move, regardless of what sequence of numbers I put in. I have very little experience, so if you guys could point me in the right direction or at least point to some useful resources on the web, I'd be very grateful.</p>

```<code>import serial
import struct
import time
import Adafruit_BBIO.UART as UART

drive_Motor_Port = serial.Serial(port = "/dev/ttyO1", baudrate=9600)
drive_Motor_Port.close()
drive_Motor_Port.open()

drive_Motor_Port.write(chr(170)); # User guide says we must start with OxAA = 170
drive_Motor_Port.write(chr(18)); # Device number
drive_Motor_Port.write(chr(04));
drive_Motor_Port.write(chr(00));
drive_Motor_Port.write(chr(112));
drive_Motor_Port.write(chr(46));

time.sleep(5);
</code>```

答:
According to the manual you link, byte 3 '04' is the command.

Command 4: Set Position, Absolute (2 data bytes)
  This command allows direct control of the internal servo position variable. Neutral,
  range, and direction settings do not affect this command. Data 2 contains the lower 7
  bits, and Data 1 contains the upper bits. The range of valid values is 500 through 5500.
  Setting a servo position will automatically turn the servo on.

if the valid values are from 500 to 5500 the values you have in Byte 5 and 6 are out of range, and the manual is not clear as to the effect this will have.

PS Doesn't it say byte 1 is supposed to be 128?


问:
What was the earliest concept of a robot?
I'm a highschool student studying electronics and for an assessment task on the history of electronics I have decided to focus on the history of robotics. I want to begin with the earliest possible concept of a robot and progress through major developments in robotics to the current day. Where should I begin my research?</p>

答:
You can find some nice presentations on prezi about robotic history (and about many other topics).

For example this or this or this presentations mention the ancient greek Archytas's robotic pigeon well before Leonardo's work around 350 B.C. and the klepsydra from around 300 B.C. having a feedback control system.


问:
Suggestions for beginer in Robotics
I am beginner in Robotics.I want to make serious start from scratch with interest but confused from where to start.So can anyone give some suggestions for 1.As a beginner in robotics ,are there some simple and basic robots or circuit
designs which I can make by myself in the home(so that I can gain practical knowledge of robots)? 2.or should I first read books (can anyone suggest some good reference  book names,articles ,links,free on-line  video lecture series)?

答:
i wanna recommend to you 2 book :
[1]: Craig, John J. Introduction to robotics: mechanics and control. Addison-Wesley, 1989.

[2]: Spong, Mark W., Seth Hutchinson, and Mathukumalli Vidyasagar. Robot modeling and control. Wiley, 2006.
First book said simply lesson , you can esaily figure out
i have studied both of them .

Title: Suggestions for beginer in Robotics


问:
Is Khepera II still adequate for learning
A professor in my university is asking me to study robotics with him. By robotics I understand programming a robot to move around, avoid obstacles, figure out a maze, etc.. He sent me some manuals for Khepera II.

When I first read the specs, I was surprised by the low specs:

Motorola 68331 CPU @ 25 MHz

512 KB RAM

512 KB Flash

But then I looked at some of the new Arduino boards and they had similar specs.
So maybe that's OK, I guess the CPU speed and RAM aren't that important if I'm going to control the robot from a normal computer that can handle real time computation.

What about the software? I glanced at the manuals and saw only C and assembly code.

Khepera I is from 1995 and Khepera II is from 2001. I think robots have advanced much since 2001.

Is using Khepera II adequate for university level learning, considering I can probably give 200-300$ for a newer one?

I ask in terms of hardware of the board, motors and sensors, as well as in the programmability. This question might seem vague. I'm ready to improve it by giving more detail upon request.

答:
The only thing that might make a difference for you is if you are less comfortable in programming with C or assembly.
The principles and techniques you learn will be able to be applied regardless of the underlying hardware and software.
I was doing some autonomous mobile robotics programming at the University of Connecticut in the early 90's and while there have been changes to servos and sensors the fundamentals are still, well, fundamental.</p>


问:
Ball and plate possible sensors use
I am looking  for sensors to give me the position of a ball  on a plate in order to make a ball and plate problem  .

What came to my mind is to use image processing but since i never did some serious image processing i don't know if it is a good idea.

Eventually can you please help me to find some 'cheap' sensors in order to get the position of the ball on the plate.

Thank you for your attention.

答:
Image processing is a valid solution to the ball on a plate problem. It will give you a very accurate estimate of the position of the ball. You should be able to do this with a raspberry pi. With regard to sensors, any cheap webcam should do the trick.

The vision processing involved will be trivial if you are familiar with python or c++.

Title: Ball and plate possible sensors use


问:
What is the best software/package to draw the robot manipulator and indicate DH parameters and different axes?
I'm wondering about good software/package to draw the robot manipulator and indicate DH parameters and different axes?

Any suggestions!

答: Many kinematics software packages let you easily specify the robot dimensions in an xml format.  You describe the translations and rotations between joints in vectors, quaternions, rotation matrices, etc. and not in DH parameters.  For example: OpenRave XML format, and ROS MoveIt! URDF format.</p>


答:
You might want to look at using a Resistive Touch Panel.

These are the kinds of touchscreens used on older devices that can only accept a single point of input. They work by returning a resistance of x, and of y, to determine the position on the screen.

Using one of these would require significantly less code, and processing power then using vision processing. The ball could simple sit on this plate, and as it rolls around, you will be able to determine the exact XY coordinate of the ball.

By doing a simple Google search and find hundreds, of all sizes, with or without an LCD attached.

Here is an example of what I imagine you are trying to do. The position of this ball is measured by a Resistive touch panel. YouTube Link

Title: Ball and plate possible sensors use

Body:
I am looking  for sensors to give me the position of a ball  on a plate in order to make a ball and plate problem  .

What came to my mind is to use image processing but since i never did some serious image processing i don't know if it is a good idea.

Eventually can you please help me to find some 'cheap' sensors in order to get the position of the ball on the plate.

Thank you for your attention.


答:
Great to see bright new minds interested in the field.

If you are a student you might want to look into F.I.R.S.T. Robotics, or For Inspiration and Recognition of Science and Technology.

This is not something you can do yourself at home, but it is a program that I would highly recommend, and you will be able to join any team, need not any prior experiences;the community is about sharing our knowledge with others.

This is a program based primarily in the US with teams across the world that is dedicated to inspiring young minds in the arts.

On the main page, you can go to the Programs section and select a program for more information.

I do not know your age, but this may help others as well:

F.L.L. (Grades 4 to 8)

F.T.C. (Grades 7 to 12)

F.R.C. (Grades 9 to 12)

They also have available an event / team finder so you can check it out if you want!

Event & Team Finder

Title: Suggestions for beginer in Robotics

Body:
I am beginner in Robotics.I want to make serious start from scratch with interest but confused from where to start.So can anyone give some suggestions for 1.As a beginner in robotics ,are there some simple and basic robots or circuit
designs which I can make by myself in the home(so that I can gain practical knowledge of robots)? 2.or should I first read books (can anyone suggest some good reference  book names,articles ,links,free on-line  video lecture series)?


问:
Choosing motors for 2 wheel drive robot
I am making a 2 wheel drive robot.

Suppose I know that my robot is going to weight x kg when finished and I know the diameter of the wheels y (geared motors will be connected directly to the wheels). I can choose from several geared motors and I know the peak torque of each motor and the idling speed.

How can I calculate the load that a specific motor can take? I.e. will a motor with a given torque be able to move my robot without being too overloaded? What rpm will the motor have when it has load?

答: There are really nice on-line calculators on societyofrobots including a robot motor factor calculator that could be helpful for you.</p>

Title: Choosing motors for 2 wheel drive robot


问:
Jacobian-based trajectory following
I would like to control my 7 DOF robot arm to move along a Cartesian trajectory in the world frame.  I can do this just fine for translation, but I am struggling on how to implement something similar for rotation.  So far, all my attempts seem to go unstable.

The trajectory is described as a translational and rotational velocity, plus a distance and/or timeout stopping criteria.  Basically, I want the end-effector to move a short distance relative to its current location.  Because of numerical errors, controller errors, compliance, etc, the arm won't be exactly where you wanted it from the previous iteration.  So I don't simply do $J^{-1}v_e$.  Instead, I store the pose of the end-effector at the start, then at every iteration I compute where the end-effector should be at the current time, take the difference between that and the current location, then feed that into the Jacobian.

I'll first describe my translation implementation.  Here is some pseudo OpenRave Python:

```<code># velocity_transform specified in m/s as relative motion
def move(velocity_transform):
  t_start = time.time()
  pose_start = effector.GetTransform()
  while True:
    t_now = time.time()
    t_elapsed = t_now - t_start
    pose_current = effector.GetTransform()
    translation_target = pose_start[:3,3] + velocity_transform[:3,3] * t_elapsed
    v_trans = translation_target - pose_current[:3,3]
    vels = J_plus.dot(v_trans) # some math simplified here
</code>```

The rotation is a little trickier.  To determine the desired rotation at the current time, i use Spherical Linear Interpolation (SLERP).  OpenRave provides a quatSlerp() function which I use.  (It requires conversion into quaternions, but it seems to work).  Then I calculate the relative rotation between the current pose and the target rotation.  Finally, I convert to Euler angles which is what I must pass into my AngularVelocityJacobian.  Here is the pseudo code for it.  These lines are inside the while loop:

```<code>rot_t1 = np.dot(pose_start[:3,:3], velocity_transform[:3,:3]) # desired rotation of end-effector 1 second from start
quat_start = quatFromRotationMatrix(pose_start) # start pose as quaternion
quat_t1 = quatFromRotationMatrix(rot_t1) # rot_t1 as quaternion

# use SLERP to compute proper rotation at this time
quat_target = quatSlerp(quat_start, quat_t1, t_elapsed) # world_to_target
rot_target = rotationMatrixFromQuat(quat_target) # world_to_target
v_rot = np.dot(np.linalg.inv(pose_current[:3,:3]), rot_target) # current_to_target
v_euler = eulerFromRotationMatrix(v_rot) # get rotation about world axes
</code>```

Then v_euler is fed into the Jacobian along with v_trans.  I am pretty sure my Jacobian code is fine.  Because i have given it (constant) rotational velocities ok.

Note, I am not asking you to debug my code.  I only posted code because I figured it would be more clear than converting this all to math.  I am more interested in why this might go unstable.  Specifically, is the math wrong?  And if this is completely off base, please let me know.  I'm sure people must go about this somehow.

So far, I have been giving it a slow linear velocity (0.01 m/s), and zero target rotational velocity.  The arm is in a good spot in the workspace and can easily achieve the desired motion.  The code runs at 200Hz, which should be sufficiently fast enough.

I can hard-code the angular velocity fed into the Jacobian instead of using the computed v_euler and there is no instability.  So there is something wrong in my math.  This works for both zero and non-zero target angular velocities.  Interestingly, when i feed it an angular velocity of 0.01 rad/sec, the end-effector rotates at a rate of 90 deg/sec.

Update: If I put the end-effector at a different place in the workspace so that its axes are aligned with the world axes, then everything seems works fine.  If the end-effector is 45 degrees off from the world axes, then some motions seem to work, while others don't move exactly as they should, although i don't think i've seen it go unstable.  At 90 degrees or more off from world, then it goes unstable.

答:
The math required to deal with the orientation error (in terms of error with respect to both desired position and desired velocity) is well described in the book of Sciavicco-Siciliano. See section 3.7.3 starting from page 137.

I'm personally employing the axis-angle notation, thus I coded the formula (3.89) given at page 139 with correct results.

In short, given the goal of tracking a 6D trajectory in the Cartesian space both in position and velocity, the inputs are $\left(p_d,\dot{p}_d\right)$ for the translational part and $\left(\theta_d,\omega_d\right)$ for the orientation part (axis-angle). The inputs are meant to be time varying (i.e. $p_d \equiv p_d\left(t\right)$). Then, the dynamics of the error is analyzed (see e.g. section 3.7.1) to come up with a convergence rule whose $\mathbin{K}_P$ and $\mathbin{K}_O$ are the positive definite matrices gains acting on the error itself. These matrices set just the convergence speed.

I didn't go into your code, but this formula, as different versions of it, makes use of the pseudo-inverse of the Jacobian to allow producing step-by-step the joint velocities required to drive the manipulator towards the target position and orientation of the end-effector with approximately the specified Cartesian speed.

Update

Following up our discussion below in the comments, to give you a very basic point in the code where to start from, take a glace at these lines. They are part of a method computing the Cartesian error, which is in turn an important piece of our operational space controller we use with the iCub.

Imagine now that ctrlPose==IKINCTRL_POSE_FULL; all the lines 102 => 118 will be then executed. The first block computes the translational error, while the second block implements the formula (3.84) above that deals with the orientation error in axis-angle notation, where the matrix Des represents the desired orientation transformed in DCM format (Direction-Cosine-Matrix, i.e. the standard rotation matrix) from the axis-angle and the matrix H accounts for the current pose.

Once the $6 \times 1$ error vector $e$ gets correctly populated - being the last three components the orientation error in axis-angle convention - you can then run the control law:

$
\dot{q}=J_G^+ \cdot e,
$

where $J_G$ is the $6 \times n$ Geometric Jacobian and $\dot{q}$ the $n \times 1$ vector of joint velocities. In this basic implementation we don't handle the target orientation velocities $\omega_d$, which are zero, neither the target translational velocities $\dot{p}_d$.

Moreover, we know that $e=\left[e_P, e_O\right]^T$, but we can also impose $e=\left[K_P \cdot e_P, K_O \cdot e_O\right]^T$ to play with convergence speed.

The values of $K_P$ and $K_O$ can be even made greater than $I$ to start with but then bear in mind that the pseudo-inverse algorithm is intrinsically unstable due to e.g. singularities in the Jacobian and high values of gain matrices could enhance this problem.

To mitigate such a downside, one can implement a synergy between the Jacobian pseudo-inverse (very fast but prone to instabilities) and the Jacobian transposed (much slower but intrinsically stable), ending up with the classical Damped-Least-Squares (DLS) technique, aka Levenberg-Marquardt algorithm.

In the end, also DLS can suffer from reliability, accuracy and speed issues, especially when you want to control at the same time the translation and the orientation for a very redundant manipulator equipped with many degrees of freedom. That's why I finally came up with the use of a nonlinear optimizer capable of solving the inverse kinematics on the fly. Once the desired pose is known also in the configuration space the design of the controller is extremely facilitated.

Title: Jacobian-based trajectory following


答:
By using the Motorola, your Prof is getting you understand the fundamentals of what you are doing. If he had specified an Arduido you may have grabbed any bit of code off the net and not really understood the fundamentals. I am sure he knows what he is doing for you.
The best learning is from the mistakes you make, i.e. timing, memory margins, overuns etc.</p>

Title: Is Khepera II still adequate for learning

Body:
A professor in my university is asking me to study robotics with him. By robotics I understand programming a robot to move around, avoid obstacles, figure out a maze, etc.. He sent me some manuals for Khepera II.

When I first read the specs, I was surprised by the low specs:

Motorola 68331 CPU @ 25 MHz

512 KB RAM

512 KB Flash

But then I looked at some of the new Arduino boards and they had similar specs.
So maybe that's OK, I guess the CPU speed and RAM aren't that important if I'm going to control the robot from a normal computer that can handle real time computation.

What about the software? I glanced at the manuals and saw only C and assembly code.

Khepera I is from 1995 and Khepera II is from 2001. I think robots have advanced much since 2001.

Is using Khepera II adequate for university level learning, considering I can probably give 200-300$ for a newer one?

I ask in terms of hardware of the board, motors and sensors, as well as in the programmability. This question might seem vague. I'm ready to improve it by giving more detail upon request.


问:
Lightweight, commercially available robotic arms
I was wondering what options are there in terms of lightweight (< 5 lbs) robotic arms. I see Robai Cyton Gamma 300, and CrustCrawler AX18 look like interesting options. What lightweight arms do people use/like? </p>

答:
The OWI robotic arm is a cheap starting possibility for $30.
There is an instructables tutorial on how to connect it to arduino.</p>


问:
How to distribute tension load on a three footed claw?
Good day!

I am helping my little ones 6 and 7 to develop a robot that can pick up and stack cubes three high as well as gather blocks.  They came up with the design that enables them to pick up three cubes at a time when lined up and then pull up the claw, turn, drive to another cube, place the cubes on the stand still cube and release.

   Well they got the claw made with two rods connected to gears to motor and the rods reinforced, then they made insect like legs 3 - pairs of two on the rods, with gripper feet pads on the ends of the legs. All of this works as it opens and closes! The problem is that when they try to close the claw on the cubes and pick up all three cubes, the first - closest to motor feet have a nice tight grip, the second - middle feet - have a lighter grip and just barely can lift the block, and third - farthest from motor doesn't even have a grip on the blocks.

   I think it's because the second and third set of feet are farther from the motor. But how can they evenly disperse the tension load so the claw can pick up all three blocks?
I tried putting elastics on the feet for better grip and unless we put ten on each foot for the third set and maybe five on the second set it wont work.  Even though it's a quick fix I would like to help them figure it out the proper way of spreading the load so to speak.  We also tried putting a small band on the third set of legs.  The robot could still open and close and that worked for the third set but not the second.  We tried putting a band on the second and third but the legs wouldn't open anymore.  I could use a lighter band but is there another way? We only have one little motor to run it so we can't give all the leg sets it's own motor and even if we did there would be weight issues.

  THank you in advance!

答:
Tension distribution is easily accomplished using a simple mechanism called a whiffletree.
Classically invented to allow several horses of different strengths to pull evenly on a single load, this also allows a single motor to pull several linkages with the same amount of force.
It would also allow the mechanism to self-adjust slightly to construction inaccuracy, and also allow the gripper to better adapt to the shape of what its holding.</p>


问:
Can a quadcopter hover while tilted?
Is there a way to make a quadcopter maintain steady hovering (no lateral movement, constant altitude) while tilted left or right?  If so, how can i accomplish this? </p>

答:
In a normal quadcopter configuration, if you tilt you will be pointing some of the lift force to the side. The only way to hover at a tilt, then, would be to somehow apply a counter force. A standard quadcopter can't do that itself, so it would need be an external force (tether, wind, etc).

Your other options are to use a nonstandard configuration such as actuated motors that let you tilt them individually or adding extra lateral motors.

Title: Can a quadcopter hover while tilted?

ContentLicense: CC BY-SA 4.0


答:
So I looked into the quatSlerp function and it seems like you are passing t_elapsed incorrectly. It looked like that argument is supposed to be the the interpolation value, where if t = 0, the rotation returned is the identity, and if t = 1 the rotation returned is the full rotation between first two quaternion arguments passed.

If this code is inside a while loop, and t_elapsed is getting larger than 1, the arm will go unstable.

This doesn't explain why the unstable behavior would be affected by position.

Hopefully this isn't what you meant by debugging your code.

quatSlerp

Title: Jacobian-based trajectory following

Body:
I would like to control my 7 DOF robot arm to move along a Cartesian trajectory in the world frame.  I can do this just fine for translation, but I am struggling on how to implement something similar for rotation.  So far, all my attempts seem to go unstable.

The trajectory is described as a translational and rotational velocity, plus a distance and/or timeout stopping criteria.  Basically, I want the end-effector to move a short distance relative to its current location.  Because of numerical errors, controller errors, compliance, etc, the arm won't be exactly where you wanted it from the previous iteration.  So I don't simply do $J^{-1}v_e$.  Instead, I store the pose of the end-effector at the start, then at every iteration I compute where the end-effector should be at the current time, take the difference between that and the current location, then feed that into the Jacobian.

I'll first describe my translation implementation.  Here is some pseudo OpenRave Python:

```<code># velocity_transform specified in m/s as relative motion
def move(velocity_transform):
  t_start = time.time()
  pose_start = effector.GetTransform()
  while True:
    t_now = time.time()
    t_elapsed = t_now - t_start
    pose_current = effector.GetTransform()
    translation_target = pose_start[:3,3] + velocity_transform[:3,3] * t_elapsed
    v_trans = translation_target - pose_current[:3,3]
    vels = J_plus.dot(v_trans) # some math simplified here
</code>```

The rotation is a little trickier.  To determine the desired rotation at the current time, i use Spherical Linear Interpolation (SLERP).  OpenRave provides a quatSlerp() function which I use.  (It requires conversion into quaternions, but it seems to work).  Then I calculate the relative rotation between the current pose and the target rotation.  Finally, I convert to Euler angles which is what I must pass into my AngularVelocityJacobian.  Here is the pseudo code for it.  These lines are inside the while loop:

```<code>rot_t1 = np.dot(pose_start[:3,:3], velocity_transform[:3,:3]) # desired rotation of end-effector 1 second from start
quat_start = quatFromRotationMatrix(pose_start) # start pose as quaternion
quat_t1 = quatFromRotationMatrix(rot_t1) # rot_t1 as quaternion

# use SLERP to compute proper rotation at this time
quat_target = quatSlerp(quat_start, quat_t1, t_elapsed) # world_to_target
rot_target = rotationMatrixFromQuat(quat_target) # world_to_target
v_rot = np.dot(np.linalg.inv(pose_current[:3,:3]), rot_target) # current_to_target
v_euler = eulerFromRotationMatrix(v_rot) # get rotation about world axes
</code>```

Then v_euler is fed into the Jacobian along with v_trans.  I am pretty sure my Jacobian code is fine.  Because i have given it (constant) rotational velocities ok.

Note, I am not asking you to debug my code.  I only posted code because I figured it would be more clear than converting this all to math.  I am more interested in why this might go unstable.  Specifically, is the math wrong?  And if this is completely off base, please let me know.  I'm sure people must go about this somehow.

So far, I have been giving it a slow linear velocity (0.01 m/s), and zero target rotational velocity.  The arm is in a good spot in the workspace and can easily achieve the desired motion.  The code runs at 200Hz, which should be sufficiently fast enough.

I can hard-code the angular velocity fed into the Jacobian instead of using the computed v_euler and there is no instability.  So there is something wrong in my math.  This works for both zero and non-zero target angular velocities.  Interestingly, when i feed it an angular velocity of 0.01 rad/sec, the end-effector rotates at a rate of 90 deg/sec.

Update: If I put the end-effector at a different place in the workspace so that its axes are aligned with the world axes, then everything seems works fine.  If the end-effector is 45 degrees off from the world axes, then some motions seem to work, while others don't move exactly as they should, although i don't think i've seen it go unstable.  At 90 degrees or more off from world, then it goes unstable.


问:
Multiple limbs on small robots
Note: I'm a firmware developer experienced with sensors and networks, but not much with motors.

I am trying to build a small hobby robot, like a cat-sized spider. I am thinking of using servo motors with position control, so I don't have to use encoders to know where the motor is. Assuming six legs (I know, spiders have eight), with each leg being able to move up-down and left-right, that already translates to 12 motors. If you want to bend a knee, that gets the number to 18.

18 motors on such a small robot is overkill, isn't it?

I have thought of a couple of ideas, but not having a strong mechanical background, I cannot tell whether they are doable/sane.

One of my ideas is to use a magnet on the end of the limb (the end inside the chassis) and a small permanent magnet above it. The magnets attract each other and this keeps the limb firm under the weight of the robot. A stronger controllable magnet (a coil) would attract the limb even more and let it lift in the air. The following drawing may help:

This would allow the up-down movement of the leg, and a servo would control its left-right movement. However, I fear that such a system would not be strong enough to hold under the weight of the robot, or whether a reasonable coil would be compact enough.

In short, my question is, how can I control six legs each with two or three degrees of freedom with a reasonable number of motors? Is having one motor per degree of freedom the only possibility?

答: I do not believe that an actual spider has the degrees of freedom you are considering. Yes, each leg can respond to a stimulus but in the case of ambulatory motion, there is some repetitive motion of the legs. Your example of solenoids, or what I call half-axis may be a solution. Another solution may be to incorporate cams or slow responsive joints. With the slow responsive joints, one can see how the speed of motor motion could cause different leg response... And still another possible solution would have a single motor drive a pair of legs or more... And still even another possible solution is to run two servo motors coupled where the pair can run multiple joints but if the motors are out of "phase" different motions can occur allowing you to mimic more axis motion.  </p>

Title: Multiple limbs on small robots


答:
Is having one motor per degree of freedom the only possibility?

There are many ways to use each motor for multiple purposes. My answer to a previous question has photos of gear trains that perform one function when a motor rotates one way and another when it rotates the other.  You can also use clutches and/or shifters to control what function a motor drives.  It may be possible to use one drive motor and one selector motor for any operation that is done for only one leg at once.

However, for a one-off construction, unless you have machine-shop skills and mechanical-design ability, it seems likely that using many copies of a cheap component (RC servos) will cost you less and be more reliable than trying to use motors for multiple purposes.  The necessary mechanical parts (eg solenoids, cams, gear and belt systems) are likely to be low-volume and expensive by comparison, and might save weight but not save money.

Title: Multiple limbs on small robots

Body:
Note: I'm a firmware developer experienced with sensors and networks, but not much with motors.

I am trying to build a small hobby robot, like a cat-sized spider. I am thinking of using servo motors with position control, so I don't have to use encoders to know where the motor is. Assuming six legs (I know, spiders have eight), with each leg being able to move up-down and left-right, that already translates to 12 motors. If you want to bend a knee, that gets the number to 18.

18 motors on such a small robot is overkill, isn't it?

I have thought of a couple of ideas, but not having a strong mechanical background, I cannot tell whether they are doable/sane.

One of my ideas is to use a magnet on the end of the limb (the end inside the chassis) and a small permanent magnet above it. The magnets attract each other and this keeps the limb firm under the weight of the robot. A stronger controllable magnet (a coil) would attract the limb even more and let it lift in the air. The following drawing may help:

This would allow the up-down movement of the leg, and a servo would control its left-right movement. However, I fear that such a system would not be strong enough to hold under the weight of the robot, or whether a reasonable coil would be compact enough.

In short, my question is, how can I control six legs each with two or three degrees of freedom with a reasonable number of motors? Is having one motor per degree of freedom the only possibility?


问:
How to get a python node in ROS subscribe to multiple topics?
How a ROS node written in Python could subscribe to multiple topics and publish to multiple topics?

All examples I found were for a single topic. Is this an event-driven model so subscription to multiple "events" is allowed or it is more like a loop, so it can listen only to one "source" at a time?

答:
You can follow the example code here and simply add a second subscription like so:

```<code>import rospy
from std_msgs.msg import String

def callback1(data):
    rospy.loginfo("Callback1 heard %s",data.data)

def callback2(data):
    rospy.loginfo("Callback2 heard %s",data.data)

def listener():
    rospy.init_node('node_name')
    rospy.Subscriber("chatter1", String, callback1)
    rospy.Subscriber("chatter2", String, callback2)
    # spin() simply keeps python from exiting until this node is stopped
    rospy.spin()
</code>```

ROS Python nodes are inherently multi-threaded.  When you get each callback, it will be in a separate thread.  So this is an event-driven model.

Note that this behavior is different than the default behavior for ROS C nodes which are inherently single threaded unless you specifically make them multi-threaded.

Body:
You can follow the example code here and simply add a second subscription like so:

import rospy
from std_msgs.msg import String

def callback1(data):
    rospy.loginfo("Callback1 heard %s",data.data)

def callback2(data):
    rospy.loginfo("Callback2 heard %s",data.data)

def listener():
    rospy.init_node('node_name')
    rospy.Subscriber("chatter1", String, callback1)
    rospy.Subscriber("chatter2", String, callback2)
    # spin() simply keeps python from exiting until this node is stopped
    rospy.spin()

ROS Python nodes are inherently multi-threaded.  When you get each callback, it will be in a separate thread.  So this is an event-driven model.

Note that this behavior is different than the default behavior for ROS C nodes which are inherently single threaded unless you specifically make them multi-threaded.


问:
PID control of tank-like robot and IMU
Consider a tank like robot with a motor driver channel for each side of the robot (two motors on the left and two motors on the right) and an IMU.
I'm interested in driving the robot in a straight line using the yaw data from the gyro and magnetometer of the IMU, removing the noise caused by slightly different behaving motors, and the possibility to change the desired direction angle. For example some event comes and I want the car to switch the desired direction to +120 degrees and turn while driving.

I'm using Arduino Uno, MinIMU-9 v3 and two DRV8838 Single Brushed DC Motor Driver from Pololu.

Can you please give me some hints and a short pseudo-code example?
Thanks!

答:
You define the powers for motors as: p_left  = p_average + p_differential
and p_right = p_average - p_differential

Your PID regulator should take the filtered angle as input and provide you with p_differential. As such, it will control the "turning" of the robot.
When the mentioned event occurs, just change the referential angle.

Title: PID control of tank-like robot and IMU


问:
FRC RoboRio Eclipse can't find edu.wpi.first.wpilibj
The first time after importing a project into the Eclipse workspace we find that eclipse cannot find the WPILIBj.

On any import line:import edu.wpi.first.wpilibj.* Eclipse says "unresolved import edu.

答:
WPILib dev here. There's no need to recreate the project, although that will fix the problem. Simply right click on the project, click on properties > Java Build Path > Libraries > Add External Jar
Navigate to the wpilib folder on your computer and find the wpilibj.jar file. Select that file, and clean the project.

This won't fix things if you didn't start out with a wpilibj project because you'll be missing other files like build.properties and build.xml, but if you just lost the wpilibj jar file this will resolve that.


问:
What dynamic system could these equations represent?
I have equations of a dynamic system. I need to figure out what this physical system is.

The equations are:

\begin{align}
\dot{x}_1&=bx_1+kx_2+x_3\\
\dot{x}_2&=x_1\\
\dot{x}_3&=\alpha (u-x_2)-\beta x_3
\end{align}

All I can figure out is that it is maybe a mass-spring-damper system, plus a feedback control, but I am not quite sure about the terms $x_3$ and $\dot{x}_3$. What do these two terms mean?

答:
You're right, it's a second order plant representing the mass-spring-damper system $P\left(s\right)=1/\left(s^2-bs -k\right)$ (stiffness $k$ and damping $b$ should be thus negative) under the closed-loop control action of the compensator $C\left(s\right)$, whose transfer function is:

$
C\left(s\right)=\frac{\alpha}{s+\beta}.
$

The negative feedback is closed over the position of the mass, while the set-point is given by $u$.

We can easily derive these results by applying the Laplace transform to the system of equations and then substituting $x_1$:

$$
\begin{align}
s^2x_2&=bsx_2+kx_2+x_3\\
sx_3&=\alpha (u-x_2)-\beta x_3
\end{align},
$$

from which we obtain the following transfer functions:

$$
\begin{align}
P\left(s\right)&=\frac{x_2\left(s\right)}{x_3\left(s\right)}=\frac{1}{s^2-bs-k}\\
C\left(s\right)&=\frac{x_3\left(s\right)}{u\left(s\right)-x_2\left(s\right)}=\frac{\alpha}{s+\beta}
\end{align},
$$

corresponding to the closed-loop system here below:


问:
Are robotic pollenators being designed?
With the bee hive collapses, growers are desperate for pollenation options. Is anyone working on swarms of tiny flying robots to augment the bees? They could look for a certain color, poke around inside the flower for a moment, and move on to the next. When they need recharging, they fly back to their hive (the same reason bees fly back).

Of course, replacing germinators that run the seeds through their digestive systems would be a different problem.

答:
According to Harvard University who are actively working on a Robobees project which has various goals in mind, one of which is autonomous pollination, they see autonomous pollination as being a couple of decades away yet. They admit that the better solution is to remedy the natural problem of Colony Collapse Disorder. I quote from their website:

One potential application of micro-robotic "insects" might someday be to artificially pollinate crops. However, we do not see robotic pollination as a wise or viable long-term solution to Colony Collapse Disorder. If robots were used for pollination—and we are at least 20 years away from that possibility— it would only be as a stop-gap measure while a solution to CCD is implemented to restore natural pollinators.

More about that here.

Title: Are robotic pollenators being designed?


问:
how to plot $\pm 3 \sigma$ of a landmark in EKF-SLAM
I have implemented 2D-SLAM using EKF. The map is based-feature in which there is only one landmark for the sake of simplicity. I've read some papers regarding this matter. They plot the $\pm3\sigma$ plus the error. I would like to make sure that I'm doing the right thing. In my project, I have the estimate of the landmark's position and its true values. The true values here are the ones that the sensor measure not the ideal case. For example, the ideal case of the landmark position  is (30,60) but this value is not accessible by any means, therefore I will consider the true values the ones that are coming from the sensor.

Now the error in the landmark's position in x-axis is formulated as follows

$$
\text{error}_{x} = \hat{x} - x
$$

The below picture shows the error in blue color. The red color represents the error bounds which is $\pm 3 \sigma_{x}$

My question is now is this the way people plot the errors in the academics papers because I've seen some papers the bounds doesn't not look like mine. Even though mine decreases monotonically however in some papers it is more curved and it seems more reasonable to me. Any suggestions?

答:
Unless I misunderstood what you're trying to show on this plot, you want to essentially plot your estimate (or, in this case, the estimation error) with its 3 standard deviation bounds.

What you have shown appears to be the bounds computed simply as 0 +/- 3sigma, but what you really want to plot is error +/- 3*sigma.  That is to say, the uncertainty of the estimate is centered around the estimate, not zero.  I found a random image showing how I would plot the estimate and its uncertainty bounds:

http://2.bp.blogspot.com/_7YSZm5NIAmQ/S_wNkdp6ClI/AAAAAAAAAOU/hEYy4fWR9Rg/s1600/rw_plot.jpg

Hope this makes sense.


问:
How to track robot position?
I'm a software researcher, who in my spare time mentors a robotics team, helping on the software side of things. For years, I keep coming back to the same question: How to determine the robots position, and heading during our competitions? We have tried a number of things with varying degrees of success/failure. Encoders on the drive wheels, accelerometers, gyroscopes, etc. I recently bought an IMU with a 3 axis accelerometer, 3 axis gyro, and 3 axis magnetometer, all preprocessed by an Arduino, and outputting the value to a serial port. I thought surely there must be a way to take all these measurements and get a composite view of position and heading. We are using Mecanum wheels on this particular robot, so wheel encoders are not particularly useful. I've looked around and there's a lot of talk about orientation using quaternion with sensor fusion using similar boards, but it very unclear to me how to take the quaternion and the estimation and come up with x,y distance from the starting position? Now, my time window for these measurements is small, ~15 seconds, but I need it to be pretty accurate within that window.  I'm about ready to abandon using the IMU, and try something else. One idea is to use a USB ball mouse to try and track robot motion but I'm certain that the mouse is going to get banged around way too much leading to noise and invalid results. As a side note: The robot is about 2ft x 3ft base weighing in at 120 lbs.  Any thoughts or suggestions appreciated.</p>

答:
I am not allowed to comment, so I have to add a reply. By position, do you mean the location in space (so X, Y coordinates), or orientation (tilt, etc)?

If position, you can use the accelerometer values and integrate acceleration to get distance traveled, though this is fairly inaccurate. We have tried to do this for a quadcopter, and the drift due to error is quite large.

You can use an accelerometer with a gyroscope together, and a Kalman filter to get a better idea for how far the robot has moved in each direction. Here is a previous discussion on this topic.

The tilt you can calculate directly from accelerometer values (but filter them, even an FIR filter would work ok).

Heading you can get from the gyroscope and/or the magnetometer. The gyroscope detects rotation, so make sure it is somewhere near the center of your robot (or whereever the axis of rotation is).

I hope that helps. I have to go teach, but I'll come back in an hour and add some more info.

Title: How to track robot position?


答:
What you are referring to is plotting the estimate with the uncertainty bounds - in particular the $3\sigma$ ($\pm3$ standard deviations) bounds which corresponds to 99.7% probability that the true state is within this region. The uncertainty bounds can be extracted from the state covariance matrix.
I think what you are plotting is the residuals of some observation VS expected observation? In this case I think it is also applicable to use the covariance matrix of the residual observation error.

For how to extract the standard deviation from the covariance matrix see:
https://stats.stackexchange.com/questions/50830/can-i-convert-a-covariance-matrix-into-uncertainties-for-variables

Title: how to plot $\pm 3 \sigma$ of a landmark in EKF-SLAM

Body:
I have implemented 2D-SLAM using EKF. The map is based-feature in which there is only one landmark for the sake of simplicity. I've read some papers regarding this matter. They plot the $\pm3\sigma$ plus the error. I would like to make sure that I'm doing the right thing. In my project, I have the estimate of the landmark's position and its true values. The true values here are the ones that the sensor measure not the ideal case. For example, the ideal case of the landmark position  is (30,60) but this value is not accessible by any means, therefore I will consider the true values the ones that are coming from the sensor.

Now the error in the landmark's position in x-axis is formulated as follows

$$
\text{error}_{x} = \hat{x} - x
$$

The below picture shows the error in blue color. The red color represents the error bounds which is $\pm 3 \sigma_{x}$

My question is now is this the way people plot the errors in the academics papers because I've seen some papers the bounds doesn't not look like mine. Even though mine decreases monotonically however in some papers it is more curved and it seems more reasonable to me. Any suggestions?


问:
FreeIMU External Magnetometer
I have been using the FreeIMU library successfully but now I want to add an external magnetometer that I can mount away from my motors.

I've figured out how to modify the FreeIMU library to use an external magnetometer and I am getting data.

What I can't figure out is what I need to change now that my magnetometer orientation has changed.

On the free IMU it is mounted like this

The external compass is mounted like this - upside down - rotated 180° around x

I am changing the value inside the

void HMC58X3::getRaw(int16_t *x,int16_t *y,int16_t *z)
{
    *x = cache_x;
    *y = cache_y;
    *z = cache_z;
}

function as all the other code calls this to get the magnetometer data.

So far I have tried:

Changing the sign for the y and z values after I have got them from the magnetometer.

Changing the sign for the y value only

Changing the sign for the z value only

Added 180 to both the y and z values

Subtracting 180 from both the y and z values

Subtracting 180 from y and adding 180 to Z

Adding 180 to y and subtracting 180 from z

Changing nothing

The calibration GUI gives always gives me strange results, and doing the changes above just rotated/mirrored the magnetometer red and green graphs. I am unable to get rid of the key hole shape.

The red is XY. The green YZ. The blue is ZX. Does the fact that ZX works mean that my issue is with the Y value?

This is how it looks using the on board magnetometer.

What should I try next?

Thanks
Joe

EDIT

I tried rotating the external magnetometer so it is in the same orientation as the FreeIMU magnetometer and I still get the same result so I don't think its the difference in orientation that is causing the problem.

So then I thought maybe its because the FreeIMU is mounted central to the rotation axis and the external magnetometer is mounted about 20cm above. I tested this by rotating only the external magnetometer around itself and I still got the same result.

This is all seems strange, do you think its possible that the external magnetometer I have brought is faulty? Any way to confirm it is working properly on its own?

Thanks

EDIT

Managed to get circles plotting by changing the gain from 0 to 1. It seem my new magnetometer was being saturated.

Now I just need to work out how to change my values around so the orientation is correct.

答:
OK so I managed to solve this by doing a couple of things.

Connect external magnetometer to the same I2C bus as the FreeIMU.

The FreeIMU is 5V and the external magnetometer is 3.3V so I had to use a level shifter to place both devices on the I2C bus.

Change this line "accgyro->setI2CBypassEnabled(1);" to "accgyro->setI2CBypassEnabled(0);" to enable the external magnetometer

Change this line "magn->calibrate(0, 8);" to magn->calibrate(1, 8);" to increase the gain and remove saturation (this is what caused the strange "Keyhole" shape on the graph.

Calibrate the sensors.

Change this line

"AHRSupdate(val[3] * M_PI/180.0, val[4] * M_PI/180.0, val[5] * M_PI/180.0, val[0], val[1], val[2], val[6], val[7], val[8], magn_valid);"

to

"AHRSupdate(val[3] * M_PI/180.0, val[4] * M_PI/180.0, val[5] * M_PI/180.0, val[0], val[1], val[2], val[6], -val[7], -val[8], magn_valid);"

to account for the change in orientation.

Title: FreeIMU External Magnetometer


问:
Automatic agricultural robot using 8051
I want to build a automatic agricultural robot for my final year diploma project. The basic idea is to program 8051 to drive the robot in a fixed path in farm for ploughing the farm which i am planning to do by setting a particular distance till which it will go straight and then take a U turn and plough in next lane. Width of the farm will also be set so when it completes full farm it'll stop and go back to starting point. the only catch is to reprogram it as per size of the farm of the person who uses it. So i want to add a number pad with which he can set the length and width of the farm as well as width of each lane as per his needs without professional help. Can this be done using 8051 or should i go for AVR or PIC microcontrollers. I have just started studying programming and interfacing of 8051 so I am not that good in programming. If its possible how do i do it. can someone please help me with circuit diagram for this project. After everything i said i need in my project if i still get an empty port in microcontroller I would love to add a fertilizer sprayer or water irrigation system and a GSM module so that a farmer can simply ask the robot to start working using his mobile phone. As I am making just a prototype i want it to be as small as possible. Suggestions are welcomed.</p>

答: Because you want your prototype to be as small as possible, it would be important to pick a "job" for the farmer that is well suited to a small platform. Tillage is going to require lots of horsepower and is, therefore, perhaps not the best match. There is considerable interest currently in weeds, for example. Perhaps give your prototype some boundary within which to work and have it search for weeds? Generally speaking, we find that the perfect rectangular field is less common than might be expected, so I'd keep that in mind as you develop a coverage algorithm.</p>

Title: Automatic agricultural robot using 8051


问:
Servos power supply in Quadruped Robot
I'm facing a problem while building my quadruped robot which is figuring out the efficient power supply needed for the 12 servos. I'm using 12 MG995 tower pro servos powered by 2 lithium batteries 2x3.7v (about 8 volts) with 2200 mA . I really don't know if that enough for the servos or something else is needed to be added(i hardly fitted the 2 batteries into the robot's body)
any suggestions please?</p>

答:
(I still can't comment, so yet another reply from me.)

Servos will typically operate between 4.8V and 6V. Do not directly connect the output of the LiPo battery pack to the power line of your servos (because that is 8.4V when charged). Despite what Spiked3 says, your servo is not 4.8V - the ratings on the "specs" website show torque and speed at 4.8V, but another website will show the torque/speed ratings taken at 6V. In fact, your servos appear to be rated for 4.8-7.2V. I would run at 5-6V.

You should get a voltage regulator circuit (or build your own). You can make a fairly cheap one using LM317T and a Darlington pair BJT - this can carry up to about 11A of current. It is very to breadboard if you wanted to prototype it. If you decide to buy one, pay attention to its heat dissipation capabilities.

Your servos are fairly beefy (similar to ones in my hexapod), so you should in theory budget at least 1A of stall current for each one. This means that if the servos for some reason
cannot move or experience so much resistance that they cannot move), you must supply enough current for them to still operate. You should really avoid this situation as they'll start to heat up and will probably burn out, but it's something to consider.

I have to power 18 high-torque metal gear servos, so what I ended up doing is splitting this into two power banks - each LiPo then had to power 9 at a time. With that I would need about 9A at stall (though the info I found online about my servos says less). The LM317T circuit + Darlington provides 11A, so I'm good on that front. I ended up adding a fuse on the board just in case, and heatsinks on the transistors.

As for the battery life - you have 2200mAh batteries (2.2Ah), which means that if your servos drew 2.2A, the batteries would last an hour. With 12 servos, and assuming you split them evenly between the battery packs (6/battery pack) I think you'll get that no problem, but it obviously depends on the situation. The servos draw most current while moving and of course if they are struggling to hold the load.

Last little suggestion: make sure you use thick wire (not normal hook-up wire) in your voltage regulator circuit since you are potentially carrying 10A, and that's a lot.

Title: Servos power supply in Quadruped Robot


答:
How to estimate a robot's position depends on how well you'd like to estimate it. If you just need a rough guess, try odometry, it works OK. For better results, you have to incorporate more sensors. That's an incremental process that involves a lot of sensor fusion, and suddenly, you've built an Extended Kalman Filter.

The best way, in my opinion, is to use each sensor to form it's own estimate. Then, take a weighted average of the resulting estimates. The weights correspond to the certainty associated with each estimate. This, in essence is the Kalman Filter. What is missing is how to estimate the certainties. This is the hard part of the KF. Try some ad hoc values as a start. You'd be surprised how well this can work.

This is addressed as a first-principals question in any major robotics textbook and even here, on this site.

On this site, we have addressed many questions related to this problem.

how to fuse linear and angular data in a KF. This is probably a good starting point as it also covers the KF / EKF

how to choose a good imu for a wheeled robot

how to fuse multiple position estimates

Why do I need a kalman filter

what is a suitable model for two wheeled robots

and many more I've missed.

But honestly, these are heavy-handed approaches. You must understand the basics (estimating position from odometry, for example) to understand the rest.

Title: How to track robot position?

Body: I'm a software researcher, who in my spare time mentors a robotics team, helping on the software side of things. For years, I keep coming back to the same question: How to determine the robots position, and heading during our competitions? We have tried a number of things with varying degrees of success/failure. Encoders on the drive wheels, accelerometers, gyroscopes, etc. I recently bought an IMU with a 3 axis accelerometer, 3 axis gyro, and 3 axis magnetometer, all preprocessed by an Arduino, and outputting the value to a serial port. I thought surely there must be a way to take all these measurements and get a composite view of position and heading. We are using Mecanum wheels on this particular robot, so wheel encoders are not particularly useful. I've looked around and there's a lot of talk about orientation using quaternion with sensor fusion using similar boards, but it very unclear to me how to take the quaternion and the estimation and come up with x,y distance from the starting position? Now, my time window for these measurements is small, ~15 seconds, but I need it to be pretty accurate within that window.  I'm about ready to abandon using the IMU, and try something else. One idea is to use a USB ball mouse to try and track robot motion but I'm certain that the mouse is going to get banged around way too much leading to noise and invalid results. As a side note: The robot is about 2ft x 3ft base weighing in at 120 lbs.  Any thoughts or suggestions appreciated.</p>


问:
The uncertainty is big while the sensor is rather accurate at measuring a landmark in EKF-SLAM
I've a 2D sensor which provides a range $r$ and a bearing $\phi$ to a landmark. In my 2D EKF-SLAM simulation, the sensor has the following specifications
$$
\sigma_{r} = 0.01 \text{m} \ \ ,\sigma_{\phi} = 0.5 \ \text{deg}
$$

The location of the landmark in x-axis is 30. EKF imposes the Gaussian noise, therefore the location of the landmark is represented via two quantities namely the mean $\mu_{x}$ and the variance $\sigma_{x}$. In the following graph

The green is the mean $\mu_{x}$ which is very close to the true location (i.e. 30). The black is the measurements and red is $\mu_{x} \pm 3 \sigma_{x}$. I don't understand why the uncertainty is big while I'm using rather accurate sensor. The process noise for the robot's pose is $\sigma_{v} = 0.001$ which is small noise. I'm using C++.

Edit: for people who ask about the measurements, this is my code

$$
r = \sqrt{ (m_{j,y} - y)^{2} + (m_{j,x} - x)^{2}} + \mathcal{N}(0, \sigma_{r}^{2}) \\
\phi = \text{atan2} \left( \frac{m_{j,y} - y}{m_{j,x} - x} \right) + \mathcal{N}(0, \sigma_{\phi}^{2})
$$

```<code>std::vector<double> Robot::observe( const std::vector<Beacon>& map )
{
    std::vector<double> Zobs;

    for (unsigned int i(0); i < map.size(); ++i)
    {
        double range, bearing;

        range = sqrt( pow(map[i].getX() - x,2) +
                      pow(map[i].getY() - y,2)   );

        // add noise to range
        range += sigma_r*Normalized_Gaussain_Noise_Generator();

        bearing = atan2( map[i].getY() - y, map[i].getX() - x) - a;

        // add noise to bearing
        bearing += sigma_p*Normalized_Gaussain_Noise_Generator();

        bearing = this->wrapAngle(bearing);

        if ( range < 1000 ){
          // store measurements (range, angle) for each landmark.
          Zobs.push_back(range);
          Zobs.push_back(bearing);
          //std::cout << range << " " << bearing << std::endl;
        }
    }

    return Zobs;
}
</code>```

where Normalized_Gaussain_Noise_Generator() is ( i.e. $\mathcal{N}(0, 1) )$

```<code>double Robot::Normalized_Gaussain_Noise_Generator()
{
    double noise;
    std::normal_distribution<double> distribution;
    noise = distribution(generator);

    return noise;
}
</code>```

For the measurements (i.e. the black color), I'm using the inverse measurement function  given the estimate of the robot's pose and the true measurement in polar coordinates to get the location of a landmark. The actual approach is as follows

$$
\bar{\mu}_{j,x} = \bar{\mu}_{x} + r \cos(\phi + \bar{\mu}_{\theta}) \\
\bar{\mu}_{j,y} = \bar{\mu}_{y} + r \sin(\phi + \bar{\mu}_{\theta})
$$

This is how it is stated in the Probabilistic Robotics book. This means that the measurements in the above graph are indeed the predicted measurements not the true ones.

Now under same conditions, the true measurements can be obtained as follows

$$
\text{m}_{j,x} = x + r \cos(\phi + \theta) \\
\text{m}_{j,y} = y + r \sin(\phi + \theta)
$$

The result is in the graph below, which means there is no correlations between the true measurements and the robot's estimate. This leads me to the same question - why the uncertainty behaves like that?

答:
You don't describe your setup in detail, and some of the units are missing, but my guess is that the $\sigma_\phi$ is mainly responsible for the initial error you are seeing. </p>

<p>$\sin( 0.5 ) \times 30 \approx 0.261$</p>

Body:
You don't describe your setup in detail, and some of the units are missing, but my guess is that the $\sigma_\phi$ is mainly responsible for the initial error you are seeing.

$\sin( 0.5 ) \times 30 \approx 0.261$


答:
Something is wrong with your code. Measurements with Gaussian noise should be within one standard deviation of truth 68% of the time. Somehow, your measurements seem to be correlated with the accuracy of your estimate.

Go through the code or post some here.

Title: The uncertainty is big while the sensor is rather accurate at measuring a landmark in EKF-SLAM

Body:
I've a 2D sensor which provides a range $r$ and a bearing $\phi$ to a landmark. In my 2D EKF-SLAM simulation, the sensor has the following specifications
$$
\sigma_{r} = 0.01 \text{m} \ \ ,\sigma_{\phi} = 0.5 \ \text{deg}
$$

The location of the landmark in x-axis is 30. EKF imposes the Gaussian noise, therefore the location of the landmark is represented via two quantities namely the mean $\mu_{x}$ and the variance $\sigma_{x}$. In the following graph

The green is the mean $\mu_{x}$ which is very close to the true location (i.e. 30). The black is the measurements and red is $\mu_{x} \pm 3 \sigma_{x}$. I don't understand why the uncertainty is big while I'm using rather accurate sensor. The process noise for the robot's pose is $\sigma_{v} = 0.001$ which is small noise. I'm using C++.

Edit: for people who ask about the measurements, this is my code

$$
r = \sqrt{ (m_{j,y} - y)^{2} + (m_{j,x} - x)^{2}} + \mathcal{N}(0, \sigma_{r}^{2}) \\
\phi = \text{atan2} \left( \frac{m_{j,y} - y}{m_{j,x} - x} \right) + \mathcal{N}(0, \sigma_{\phi}^{2})
$$

```<code>std::vector<double> Robot::observe( const std::vector<Beacon>& map )
{
    std::vector<double> Zobs;

    for (unsigned int i(0); i < map.size(); ++i)
    {
        double range, bearing;

        range = sqrt( pow(map[i].getX() - x,2) +
                      pow(map[i].getY() - y,2)   );

        // add noise to range
        range += sigma_r*Normalized_Gaussain_Noise_Generator();

        bearing = atan2( map[i].getY() - y, map[i].getX() - x) - a;

        // add noise to bearing
        bearing += sigma_p*Normalized_Gaussain_Noise_Generator();

        bearing = this->wrapAngle(bearing);

        if ( range < 1000 ){
          // store measurements (range, angle) for each landmark.
          Zobs.push_back(range);
          Zobs.push_back(bearing);
          //std::cout << range << " " << bearing << std::endl;
        }
    }

    return Zobs;
}
</code>```

where Normalized_Gaussain_Noise_Generator() is ( i.e. $\mathcal{N}(0, 1) )$

```<code>double Robot::Normalized_Gaussain_Noise_Generator()
{
    double noise;
    std::normal_distribution<double> distribution;
    noise = distribution(generator);

    return noise;
}
</code>```

For the measurements (i.e. the black color), I'm using the inverse measurement function  given the estimate of the robot's pose and the true measurement in polar coordinates to get the location of a landmark. The actual approach is as follows

$$
\bar{\mu}_{j,x} = \bar{\mu}_{x} + r \cos(\phi + \bar{\mu}_{\theta}) \\
\bar{\mu}_{j,y} = \bar{\mu}_{y} + r \sin(\phi + \bar{\mu}_{\theta})
$$

This is how it is stated in the Probabilistic Robotics book. This means that the measurements in the above graph are indeed the predicted measurements not the true ones.

Now under same conditions, the true measurements can be obtained as follows

$$
\text{m}_{j,x} = x + r \cos(\phi + \theta) \\
\text{m}_{j,y} = y + r \sin(\phi + \theta)
$$

The result is in the graph below, which means there is no correlations between the true measurements and the robot's estimate. This leads me to the same question - why the uncertainty behaves like that?


问:
Do you have to have a rate controller for a Quadcopter?
Most academic papers characterise the rate of rotation along the x axis as φ"=(1/Jx)τφ. As far as I cant tell, this characterises the rate and not the actual angle φ itself and yet the PID controllers academics use to control this takes φsetpoint-φmeasured as its error signal. Should the error signal not be φ"setpoint-φ"measured (using gyro values) instead. Why are they using the euler angle instead of its second derivative to control the rate?

Is it possible to stabilise a quadcopter using euler angles only?

答:
Second derivatives are rarely used to control rates.

It is not possible to control a quadrotor without using rates in control.

Rates from the gyro are generally not the same as euler angle rates. This is true when roll and pitch are zero, so this may be an okay assumption to make in your case but you should know it is an assumption.

I did not say you only need rates. I recommend reading control system design book. Should convert the rates from the gyro into euler angle rates. Use that in the derivative term in you PID controller.


问:
Raspberry Pi operating system for robotics
Is there an operating system for the Raspberry Pi that is specifically made for running robotics applications? Or an operating system whose purpose is to optimized just to run a few specific programs?

I've been working with an Arduino for a while now. As far as efficiency goes, it makes sense to me to just upload a specific set of commands and have the hardware only need to handle that, and not have to worry about running a full fledged operating system. Is something like this possible to do on a Raspberry Pi?

答:
You are asking two different things. 1) Is there a robotics-specific operating system, and 2) Is it possible to do hardware-level control on an R-Pi without messing around with an operating system. This is sort of a false dichotomy, as an operating system is a benefit, not a cost, unless you are severely constrained for processing power.

Microcontrolers (Arduino) are designed to handle time-critical things, and usually only one or two time critical things. They are great for turning wheels, etc. When it comes to high level planning, a high-level language / libraries are very helpful. As are multi-threaded applications, etc. This is where your OS comes in. Without further details about your project, I can't help you decide what is the best fit: Arduino or R-Pi.

To answer 1: Yes, just google around.

To answer 2: Yes, the hardware interfaces IO are available to code API's. But you'll need (want) something like this:

You -> OS -> microcontroller -> hardware.

See This excellent answer


问:
I am doing a project on robotic surgeries! Can anyone help me and give me some details related to this topic?
Can anyone help me, because I am doing a project on robotical surgeries and I would like someone to help me and advise me. I wonder if anyone could give me some data on tests he or she has run in a surgical robot... Thank you for your attention!
Anything else will be much appreciated!</p>

答:
There is a significant amount of information on this site: (http://allaboutroboticsurgery.com/surgicalrobots.html)

 That should give you the history and details about the past and current devices.
Which should hopefully allow you to fine tune your questions to get more detailed specific answers.  Good Luck. -Frank


答:
You may have covariance collapse. You may have such small covariance in your target estimate that the measurements are having almost no effect on the target's estimate. Try artificially inflating it.

It would make sense given that it "freezes" when your covariance in your target shrinks. But still, I'm hesitant to say this is the issue, since the red lines imply decent target estimate uncertainty remains.


问:
What is the difference between motion planning and trajectory generation?
What are the major differences between motion planning and trajectory generation in robotics? Can the terms be used interchangeably?</p>

答: I would bet that trajectory planning takes the kinematics/dynamics of the vehicle into account. I'm not very confident about that though. </p>


问:
Drive motor voltage / other specifications of Roomba 650
I salvaged some parts off my dead Roomba 650, and I'm trying to use the drive motor assembly . I got the pinout of the connector but I don't know what voltage / PWM / other specifications are there for this motor.

I've attached the picture of the drive motor assembly.

Any help would be appreciated!

Thank you,
Pratik

Edit: The Image is here: Drive Motor Module

答: The motors get a PWM'd battery voltage which is around 18V.  I assume it is safe to run at that voltage at 100% duty cycle.  I imagine you could run a higher voltage but you run the risk of burning out your brushes.  Lower voltages work fine if your bot is small.  I have successfully run a small Roomba wheel module robot off of 8 AA batteries (about 12V).</p>


问:
In PID control, what do the poles and zeros represent?
Whenever I read a text about control (e.g. PID control) it often mentions 'poles' and 'zeros'. What do they mean by that?  What physical state does a pole or a zero describe?</p>

答:
I cannot really speak for the zeros of the transfer function, but the poles of the transfer function definitely have a meaningful interpretation.

To understand this interpretation, you have to remember that the system that we want to control is really one of two things: either a differential equation or a difference equation.  In either case, the common approach to solving these equations is to determine their eigenvalues.  More importantly, when the system is linear, the eigenvalues of the differential/difference equation correspond exactly to the poles of the transfer function.  So, by obtaining the poles, you're really obtaining the eigenvalues of the original equation.  It is the eigenvalues of the original equation (in my opinion) that really determine the stability of the system; it just an amazing coincidence that the poles of a linear system are exactly the eigenvalues of the original equation.

To illustrate this, consider the two cases separately:

Case 1:  Differential Equation

When all eigenvalues of a differential equation have a negative real part, then all trajectories (i.e. all solutions) approach the equilibrium solution at the origin (x=0).  This is because solutions of a differential equation are typically of the form of an exponential function like $x(t)=Ce^{\lambda t}$, where $\lambda$ is the eigenvalue.  Thus, the function $x(t)\rightarrow 0$ as $t\rightarrow \infty$ only if $Re(\lambda)<0$.  Otherwise if $Re(\lambda)\ge 0$, the quantity $e^{\lambda t}$ would very likely blow up to infinity in magnitude or simply not converge to zero.

Case 2:  Difference Equation

When all eigenvalues of a difference equation are less than 1 in magnitude, then all trajectories (i.e. all solutions) approach the equilibrium solution at the origin (x=0).  This is because solutions of a difference equation are typically of the form of an exponential sequence like $x_t=C\lambda^t$, where $\lambda$ is the eigenvalue.  Thus, the sequence $x_t\rightarrow 0$ as $t\rightarrow\infty$ only if $|\lambda|<1$.  Otherwise if $|\lambda|\ge 1$, the quantity $\lambda^t$ would blow up to infinity in magnitude or simply not converge to zero.

In either case, the poles of the system function and the eigenvalues of the (homogeneous) differential/difference equation are exactly the same thing!  In my opinion, it makes more sense to me to interpret poles as eigenvalues because the eigenvalues explain the stability condition in a more natural fashion.


答: From your question, what you might be interested in is an RTOS for microcontrollers. A very popular one is FreeRTOS, which apparently was ported to Raspberry Pi.</p>

Title: Raspberry Pi operating system for robotics

Body:
Is there an operating system for the Raspberry Pi that is specifically made for running robotics applications? Or an operating system whose purpose is to optimized just to run a few specific programs?

I've been working with an Arduino for a while now. As far as efficiency goes, it makes sense to me to just upload a specific set of commands and have the hardware only need to handle that, and not have to worry about running a full fledged operating system. Is something like this possible to do on a Raspberry Pi?


问:
iRobot Create 2 and Open Interface 2 Spec not syncing up with incoming data
I have the create 2 and have it hooked up to an arduino. Almost all the commands work fine except when retrieving sensor information. If i send a request for packet 18 I get back values that while consistent don't match up, unless I am missing something. So if I press the clean button I get 127 or 11111110 and if i then press spot I get something like 11111010. I might be messing up my endianness but regardless the data isnt formatted how I expected it to be according to the spec sheet. I have 3 create 2s and they all do the same thing. Any ideas? I am using a 2n7000 along with the tutorial from the site but i dont think that has anything to do with the formatting of the byte.

this is the library I am using: https://github.com/DomAmato/Create2

Sorry to take so long to get back on this, anyways the data we get is always formatted this way. It is not a baud rate issue since it understands the commands properly.

```<code>        day     hour    minute  schedule    clock   dock    spot    clean
day     3       x       x       x           x       x       x       x
hour    6       7       x       x           x       x       x       x
minute  13      14      15      x           x       x       x       x
schedule    x   x       x       x           x       x       x       x
clock   x       x       x       x           x       x       x       x
dock    27      29      30      x           x       31      x       x
spot    55      59      61      x           x       62      63      x
clean   111     119     123     x           x       125     126     127
</code>```

Note that the schedule and clock buttons return nothing

答: If that example code you posted is what you are running, then I don't think you are using the right baud rate.  The Create2 uses 115200 baud by default.  But the Arduino cannot reliably reproduce this baud, so it is recommended to open the port at 115200, then change the baud down to 19200 for the rest of the comms.  I don't believe this change survives across power cycles.</p>


答:
Without seeing your code and your hardware setup, I'm not sure how much help I can be, but I'll try! The light painting project on the iRobot site has a sketch which monitors the buttons without using a third party library. The function is called waitForButton. I'd encourage you to grab that function in a separate sketch (not forgetting the setup code for the robot in the original sketch) and see if you can get the buttons to work for you. If they work, it's a problem with your code or the third party library.

I don't have an Arduino to play with right now, but using a USB to Create cable with Python on my laptop, I threw this together for you to test your robots:

```<code>#!/usr/bin/env python
# 27 February 2015
# Steven Shamlian
# Released under Poul-Henning Kamp's Beerware license

# A quick and _dirty_ script to test button reads.

import serial, time
COM_PORT = "COM37" # be sure to change this

ser = serial.Serial(port=COM_PORT, baudrate=115200)

print "Resetting..."
ser.write('\x07') # put the robot in a known state
for i in reversed(range(10)):
    print i,
    time.sleep(1)
print
ser.write('\x80\x83') # put the robot in safe mode
time.sleep(0.1)

ser.flushInput() # discard everything we've seen so far

print "Press Ctrl+C to quit."

try:
    while True:
        ser.write('\x8e\x12') # request buttons
        print "Got " + hex(ord(ser.read()))
        time.sleep(0.25)
except:
    pass

ser.close()
</code>```

Title: iRobot Create 2 and Open Interface 2 Spec not syncing up with incoming data

Body:
I have the create 2 and have it hooked up to an arduino. Almost all the commands work fine except when retrieving sensor information. If i send a request for packet 18 I get back values that while consistent don't match up, unless I am missing something. So if I press the clean button I get 127 or 11111110 and if i then press spot I get something like 11111010. I might be messing up my endianness but regardless the data isnt formatted how I expected it to be according to the spec sheet. I have 3 create 2s and they all do the same thing. Any ideas? I am using a 2n7000 along with the tutorial from the site but i dont think that has anything to do with the formatting of the byte.

this is the library I am using: https://github.com/DomAmato/Create2

Sorry to take so long to get back on this, anyways the data we get is always formatted this way. It is not a baud rate issue since it understands the commands properly.

```<code>        day     hour    minute  schedule    clock   dock    spot    clean
day     3       x       x       x           x       x       x       x
hour    6       7       x       x           x       x       x       x
minute  13      14      15      x           x       x       x       x
schedule    x   x       x       x           x       x       x       x
clock   x       x       x       x           x       x       x       x
dock    27      29      30      x           x       31      x       x
spot    55      59      61      x           x       62      63      x
clean   111     119     123     x           x       125     126     127
</code>```

Note that the schedule and clock buttons return nothing

Body:
Without seeing your code and your hardware setup, I'm not sure how much help I can be, but I'll try! The light painting project on the iRobot site has a sketch which monitors the buttons without using a third party library. The function is called waitForButton. I'd encourage you to grab that function in a separate sketch (not forgetting the setup code for the robot in the original sketch) and see if you can get the buttons to work for you. If they work, it's a problem with your code or the third party library.

I don't have an Arduino to play with right now, but using a USB to Create cable with Python on my laptop, I threw this together for you to test your robots:

#!/usr/bin/env python
# 27 February 2015
# Steven Shamlian
# Released under Poul-Henning Kamp's Beerware license

# A quick and _dirty_ script to test button reads.

import serial, time
COM_PORT = "COM37" # be sure to change this

ser = serial.Serial(port=COM_PORT, baudrate=115200)

print "Resetting..."
ser.write('\x07') # put the robot in a known state
for i in reversed(range(10)):
    print i,
    time.sleep(1)
print
ser.write('\x80\x83') # put the robot in safe mode
time.sleep(0.1)

ser.flushInput() # discard everything we've seen so far

print "Press Ctrl+C to quit."

try:
    while True:
        ser.write('\x8e\x12') # request buttons
        print "Got " + hex(ord(ser.read()))
        time.sleep(0.25)
except:
    pass

ser.close()


答: Just using the words in the terms. Motion Planning would be the planned motion of a system to achieve a goal, this would have values even for a system at rest. Whereas Trajectory Generation would be the potential trajectories of a system, and when at rest would be zero. I was thinking about a robotic ship mapping the trajectories of itself and a second robotic ship and if a potential collision was indicated, then some motion planning would be required to attempt to avoid the collision. </p>

Title: What is the difference between motion planning and trajectory generation?

Body: What are the major differences between motion planning and trajectory generation in robotics? Can the terms be used interchangeably?</p>


答:
Trajectory generation comes from the robot arm / manipulator community.  Motion planning is essentially the "same" thing in a wider sense used in ground robotics etc.  Both can use kinematics / inverse kinematics, dynamics, fuzzy logic etc. Read papers in both areas and you'll see they are similar algorithms.

What came first and when, good question.  Since researchers were solving identical problems in different domains / applications the terminology drifted.

Trajectories can be any transition of the state space over time.  Rocket into space. Satellite geosynchronous. ICBM hitting Moscow. Robot arm, robot locomotion etc.


问:
Good Microcontrollers/SOCs for a Robotics Project
I am looking for a starting point for my project, preferably using popular systems (ones there is a lot of support for). I have an Arduino Uno, a Raspberry Pi, and a lot of willpower :) Anyone here built a project using the systems above?

Observation: I'd like to start with a simple line-following vehicle and build up afterwards.

答:
I built a line following robot with an Arduino before.  It was really simple to do and all we used were color sensors on the bottom inputted in the Arduino, and then of course some motors for the wheels.

But using an Arduino allowed us to have plenty of room for other components we wanted to add on to make our robot do more things.

Also, if you want to see some line following code we used just ask in a comment, but it obviously depends on your setup with the sensors and how you want it to turn at intersections and things like that.


问:
How can I optimise control parameters for a stepper motor?
As an industrial roboticist I spent most of my time working with robots and machines which used brushless DC motors or linear motors, so I have lots of experience tuning PID parameters for those motors.

Now I'm moving to doing hobby robotics using stepper motors (I'm building my first RepRap), I wonder what I need to do differently.

Obviously without encoder feedback I need to be much more conservative in requests to the motor, making sure that I always keep within the envelope of what is possible, but how do I find out whether my tuning is optimal, sub optimal or (worst case) marginally unstable?

Obviously for a given load (in my case the extruder head) I need to generate step pulse trains which cause a demanded acceleration and speed that the motor can cope with, without missing steps.

My first thought is to do some test sequences, for instance:

Home motor precisely on it's home sensor.

Move $C$ steps away from home slowly.

Move $M$ steps away from home with a conservative move profile.

Move $N$ steps with the test acceleration/speed profile.

Move $N$ steps back to the start of the test move with a conservative move profile.

Move $M$ steps back to home with a conservative move profile.

Move $C$ steps back to the home sensor slowly, verifying that the sensor is triggered at the correct position.

Repeat for a variety of $N$, $M$, acceleration/speed & load profiles.

This should reliably detect missed steps in the test profile move, but it does seem like an awfully large space to test through however, so I wonder what techniques have been developed to optimise stepper motor control parameters.

答:
The "math" way to do this is to generate a speed/torque curve for your stepper at its given voltage, and determine the maximum force that will be applied to the object in motion (in this case, the largest force is likely to be acceleration).

Note that most hobby 3d printers are so flimsy that the frame bending under acceleration will harm print quality long before you start missing steps.  In this case, you could model the deflection of the frame under load.

In my experience, 90% of missed steps are caused by mechanical or software problems such as the axes binding or pulses being missed.  Try moving everything by hand to check if it is smooth.

Overly aggressive speeds and accelerations should be visible (and audible) on a 3d printer long before the steppers stall.

Generally a single missed step will also cause the next steps to also be missed (since the motor must now work even harder to catch up) and you get a few seconds of buzzing instead of motion.


问:
Can mapping be done in real life applications without also solving the localization problem at the same time (i.e. SLAM)?
I know that Occupancy Grid Mapping requires the assumption that the robots' pose is always known when generating a map.  However, I also know that in reality, position and orientation usually treated as uncertain in practical applications.  Assuming that my target mapping environment is inside a home, is there a way I can overcome inherent robot pose uncertainty in a real world application of Occupancy Grid Mapping without resorting to implementing a SLAM?  That is, what is a low-cost way to increase the certainty about my pose?

Or is Occupancy Grid Mapping only useful in theory and not in practice?

Update:

It is clear to me, from the responses given, that occupancy grid mapping is just one possible way to represent a map, not a method in and of itself.  The heart of what I really want to know is:  Can mapping be done without also solving the localization problem at the same time (i.e. SLAM) in real life applications?

答:
First off, occupancy grid mapping is just one possible representation of a map. I think your question really applies many map representations. Here are my thoughts.

Mapping without SLAM

Whether or not you can build a map from your sensor measurements without fully implementing SLAM depends on a couple things:

Do you have absolute sensors for localization? For example, you could drive all day, and if GPS is always available, your localization error will not grow. Or if you are indoors, external camera systems (i.e., not on your robot and in known positions) can serve the same purpose. If you do have absolute sensors, the accuracy of your map can only be as accurate as the uncertainty of your absolute localization sensor compounded by the uncertainty of your mapping sensor.

If you only have relative localization sensors (e.g., wheel encoders, IMU, camera mounted on the robot), you will have dead-reckoning error. The error in your pose estimate will grow over time. Then you have to ask yourself: is it growing at a small enough rate that I can produce a good enough map before the pose is too uncertain? Note that this approach is almost never used (you would implement SLAM instead).

In general, you need to answer these questions: What sensors do I have available? How accurate does my map need to be for its application? You asked about a low cost way to improve your pose estimate. Well the lowest cost of them all is to implement SLAM! In particular, if you "close the loop" (i.e., revisit earlier landmarks), you can drastically curtail the effects of dead-reckoning. But to answer your question with an actual sensor, take a look at setting up cheap stationary cameras that can triangulate the pose of the robot.


问:
Drones and camera streaming
How do you stream video feed from a camera on a drone? I would think that at high altitudes Wi-Fi won't work.

So what would you usually do, and how?

答:
It all depends on the video quality that you require. The short answer is to use a 3G or 4G transmitter, assuming that you are in an area with mobile coverage, to either a local device (Mobile phone) or a cloud based service.

Other options exist, including the use of XBee networks. XBee networks (depending on the series used and protocol, and whether you employ a regular or pro device) can offer ranges from a couple of dozen meters up to 16Kms or more (using a 900 MHz XBee Pro (in the US), or a 868 MHz XBee Pro (in the EU)). However, the data rate of an XBee will probably not be sufficient to carry video1.

However, Wi-Fi can be used for fairly large distances. The range of a Wi-Fi signal, can range from 300 to 2000 meters, depending on equipment and conditions. The range will varies due to a number of factors:

Power of the transmitter. The bigger the antenna the further the
signal will radiate, with less attenuation;

The antenna used.  In ascending order of power Whip (or wire), Chip,
PCB, or external (via a U.FL or RPSMA connector);

The frequency used. Generally the lower the frequency the further the signal can travel. A 5GHz network has a shorter range than 2.4 GHz;

The environment. Nearby trees, buildings, direct line of sight,
atmospheric conditions, etc. can all negatively affect the range of
the Wi-Fi signal. A direct line of sight on a clear day is obviously
a better environment than in a forest on a foggy day.

Don't forget that the quality of the stream will be less than if you were to record directly to an on-board storage (i.e. SD card).

1 From x-bee for video transmission?

The data rate is a non-starter. Xbee is designed for serial communications at a max of 230kbps. That's too slow for any kind of decent video

and

2.4 GHz Xbee products as well as 800 MHz products have data rates below 250kbps.

Mind you, this, again, all depends on the video quality that you require. The thread Can you use XBee to transmit video? points to a Wikipedia article, which states:

Video

16 kbit/s – videophone quality (minimum necessary for a consumer-acceptable "talking head" picture using various video compression schemes).

Another thread, notes that the XBee's 250kps is half duplex, so that actual data rate is only ~125kbps. So, it would depend on the data rate of the camera that you wish to use.

Title: Drones and camera streaming


问:
Detect human in proximity?
I'm looking for ways to detect human presense behind walls in close proximity (around 10 feet) in whatever way possible! Problem is I can't code! (I hope it's ok I'm posting here.)
I know there are different sensors but they all seem to be for detecting by motion of target humans.
How do you detect still persons?
Is there a sound amplification device that magnifies human breathing x 20?
Or detect body heat?
Or pick up radiation waves or something off humans?</p>

答:
The idea and research of through-wall imaging with uwb radar system has been around for many years.

Saw a product demonstration in technology exhibition recently. The display was a 'wave pattern' that needs 'human interpretation', rather than a layman-clear display as in marine radar polar display.

Try search
here

Similarly, ground penetration radar has been a more on-going field application product

Try search
here

Unlike time-proven and field operational civilian radars (ship, sea-port traffic, airport and weather) where the target signal is significantly stronger than background reflections, human reflection inside a room that is much larger than human body and may have metal objects that reflect strongly, is, in most cases, weaker than background.

If human moves, there is changes, before-and-after the move and can be 'seen' on the 'wave pattern' display by trained operator.

There are research paper here use filtering to get weak human breathing motion signal from noisy background.

Title: Detect human in proximity?


问:
I need help with choosing a computer on the board
I need a computer on the board like raspberry pi for vending machine (I want to replace the original controller). This is list of some requirements:

1) It should have pins to connect to the mdb protocol & other stuff through gpio.

2) Good performance. There will be a display with browser showing rails application running. I've tried a raspberry pi B+, but it's too slow (it can't even run a browser with speed like a laptop pc). So, I want to choose a more powerful system like odroid, wandboard etc.

3) Custom video output. Sometimes I need to display FullHD(1920x1080), sometimes I need to show at 768x1024 (yes, the computer should simply rotate video output)

4) I don't want to connect microcomputer to display directly, not through HDMI, DVI or something like this. (This is not required, but very desirable).

Please help me choose. Nowadays I try to choose from odroid, wandboard or pandaboard. Are there any other computers? What version of the computer is advisable?

答:
Nevertheless I can only recommend the Nvidia Jetson TK1 board!
https://developer.nvidia.com/jetson-tk1

Great performance, cheap and with GPIO and HDMI.
Perfect support for Ubuntu Linux.

BTW: I don't get your point 4)