问:
Localization of a Robot to find it Coordinates according to the Known Map
I am a third-year electrical engineering student and am working on an intelligent autonomous robot in my summer vacations.

The robot I am trying to make is supposed to be used in rescue operations. The information I would know is the position of the person (the coordinates of the person in a JSON file that can be changed anytime except during the challenge) to be rescued from a building on fire. I would also know the rooms of the building from a map, but I don't know where the robot may be placed inside the building to start the rescue operation.

That means I have to localise the robot placed at an unknown position in a known environment, and then the robot can plan its path to the person who has to be rescued. I can use gyroscope, accelerometer, magnetometer and ultrasonic sensors to do the localising job. I cannot use a GPS module or a camera for this purpose.

The object to be rescued (whose location is known in terms of coordinates & can be changed anytime) is surrounded by walls from 3 sides. Hence, adding more walls in this map.

According to my research particle filter is the best method used for localization of robot. But how can I deal with the landmarks (walls) that are fixed as shown in the map image and that are variable depending on the location of the object to be rescued being provided in the JSON file?

I can do the path planning from a known position to the target position, but I'm not sure how to determine the starting position.

More about JSON file:
(1) json file containing the coordinates of the object to be rescued can change. (2) it won't change during the challenge. (3) json file will be provided to me in an SD card that my robot has to read. I have successfully written the code that will allow the robot to read the json file and hence the coordinates of the object to be rescued.

Here is the map of the building which is known to me.

答:
Particle filter

According to the OP a robot with at least a distance sensor is available and a map too. That's a nice starting point for developing a hypothesis tracker aka particle filter. At first a game engine is needed which simulate the map and the position of particles. The game-engine calculates the expected sensor-information from the distance-sensor. E.g. the particle is on left top in the map and direction is "north" and the game-engine says "distance=10 cm". This is done for every random particle in the map.

Now comes the nice part: a particle will be deleted which has the greatest difference to the real measurement. That means, if the robot has a real distance of 5 cm on the sensor, than a particle with a distance of 200 cm can not be the right one. After deleting the particle the robot will be moved ahead, and the particles also. Again, the worst particle has to be deleted.

From a theoretical point of view, this is called a hypothesis elimination. It means, that the algorithm deletes the particle with the lowest probability to be the right answer. After a while a particle cloud with the real position of the robot is remaining.

Landmarks

Fixed landmarks in the map (like a door which is marked with a red line on the ground) can be easily integrated in the particle filter because in the map are particles who fulfill the conditions and others who don't. E.g. if the real robot detect a door, all particle in the game-engine who not detect the door are wrong. A more complicated task are variable landmarks which can be anywhere in the map. These obstacle change the map itself and create an extended problem called SLAM (=map building). Algorithms like FastSlAM  and Hyperparticle  (every particle has its own map) build a map and localize together.


问:
Using a six wire stepper motor with L298n
I am using a L298n IC and (not a driver shield) and an Arduino.

I would like to know how to use the IC with the Arduino to run a six wire stepper motor.

Could I have a detailed explanation for wiring the IC connections on the breadboard and the Arduino?

答:
G. Andrew Stone posted the following schematic of L298N and Arduino with Arduino sketch source code to drive a stepper motor using the L298 chip:

```<code>Pin number on L298N
    pin on Arduino
        function
1   -   SenseA; connect through 0.5 Ohm sense resistor to power GND
2   -   one end of coilA on stepper motor
3   -   other end of coilA on stepper motor
4   -   VS: connect to "42V" motor power, and to the middle wire of both coils.
5   5   IN1
6   "5V"    ENA
7   4       IN2
8   GND     GND (hook to both power supply GND and Arduino GND)
9   "5V"    VSS
10  3       IN2
11  "5V"    ENB
12  2       IN4
13  -   one end of coilB on stepper motor
14  -   other end of coilB on stepper motor
15  -   SenseB; connect through 0.5 Ohm sense resistor to power GND
</code>```

Also:

connect a capacitor (typically 0.1 uF or 1 uF) between L298 "VS" (4) and GND (8)

connect a capacitor (typically 0.1 uF or 1 uF) between L298 "Vss" (9) and GND (8)

connect the motor power supply (42VDC to 5VDC) between L298 "VS" (4) and GND (8)

external flyback protection diodes

The L298P -- the same chip in a PowerSO20 package -- has completely different pin numbers. For more details, see the datasheet for the L298.

ContentLicense: CC BY-SA 3.0

Body:
G. Andrew Stone posted the following schematic of L298N and Arduino with Arduino sketch source code to drive a stepper motor using the L298 chip:

Pin number on L298N
    pin on Arduino
        function
1   -   SenseA; connect through 0.5 Ohm sense resistor to power GND
2   -   one end of coilA on stepper motor
3   -   other end of coilA on stepper motor
4   -   VS: connect to "42V" motor power, and to the middle wire of both coils.
5   5   IN1
6   "5V"    ENA
7   4       IN2
8   GND     GND (hook to both power supply GND and Arduino GND)
9   "5V"    VSS
10  3       IN2
11  "5V"    ENB
12  2       IN4
13  -   one end of coilB on stepper motor
14  -   other end of coilB on stepper motor
15  -   SenseB; connect through 0.5 Ohm sense resistor to power GND

Also:

connect a capacitor (typically 0.1 uF or 1 uF) between L298 "VS" (4) and GND (8)

connect a capacitor (typically 0.1 uF or 1 uF) between L298 "Vss" (9) and GND (8)

connect the motor power supply (42VDC to 5VDC) between L298 "VS" (4) and GND (8)

external flyback protection diodes

The L298P -- the same chip in a PowerSO20 package -- has completely different pin numbers. For more details, see the datasheet for the L298.


答:
This is a good tutorial to get you started.

https://alselectro.wordpress.com/2014/04/25/stepper-motor-control-with-l298-arduino/

Title: Using a six wire stepper motor with L298n

Body:
I am using a L298n IC and (not a driver shield) and an Arduino.

I would like to know how to use the IC with the Arduino to run a six wire stepper motor.

Could I have a detailed explanation for wiring the IC connections on the breadboard and the Arduino?


问:
Directly observing lidar laser rays
I am working with SICK lidars and have to mount/unmount them quite often on my robot. The mounting process is very tedious especially when it comes to making sure that the lidars are horizontal. I thought about using IR goggles (like the night vision ones) and some fog machine (like the one in nightclubs) in order to see the surface covered by the lidar's rotating laser ray. As a result I would expect to see something like this but planar.

Before thinking about trying to get my hands on such hardware I wanted to ask:

Do sick laser have enough intensity to be observed by such goggles?
Does anybody tried such an approach?

答: A digital camera, even on a cell phone will pick up the IR light. A darkened room will help it to show more prominently. No sense in buying any crazy equipment when the phone in your pocket will probably do what you want.</p>

Title: Directly observing lidar laser rays


问:
How to know what type of stepper motors to use when designing a robot
I am talking about robots like this one: http://www.meccanotec.com/step781b.JPG

How would a person know what type of motor to use in design of such a robot? What I want to understand is that stepper motors have different step sizes, different torques among other things. How do we determine what type of stepper motor is most suitable to be used in a given robot?

答:
Math is the short answer. You need to figure out what you want the motor to do, i.e. how much it needs to lift, amount of torque etc. You also need to consider how it is going to be powered. If its going to run on a battery you may want to get a motor that will do the minimum work required to save battery life. If it's going to run on standard AC power from a wall outlet, this won't be as much of a concern. Your robot arm design will also change the values of the power/torque needed because of leverage. If it's going to be belt driven, direct drive etc will all figure into this too.

My suggestion for a small robot arm would be to start with a kit where the parts have been matched for compatibility and go from there. If not a kit nema 17 motors are probably enough for what you need, but they come in all different specs.

The nice thing about steppers is that they can be stopped and started at specific places in they're rotation pretty easily.

Again, unless you're really good at math and physics, a kit is the way to go as a beginner.

Just realized how old this is, whoops.


问:
Sensors in Collaborative Robots
I'm currently doing some research on collaborative robotics. One area of interest is the type of sensor(s) used in these kind of machines.

I had a look at some robots by FANUC and Universal Robots and I've noticed that they do not come equipped with sensors; they are sold as an add-on.

Is this inherent with collaborative robots? Do customers need to buy sensors as an add-on - which has advantages and disadvantages.

Thanks for your help.

答:
This question seems to be about robots collaborating with people -- not with each other.  In general, it might be unsafe for a person to stand near a machine that's capable of exerting harmful levels of force in any given direction.  One way to avoid that, as is mentioned in the question, is by using sensors to detect any human-like objects in its path.

However, robots can still be safe even without internal sensors.  The WAM arm has configurable torque limits -- read from its own motors --, which can be set low enough such that the arm will disable itself if it runs into something.

You could also do what the PR2 robot does: exert very little force in each of its joints.

Keep in mind that just because the robot senses something, it needs a fair amount of intelligence and mechanical capability to act in a way that will protect a person.  In other words, the simple safety designs are just as important as the sophisticated ones.

Title: Sensors in Collaborative Robots


问:
Generate synthetic accelerometer data based on (x,y,z) coordinate
I would like to create a simulation model (basically a signal generator) which will allow me to generate the 3 output signals of an accelerometer based on 3 location input signals (x,y and z). I would like a more realistic model of the data produced by an accelerometer (with some noise and bias offsets).

How can I convert the series of points into a simulated accelerometer output?

Specifically:

I have a series of positions which describe a trajectory in 3D space...If an accelerometer was moving along the trajectory described by the series of positions, I am interested in knowing (simulating!) the data that the accelerometer would produce as the result of moving along the described trajectory.

I could just calculate the 2nd derivative of the trajectory, but that would probably be too ideal. I am looking for a model which is more realistic.

答:
The easiest way to simulate a messy "real world" sensor from an ideal simulation is to look at what effects a sensor has to overcome.

For example:

vibrations at multiple frequencies

impulse noise

dampened vibrations of the sensor itself (due to momentum of the vehicle)

the sensor being improperly aligned to the vehicle

gravity

other effects from motion of the vehicle's internal movements (e.g. suspension bouncing)


答:
The key phrase in your question is "most suitable".  Only you can define what this means.

Generally you need to understand the requirements of your project -- in hard numbers -- before you can make design decisions like which motors to use.  How much weight will need to be moved by the robot?  How fast will it need to move?  How precisely?  And so on.

Title: How to know what type of stepper motors to use when designing a robot

Body:
I am talking about robots like this one: http://www.meccanotec.com/step781b.JPG

How would a person know what type of motor to use in design of such a robot? What I want to understand is that stepper motors have different step sizes, different torques among other things. How do we determine what type of stepper motor is most suitable to be used in a given robot?


问:
Resetting position of e-puck in Webots using Supervisor node - problem with getting a handle to the robot
I am writing a method (Java) that will reset the position of e-puck in Webots. I have been following tutorial on Supervisor approach. I have two controllers in my project:

SupervisorController extends Supervisor - responsible for genetic algorithm and resetting e-puck's position

EpuckController extends Robot - drives the robot

Robots are communicating via Emitter and Receiver, and everything works fine but the position reset.
This is what I'm doing in SupervisorController:

```<code>412 Node epuck = getFromDef("epuck");
413 Field fldTranslation = epuck.getField("translation");
</code>```

And as a result I get this exception:

```<code>[SupervisorController] Exception in thread "main" java.lang.NullPointerException
[SupervisorController]  at SupervisorController.initialise(SupervisorController.java:413)
[SupervisorController]  at SupervisorController.main(SupervisorController.java:497)
</code>```

epuck variable is null. I tried calling different methods on epuck, and they all resulted in NullPointerException. The name of e-puck matches the world file.

```<code>DEF EPUCK DifferentialWheels {
  translation 0.134826 -0.000327529 0.107963
  rotation 0.0244439 0.999246 -0.0301538 1.95838
  children [
  (........)
  ]
  name "epuck"
  controller "EpuckController"
  axleLength 0.052
  wheelRadius 0.0205
  maxSpeed 6.28
  speedUnit 0.00628
}
</code>```

I would appreciate any advice on how to get a handle to the robot or where to look for issues in simulation/code.

答:
The Solid nodes (including Robot and Supervisor nodes) have a DEF name, like any other node and it is usually written in upper-case. These nodes also have a field "name". Both may be used by a Supervisor, it depends on which function is called.

In my case, the function getFromDef() expects a DEF name as argument, and not the name from the "name" field. The DEF name of my e-puck is "EPUCK" - hence modifying controller to:

```<code>Node epuck = getFromDef("EPUCK");
</code>```

solved the problem.

ContentLicense: CC BY-SA 4.0

Body:
The Solid nodes (including Robot and Supervisor nodes) have a DEF name, like any other node and it is usually written in upper-case. These nodes also have a field "name". Both may be used by a Supervisor, it depends on which function is called.

In my case, the function getFromDef() expects a DEF name as argument, and not the name from the "name" field. The DEF name of my e-puck is "EPUCK" - hence modifying controller to:

Node epuck = getFromDef("EPUCK");

solved the problem.


答:
Very little is inherent to collaborative robots, and this is especially true for sensors.

The term 'collaborative robot' is still new in the industrial world and there is a bit of hype and variation in meaning in what exactly they are talking about.

In general a collaborative robot will be one that expected to do its work with a human in its workspace. There is ISO standardization around this and the focus is on safety.

In the domain of collaboration, there are two main things we want to do in my view.

1) We want to know where the human is relative to the robot so we can operate the robot in a more performance oriented manner when the human is far enough away. This could be as simple as always moving safely and stopping (moving even more safely) when in contact with a human. It could be as complex as tracking human kinematics and moving more 'dangerously' based on the distance between the robot and person and the dynamics between them. Think of the knife-between-fingers scene in Aliens.

2) We want to receive commands from the human so that the robot can collaborate. This might be lead-through teach and play programming, or one might simply sit down at a robot workbench and block off the area you want to use with your arms, like a little kid at the art table establishing their space.

You can see this is a big domain with a lot of possibilities. So when it comes to specific products, you will have to sit down with each vendor to find out what exactly is 'collaborative' about their robot and what package of options is needed to achieve that collaboration. There is no standard of what collaboration means, nor what sensing is used.

One thing to note is that collaboration is completely separate from the actual task of the robot. End tooling, tool changers, fixtures, etc all need to be considered in addition.

Title: Sensors in Collaborative Robots

Body:
I'm currently doing some research on collaborative robotics. One area of interest is the type of sensor(s) used in these kind of machines.

I had a look at some robots by FANUC and Universal Robots and I've noticed that they do not come equipped with sensors; they are sold as an add-on.

Is this inherent with collaborative robots? Do customers need to buy sensors as an add-on - which has advantages and disadvantages.

Thanks for your help.


问:
How is the absolute flash size calculated in a microcontroller?
I am working with an STM32F103C8 which has a flash size of 64kBytes.

Now i am using ChibiOS 2.6 and the build file is a binary file of 82kBytes.

Using ST-Link Utility, the program is getting dumped into the microcontroller's flash.

My question is how come a 82kB code fits in the 64kB Flash?

How is the size of that .bin calculated? I am attaching a picture of the display.

I did a compare ch.bin with device memory and it doesn't report any errors found.

All parts of the code work just fine, i don't see any problems anywhere tried all the features of the code, nothing breaks or behaves abnormally.

Could someone please explain this?

Thanks!

答:
I see that the STM32F103x8 has 64 KB of Flash + 20 KB of SRAM = 84 KB of memory -- is it a coincidence that your build file is close to that size?

Many microcontroller development systems store the final compiled executable in a "binary" file in Motorola S-record format or Intel HEX format or some other format that uses 2 byte of disk space to store 2 hexadecimal digits in the file for each byte of programmable memory in the chip, plus a little more metadata overhead. An executable file that almost completely filled 64 KB of Flash would, when stored in any of those hexadecimal formats, use close to 128 KB disk space.
Does your build system perhaps use such a hexadecimal format?


问:
Autonomous Navigation without Distance Sensors
I'm doing a project with the iRobot Create 2. I want it to be able to map out a room and navigate to a point for example. My problem is that the robot doesn't have any distance sensors. What it can do is detect if there is an obstacle ahead of it or not (0 or 1) and it can measure how far it has traveled in millimeters. Any good techniques out there or best to buy an IR sensor?</p>

答: I would suggest you better used some ultrasonic sensors. iRobot is compatible with both arduino and raspberry pi. There are lots of good and cheap sensors, for both platforms, along with some good examples on the net. You have to find a way to save the data though. That means two things: 1. you need extra space to save those (if in arduino) and 2. find a formula to create them. What you suggested with the travel per millimeters should definitely be into consideration. Sensors are to declare what and where is an obstacle. Another problem is making your robot "unerstand" in which point of the mapped area is it moving at a given time, so that it won't have to check again what an obstacle looks like. Last but not least, it has to know when to stop mapping a room. Start by letting it calculate the dimensions of the area it will be moving into (going round the walls).</p>


问:
Dynamically detect changing obstacles
So the idea is that there would be one robot acting as overwatch, which would detect all of the obstacles in an area (which are not necessarily static), and then send the data about the obstacles' positions to another robot that would navigate around the obstacles to a goal.

My initial thought was to have the overwatch robot be in an elevated position in the centre of the area, then sweep around using an ultrasonic sensor. This way, it could keep track of the obstacles in a set of polar coordinates (distance, angle). But then I realised that this method doesn't account for collinear obstacles.

So the question is, what is the best way to detect a bunch of non-static obstacles within an area?

As a side note, I have seen a system similar to this, where there was a robot detecting obstacles (in that case, a crowd of people) and another robot pathfinding around the obstacles (the people), but I'm unsure exactly how that system was detecting the obstacles.

答:
You can use ultrasonic sensor or IR sensor. Ultra sonic sensor is bit complicated but its very useful for your project and it could also help you in your future projects. there are various websites that will help and some of them are listed below.
http://www.instructables.com/id/Ultrasonic-Range-detector-using-Arduino-and-the-SR/

https://www.youtube.com/watch?v=PG2VhpkPqoA

GOOD LUCK.

Title: Dynamically detect changing obstacles


问:
Will this pseudocode work as a basis for a flight controller?
I'm programming a flight controller on an Arduino. I've researched how other people have written theirs but without notes it's often so obfuscated that I've decided it will be easier and better to write my own.

This is my pseudocode thus far, will this work?

all of this will happen inside the constant Arduino loop

Read RX signal

Calculate desired pitch, roll, and yaw angles from RX input

Signal ESCs using PWM in order to match desired pitch, roll, and yaw from RX input

Gather IMU values (using Kalman filter to reduce noise)

Compare filtered IMU values vs. RX input to find errors in desired outcome vs. actual outcome

Use PID algo to settle errors between IMU vs. RX

Rinse and repeat

Suggestions are greatly appreciated

答:
The signals to the ESC's using PWM should be sent after the PID algo is done processing the errors. The output calculated from the PID is the PWM value to be sent to the ESC's to actuate the motors in such a way that they move to reduce the error thus obtaining the desired orientation

So the right order is:

Read RX signal

Calculate desired pitch, roll, and yaw angles from RX input

Gather IMU values (using Kalman filter to reduce noise)

Compare filtered IMU values vs. RX input to find errors in desired outcome vs. actual outcome (Get error (Target - Measured) for PID algorithm input)

Use PID algo to settle errors between IMU vs. RX

Use output of PID controller (assuming gains are already tuned properly) as PWM signal to the ESC's

Rinse and repeat

These resources might be of help in the future:

Quadcopter PID Algorithm

Different PID Architectures

Cascaded PID Controller Explained

PID output does not reach setpoint precisely enough

Is it possible to stabilize a quadcopter considering only angle measurements?


问:
Web mapping that can be used for autonomous vehicles/robots
Is there web mapping tool that allows developers to use it to plot GPS data of autonomous vehicles/robots?

Google Maps forbids it. See 10.2.C. Google Earth terms of use link jumps to the same page. Bing Maps looks the similar (see 3.2.(g)).

What I want is a internet-based tool that shows either/both satellite images and/or map, which can overlay plot using its API. I'm making a generic GPS plotter on ROS that could be used both for slow robots or fast vehicles/cars.

Thanks!

答:
Google Earth exists for precisely this purpose: overlaying your own data on a map.  You simply write scripts to translate (or export) your data into KML format then add the URL to Google Earth like so:

(source: woopra.com)

With regard to terms of use: the terms of use for Google Earth only forbid you to use the software to control the behavior of your vehicle, not to represent its past behavior.  (Their concern is most likely to limit their liability from you trying to draw a path on a road in GE for a robot to follow, and having it crash into something due to a map inaccuracy.)

As quasi-proof, I wrote a mission planner with Google Earth at one point (http://www.youtube.com/watch?v=vK0wWH9Ijnk) which I showed to the Google Earth team; they were fine with it.  They also put me in touch with a team at NASA that uses Goole Earth for this purpose.  I'm led to believe that such usage is allowed since I'm only generating mission scripts and not interacting with the autonomy.


问:
Difference between SLAM and "3D reconstruction"?
I'm reading this paper: http://arxiv.org/abs/1310.2053 (The role of RGB-D benchmark datasets: an overview) and see the following words:

Thanks to accurate depth data, currently published papers could
  present a broad range of RGB-D setups addressing well-known problems
  in computer vision in which the Microsoft Kinect ranging from SLAM
  [10, 12, 19, 17, 35, 11] over 3d reconstruction [2, 33, 38, 32, 1]
  over realtime face [18] and hand [30] tracking to motion capturing and
  gait analysis [34, 41, 8, 7, 4]

I thought of the term SLAM and 3D Reconstruction being the same thing, while the paper says the opposite with a bunch of citations (which still haven't tell the two apart).

In my opinion, Mapping in SLAM is the same term as 3D Reconstruction, while Localization is the essential part for Mapping. So I don't find a difference between SLAM and 3D Reconstruction, am I wrong (or is the author misclassfying)?

答:
You are right about the sameness of SLAM and 3D reconstruction. At the same time I don't think the author is misclassifying.

The english is a little non-standard. The author could have better said it as:

...ranging from SLAM to 3D reconstruction to realtime face and hand tracking to ...

I think the paper lists both separately to better organize their references more than to highlight the differences.

The differences depend on what your viewpoint is. If you consider navigating an archeological site with a vehicle versus recording data about the site for historical preservation, they are different. Differences in sensors and real-time vs offline processing, and what algorithms work best in each situation.

Perhaps the main difference to consider is that in 3D reconstruction, the path of the sensors is not part of the goal and is discarded (or not estimated) at will. Meanwhile, in SLAM, the actual geometry and content of the environment is not as important as it's topology and your ability to localize within it.

The algorithms you mention, Kinfu, ElasticFusion, etc, call themselves SLAM, dense maps of the environment, and perhaps represent an evolution in the technology where the processing power and sensing available means that one need not optimize towards one goal (reconstruction) or the other (navigation). So you can look at it as the two categories, SLAM and 3D reconstruction, converging.


答:
The difference is largely intent. SLAM is largely used to describe the mapping procedure used when navigating an unknown environment. This is done online so the most recent state estimates are available to the navigator. 3D reconstruction is often a post processing procedure to create a 3D map of some environment.

Or put another way: slam is an iterative process that creates an updated map with each new estimates while 3D reconstruction is a batch process that is run after all measurements have been collected.

Title: Difference between SLAM and "3D reconstruction"?

Body:
I'm reading this paper: http://arxiv.org/abs/1310.2053 (The role of RGB-D benchmark datasets: an overview) and see the following words:

Thanks to accurate depth data, currently published papers could
  present a broad range of RGB-D setups addressing well-known problems
  in computer vision in which the Microsoft Kinect ranging from SLAM
  [10, 12, 19, 17, 35, 11] over 3d reconstruction [2, 33, 38, 32, 1]
  over realtime face [18] and hand [30] tracking to motion capturing and
  gait analysis [34, 41, 8, 7, 4]

I thought of the term SLAM and 3D Reconstruction being the same thing, while the paper says the opposite with a bunch of citations (which still haven't tell the two apart).

In my opinion, Mapping in SLAM is the same term as 3D Reconstruction, while Localization is the essential part for Mapping. So I don't find a difference between SLAM and 3D Reconstruction, am I wrong (or is the author misclassfying)?


问:
Is there a portable and accurate sensor to measure the position of the hand relative to the body?
My team has been working on a wearable glove to capture data about hand movements, and use it as a human-computer interface for a variety of applications. One of the major applications is the translation of sign language, shown here: https://www.youtube.com/watch?v=7kXrZtdo39k

Right now we can only translate letters and numbers, because the signs for them require the person to hold their hand still in one position ('stationary' signs). I want to be able to translate words as well, which are non-stationary signs. Also the position of the hands really matters when signing words, for example it matters whether the hand is in front of the forehead, eyes, mouth, chest, cheeks, etc.

For this we need a portable and highly accurate position sensor. We have tried getting position from a 9-DOF IMU (accelerometer, gyroscope, magnetometer) but as you might guess, there were many problems with double integration of the noise and accelerometer bias.

So is there a device that can provide accurate position information? It should be portable and wearable (for example worn in the chest pocket, headband/cap, etc...be creative!).

EDIT (more details):

I'm going to emphasize certain aspects of this design that weren't clear before, based on people's comments:

My current problem of position detection is due to errors in double integration of the accelerometer data. So hopefully the solution <s>has some incredibly powerful kalman filter (I think this is unlikely) or </s> uses some other portable device instead of an accelerometer.

I do not need absolute position of the hand in space/on earth. I only need the hand position relative to some stable point on the body, such as the chest or belly. So maybe there can be a device on the hand that can measure position relative to a wearable device on the body. I don't know if such technology exists; I guess it'd use either magnets, ultrasound, bend sensors, or EM waves of some sort. Be creative :)

答: The problems of outdoor-tracking are described in http://www.tinmith.net/papers/piekarski-ismar-2006.pdf page 2. As a solution was named the WearTrack System which worked by ultrasonic technology. The system tracks the hand relative to the head of the user. Other hardware solutions are presented here https://www.evl.uic.edu/jelias1/vr-shapetape.pdf (ShapeTape Tracker) and here https://www.xsens.com/images/stories/PDF/Combining%20Motion%20Sensors%20and%20Ultrasonic%20Hands%20Tracking.pdf (ultrasonic tracker with gesture recognition).</p>


问:
Battery damaged?
Could you please see the attached battery images and tell me if it is safe to continue using this battery or should I discard it?

答:
I'm 14, please pardon me for any rookie sentences...

As far as my knowledge goes with Lithium Polymer batteries(not very far), they don't explode with a Hollywood style explosion, where flames go everywhere and everyone dies.

Instead, LiPo's start to smoke and the plastic cover on the outside layer of the LiPo will start to expand, when it cracks it releases hot steamy gas...

Judging by the damage, it looks like you dropped it... I don't this it's life threatening to use it... but I suggest you dispose it off, if you care about the electronics that are being powered by it...

Because the LiPo is 3 cell (11.1V) you can salvage working (undamaged) cells out. you will be able to use the undamaged cells for something else... you could also salvage the protective circuit (if the LiPo has it).

Title: Battery damaged?


问:
Smart Home Model with Raspberry Pi
I'm still new to RPi and I am currently trying to do a smart home model.

I planned to use RPi only to control 5 servos (which will be controlling the open/close of the doors by setting the angle) and 5 LEDs.

Will I need to use an external circuit to supply the power for the servos or is it fine to just connect them to the RPi?

答:
Raspberry Pis can be used for a huge range of things! And I like your idea!

Although, you could use an Arduino Pro Micro board as that has everything you need and doesn't have unnecessary items like Ethernet cables etc... It comes a lot cheaper - £2 here in the UK from Amazon!

Bence Kaulics explains it very clearly and I suggest you use that idea.

My suggestion is that you can use a relay board that the Raspberry Pi controls and the relay board will power the servos. Use a relay board because you need a stable current and voltage to power the servos, especially to move a window, you will need powerful servos. The relay can suit the needs and protect the servos.

You can also connect more items to the relay if you want to improve the smart home model by adding motion sensors outside the window and alarms.

Title: Smart Home Model with Raspberry Pi


问:
Determining the graspable range of a robot arm
I have a 6 DOF robot arm, and I want to do some object grasping experiments. Here, the robot is rigidly mounted to a table, and the object is placed on a different adjacent table. The robot must pick up the object with its gripper parallel to the normal of the object's table, such that it is pointing directly downwards at the point of grasping.

Now, the two tables have adjustable heights. For any given height difference between them. there will be a fixed range of positions over which the robot arm can achieve this perpendicular pose. What I am trying to figure out, is what the optimum relative distance of the tables is such that this range of positions is maximum.

Is there a way to compute this analytically given the robot arm kinematics? Or is there a solution which applies to all robot arms (e.g. it is optimum when the tables are at the same height)?

If it is important, the arm is the Kinova MICO: https://www.youtube.com/watch?v=gUrjtUmivKo.

Thanks!

答:
I think this is fundamentally a question of maximizing manipulability of a closed kinematic chain (the chain is closed by the object being grasped).

The good news is that others have asked and tried to answer this question. The bad news is that it's far from trivial and there's no easy analytic solution. This paper came to mind when I read the question:
https://dx.doi.org/10.1115/1.2829312. (You can find a pdf if you search online.)

Since you're not choosing any other kinematic parameters other than table height, it'd probably be easiest to just find a good spot with some trial and error.


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

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

答: Well this is embarrassing. I didn't realize they are in fact different distributions not variants. Also found the page where you can find out more about them: http://wiki.ros.org/Distributions </p>


问:
I-Robot Create 2 Connectors
Am I correct in assuming that the I-Robot Create 2 does not have the 25-pin connector like the original version of I-Robot Create has? Thanks much...Rick</p>

答:
That is correct. The Create 2 uses the same iRobot-proprietary 7-pin serial connector as the 500-800 series Roombas (and possibly the 900 series as well - I haven't checked yet).

While there are third-party options for Create 2 cables, I always advocate first-party parts & accessories. iRobot's cable for the Create 2 is $30. I have one, and it is very well built and has the length for your robot to scurry around while you're interfaced with it. You also don't need to worry about messing with USB-to-serial drivers as you do with third-party cables, iRobot's is pretty plug-and-play - even with ROS on Ubuntu.

On a somewhat related tangent:
Current scuttlebutt is that the Create 3 is not too far off from launch, and that it is likely to be based off of the 900 series Roombas (so a much more comprehensive sensor suite, much better battery, and built-in WiFi). But again, this is just rumor at the moment.

Title: I-Robot Create 2 Connectors


答:
I'd summarize my read of both of those as:

Don't use our logic to provide turn by turn navigation to vehicles

Don't use our maps for business asset tracking unless you've signed a commercial use agreement

Hard to tell if your use case described violates either of these terms.  In any case, check out http://www.openstreetmap.us/.

Title: Web mapping that can be used for autonomous vehicles/robots

Body:
Is there web mapping tool that allows developers to use it to plot GPS data of autonomous vehicles/robots?

Google Maps forbids it. See 10.2.C. Google Earth terms of use link jumps to the same page. Bing Maps looks the similar (see 3.2.(g)).

What I want is a internet-based tool that shows either/both satellite images and/or map, which can overlay plot using its API. I'm making a generic GPS plotter on ROS that could be used both for slow robots or fast vehicles/cars.

Thanks!


答:
Manuel Rodriguez's idea for the strip-flex potentiometers is about as good are you are going to get. Accurate 3D mapping is not something easily accomplished, let alone accomplished in a portable package. The only other solution I can think of is something like the Leap Motion - but that is far from portable.

Watching their video, they seem to be using the same thing for not just the fingers, but the wrist and elbow joints as well. I can't tell, but it looks like they might also be running OpenCV (or similar) alongside this as well.

The trouble is that it sounds like you aren't even sure exactly what the intended application of this technology is. Not trying to be patronizing but
what is the goal here? Why do you need an ASL-computer interface, and why does it need to be portable? Someone who needs to ASL for interpersonal communication should have no trouble interfacing with the average computer or smart phone - so I am assuming this is to allow them to communicate with people who do not know ASL (via gesture-to-computer-generated-speech)? If this is the case, then perhaps the solution you have picked is an overly complicated one to your problem.

I would suggest you revisit the drawing board all-together, and come up with a different approach. Perhaps a computer-vision application that can interpret signs, and run on a smart phone? Probably quicker, easier, and more accurate than trying to tackle a hardware problem that I have yet to see outside of a PhD thesis project in one of the world's top robotics research labs (and the one video on Youtube you linked to). Plus, such a solution could probably be later integrated into one of the existing 'universal translators' that Microsoft and Google are working on.

Title: Is there a portable and accurate sensor to measure the position of the hand relative to the body?

Body:
My team has been working on a wearable glove to capture data about hand movements, and use it as a human-computer interface for a variety of applications. One of the major applications is the translation of sign language, shown here: https://www.youtube.com/watch?v=7kXrZtdo39k

Right now we can only translate letters and numbers, because the signs for them require the person to hold their hand still in one position ('stationary' signs). I want to be able to translate words as well, which are non-stationary signs. Also the position of the hands really matters when signing words, for example it matters whether the hand is in front of the forehead, eyes, mouth, chest, cheeks, etc.

For this we need a portable and highly accurate position sensor. We have tried getting position from a 9-DOF IMU (accelerometer, gyroscope, magnetometer) but as you might guess, there were many problems with double integration of the noise and accelerometer bias.

So is there a device that can provide accurate position information? It should be portable and wearable (for example worn in the chest pocket, headband/cap, etc...be creative!).

EDIT (more details):

I'm going to emphasize certain aspects of this design that weren't clear before, based on people's comments:

My current problem of position detection is due to errors in double integration of the accelerometer data. So hopefully the solution <s>has some incredibly powerful kalman filter (I think this is unlikely) or </s> uses some other portable device instead of an accelerometer.

I do not need absolute position of the hand in space/on earth. I only need the hand position relative to some stable point on the body, such as the chest or belly. So maybe there can be a device on the hand that can measure position relative to a wearable device on the body. I don't know if such technology exists; I guess it'd use either magnets, ultrasound, bend sensors, or EM waves of some sort. Be creative :)


问:
IR distance sensor
I am trying to make a IR distance sensor. I have seen this online. My goal however is to see the distance between a IR transmitter and my IR sensor. In the example above he uses the IR led's ambient light and timing to track the distance. Is there a way to find the distance between lets say a IR remote and a sensor? It would only have to be accurate to about 1 meter. I am also open to other ideas of accurately tracking distance between two objects weither that be bluetooth/ir/ultrasonic </p>

答:
You would be better off setting up something that uses a stereoscopic technique. Think of something like this. Another similar product is the Leap Motion.

In your case, you could probably get away with just two IR sensors, and one emitter, because of your setup. However, "accurate to 1 meter" is not realistic for most kinds of IR rigs. They usually only function within 0.5 meters, but can be pretty accurate when tracking something inside of their range.

Title: IR distance sensor


答:
SLAM is jointly estimating the sensor pose and a map, based on a sensor model and sometimes a model for the pose change. The map can be represented in many different ways (e.g. landmark positions, occupancy grids, pointclouds).

3D reconstruction is used to estimate a 3D representation of the environment based on sensor data. There are many different ways to do this. SLAM can be part of the processing chain, but does not have to be.


问:
NameError: name 'TK' is not defined
I reference the following article.
http://www.egr.msu.edu/classes/ece480/capstone/spring15/group02/assets/docs/nsappnote.pdf

I have followed article's code,
but it appears:

How can i solve this problem?

答: Did you spell it right? Python is case sensitive and if you are using Tkinter it's spelled Tk().

Title: NameError: name 'TK' is not defined


答: I also agree that the stereoscopic technique will probably give you a better result. To implement this you have 2 options, either 1 led and 2 cameras or (I think the better option) 2 leds and 1 camera (which is the technique they used with the wiimote). You can see the second approach here</p>

Title: IR distance sensor

Body: I am trying to make a IR distance sensor. I have seen this online. My goal however is to see the distance between a IR transmitter and my IR sensor. In the example above he uses the IR led's ambient light and timing to track the distance. Is there a way to find the distance between lets say a IR remote and a sensor? It would only have to be accurate to about 1 meter. I am also open to other ideas of accurately tracking distance between two objects weither that be bluetooth/ir/ultrasonic </p>


问:
unable to install ros kinetic in ubuntu 16.04
I am trying to install ros kinetic kame in ubuntu 16.04 , but after trying the first step setup your sources. list.
I am getting  cannot create /etc/apt/sources.list.d/ros-latest.list: Permission denied what to do now</p>

答:
I understand that the problem was when running this command in the terminal:

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

Could it be you forgot to run it with sudo?


问:
More powerful alternatives to Lego Mindstorm NXT 2.0?
I'm interested to build Robot from my imagination, and I was looking to purchase a robotic kit.

I find the Lego Mindstorm NXT 2.0 really interesting for many reasons : You can plug whatever brick you want, and you can develop in the language you want.

I am a developer, and the use of this kind of robotic would be interaction mostly (not moving, so the servo motors are useless to me, at least now).

But regarding the spec of the NXT main component, I feel it's a bit low (proc, ram & rom).

That made me wonder if any of you know something similar (where I can plug whatever I want on it, and most importantly, program the reaction), but with a more powerful hardware ?

Price will also be a limitation : I like the NXT also because I can build what I want under 300 USD. I don't want to spend 10k USD on my first kit, but I would appreciate buying a better piece of robotic if the price isn't too distant from the NXT's.

Do you have some alternatives to check out ?

Thanks for your help !  :)

答:
I'd stick with a BeagleBone for the brains plus an Arduino Leonardo for the brawn.  This gets you a full computer capable of running Linux or Android with 512 MB of RAM and 800 MHz of CPU to write your AI and all the hardware capability that the Arduino ecosystem enables.  Connect the two together over USB and use a remote control library like Reflecta or Firmata to turn the Arduino into a set of 'remote hardware ports' for the Beaglebone.

A new entry into this space is the PCDuino from SparkFun.  Theoretically this combines both boards into one.  I haven't tried it out myself to validate however.

You should be able to put together a robot based on these parts for around your price range of $300.

BeagleBone

Arduino Leonardo

PCDuino


问:
Conversion GPS (longitude,latitude) to (x,y) of local reference frame?
I would like to use GPS data as measurement input for an extended kalman filter. Therefore I need to convert from GPS longitude and lattitude to x and y coordinate. I found information about the  equirectangular projection given these formulas:
$$\ X = r_{earth} \cdot \lambda \cdot cos(\phi_0) $$
$$\ Y = r_{earth} \cdot \phi $$

However I think these formulas are only for use when the axis x- and y-axis of my local frame are parallel to north and south axis of the earth.

But my vehicle is starting in my local reference frame in the origin and heading straight in y-direction. In whatever compas angle I put my vehicle, this should always be the starting position.
I can measure the angle $ \alpha $ to north with a compass on my vehicle.

Now what is the relationship between (longitude,lattitude) an (x,y) of my local frame?

答:
Why not have your starting frame be magnetic north and then adjust your starting position by whatever value your compass is reading?

Set your local frame equal to global frame one time, at the start, and you can use global reference sensors (GPS) without transforming for every sample thereafter (beyond the rectangular transform).

Your alternative (the way you do it), means you don't have to transform the starting sample, but then every sample afterwards you need to get your GPS position, reference that to your start position, then reference your start heading to get to the local frame.

The way you want to do it means you need to find the differential distance and apply a rotation to every sample. Do it the easy way - leave everything in global coordinates.


问:
is it possible to get all possible solutions of inverse kinematics of a 6 DOF arm?
I would like to know if there is any way to get all the possible solutions of inverse kinematics of a 6 DOF robotic arm?
I have found some good Matlab codes but gives only one solution like in Peter corke's book .
Thank you in advance.

答:
There's a good overview of inverse kinematics methods in Springer Handbook of Robotics by Siciliano and Khatib. The authors explain which of these  methods can be used to find all solutions for a 6-DOF arm. They cover both algebraic and a lot of numerical methods.

Also have a look at ikfast in openrave. It's a search-based method that finds a closed-form solution for the inverse kinematics given the robot's structure. The source code of ikfast contains a number of numerical inverse kinematics methods.


问:
How can a DMP be used for simulating physics?
I read a paper from 2015, "Structural bootstrapping - A novel, generative
mechanism for faster and more efficient acquisition of action-knowledge
", which introduces a concept called, "Structural bootstrapping with semantic event chains and dynamic movement primitives," which confused me a little bit.

According to my knowledge a robotarm is controlled by a PDDL-like planner. The PDDL file is a "qualitative physics engine" which can predict future events. The paper says the "qualitative physics engine" consists of dynamic movement primitive (DMP) which are learned from motion capture data.

My question is: How can a DMP be used for simulating physics?

答:
I don't know that the DMP method actually simulates physics as much as it copies what it saw, which was an actual, physical system. Note that "qualitative" means essentially "looks like", where "quantitative" means "numerically".

Qualitative physics simulations are those that look like real physics, but they are not. If I hold a dart in my hand and walk it across the room as though it were in the air, it would look roughly correct, but of course it would not be numerically accurate. So again, I think they're copying what they see and treating it as "good enough."


答:
Using formula's for rotation of frame:
$$ x' = x \cdot \cos{\alpha} - y \cdot\sin{\alpha} $$
$$ y' = x \cdot \sin{\alpha} + y \cdot\cos{\alpha} $$

Could this be the solution?
$$ X = (r_{earth} \cdot \lambda \cdot cos(\phi_0)) \cdot \cos{\alpha} - (r_{earth} \cdot \phi) \cdot\sin{\alpha} $$
$$ Y = (r_{earth} \cdot \lambda \cdot cos(\phi_0)) \cdot \sin{\alpha} + (r_{earth} \cdot \phi) \cdot\cos{\alpha} $$

with $ X,Y $ the coordinate of my vehicle in local coordinate system, $r_{earth}$ radius of the earth, $\lambda$ longitude in degrees, $\phi$ latitude in degrees, $\phi_0$ initial measured latitude and $\alpha$ initial measured compass angle

Could anyone please confirm these formulas would work?

Title: Conversion GPS (longitude,latitude) to (x,y) of local reference frame?

Body:
I would like to use GPS data as measurement input for an extended kalman filter. Therefore I need to convert from GPS longitude and lattitude to x and y coordinate. I found information about the  equirectangular projection given these formulas:
$$\ X = r_{earth} \cdot \lambda \cdot cos(\phi_0) $$
$$\ Y = r_{earth} \cdot \phi $$

However I think these formulas are only for use when the axis x- and y-axis of my local frame are parallel to north and south axis of the earth.

But my vehicle is starting in my local reference frame in the origin and heading straight in y-direction. In whatever compas angle I put my vehicle, this should always be the starting position.
I can measure the angle $ \alpha $ to north with a compass on my vehicle.

Now what is the relationship between (longitude,lattitude) an (x,y) of my local frame?


答: The DMP method copies a trajectory instead of simulating physics. The guys in the paper store the recorded trajectory into a database as a matrix and reproduce it without modification on the robot. The event-chain matrix is on page 5 at Learning the semantics of object-action relations by observation But, in the paper Execution of a Dual-Object (Pushing) Action with Semantic Event Chains is on page 4 a learning model used which is able to determine future result of an action (chapter "Defining Spatial Anchor Points"). My impression is, that a little bit of planning is in there. The author named it "model-sec" (Model Semantic Event Chain).</p>

Body:
I read a paper from 2015, "Structural bootstrapping - A novel, generative
mechanism for faster and more efficient acquisition of action-knowledge
", which introduces a concept called, "Structural bootstrapping with semantic event chains and dynamic movement primitives," which confused me a little bit.

According to my knowledge a robotarm is controlled by a PDDL-like planner. The PDDL file is a "qualitative physics engine" which can predict future events. The paper says the "qualitative physics engine" consists of dynamic movement primitive (DMP) which are learned from motion capture data.

My question is: How can a DMP be used for simulating physics?


问:
Handling of a 4WD robot frame as a 2 wheel differential drive
I have a 'Baron' robot frame with 4 static wheels, all driven by a motor. At the moment I'm thinking of handling it like a 2 wheel differential drive. Left and right wheels would receive the same signal. Actually you can interpret it as a tank on caterpillars, exept there is no link between the two tires.
Does anyone have a different idea about this?

Ps: The purpose of the robot will be to know it's exact location. I will use a kalman filter (EKF) to do sensor fusion of the odometry and an IMU with accelero, gyro and magnetometer. So in the kalman filter I add the odometry model of a differential drive robot.

答:
I think you should read some of ROS stuff. However, how to generate odometry in this case? I mean in a way that is accurate.

If you switch to skid steering I think it will be better... however, I don't really understand it well. All I know is that it makes different speed values for the 4 motors... so you have 4 motors instead of 2. I don't know how to make it in ROS too.


问:
Replacing just the Wheels on Create2
Is it possible to replace just the wheels on the create2 robot? Is it a standard shaft/coupling?</p>

答:
The wheel is on a 5mm shaft.  It is simply pressed into the gears and housing.  However, it is very difficult to remove.  (I had to completely disassemble the wheel module to get it out.)  Also, I am not sure the wheel can be removed from the shaft.  Either the wheel is molded on the shaft or there is a metal hub on the wheel that has a very strong press fit on the shaft.

But I am not sure why you would want to replace the Roomba wheels.  They are just the right size for the robot.  I don't think the robot will work very well with wheels any larger or smaller.

However, you may be interested in this Wheel Hack Document from the Create2 site.  It describes the electrical interface between the robot and the wheel module.  This will allow you to:

Use your own motors, gear-train and wheels with Roomba.

Use the Roomba wheel modules with your own controller, without the Roomba chassis.

Title: Replacing just the Wheels on Create2


问:
Name of the linkage (or carriage) in video
I am trying to find the name (nomenclature) of the linkage (or carriage) that is being driven by the dual linear servo (actuator) arrangement in the following Youtube videos:

Servo Basic Concepts

YouTube - 4 X Linear Servo Application

The linkage (carriage) appears to be able to rotate about a 180 degree arc.

What is this metal linkage (or carriage) system called?

答: The video shows 2 linear actuators driving a universal joint through ball and socket joints.  </p>


问:
Reward Function for q learning on a robot
I have 2 wheeled differential drive robot which I use pid for low level control to follow line. I implemented q learning which uses samples for 16 iterations then uses them to decide the best position to be on the line so car takes the turn from there. This allows PID to setup and smooth fast following. My question is how can I setup a reward function that improves the performance i.e. lets the q learning to find the best

Edit

What it tries to learn is this, it has 16 inputs which contains the line positions for the last 15 iterations and this iteration. Line position is between -1 and 1 which -1 means only left most sensor sees the line and 0 means the line is in the center. I want it to learn a line position that when it faces this input again it will set that line position like its the center and take the curve according to that line position. For example error is required position - line position so let say I had 16 0 as input then I calculated the required as 0.4. So after that the car will center itself at 0.4 I hope this helps :)

You asked for my source code i post it below

```<code>void MainController::Control(void){

    float linePosition = sensors->ReadSensors();

    if(linePosition == -2.0f){
      lost_line->FindLine(lastPos[1] - lastPos[0]);
    }
    else{
        line_follower->Follow(linePosition);
        lastPos.push_back(linePosition);
        lastPos.erase(lastPos.begin());
    }
}
</code>```

My Sensor reading returns a value between -1.0f and 1.0f. 1.0f means Outer Sensor on the right is only the line. I have 8 sensors.

```<code>void LineFollower::Follow(float LinePosition){

    float requiredPos = Qpredictor.Process(LinePosition,CurrentSpeed);
    float error = requiredPos - LinePosition;

    float ErrorDer = error -LastError;

    float diffSpeed = (KpTerm * error + (KdTerm * ErrorDer));

    float RightMotorSpeed = CurrentSpeed - diffSpeed;
    float LeftMotorSpeed = CurrentSpeed + diffSpeed;

    LastError = error;

    driver->Drive(LeftMotorSpeed,RightMotorSpeed);
}
</code>```

Here is the logic for the value for QPredictor(I call the learning part as this). And Finally QPredictor

```<code>float Memory[MemorySize][DataVectorLength] =
{
  {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
  {0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3},
  {0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6},
  {0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8},

  {0.000, 0.012, 0.050, 0.113, 0.200, 0.312, 0.450, 0.613, 0.800, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000},
  {0.000, 0.000, 0.012, 0.050, 0.113, 0.200, 0.312, 0.450, 0.613, 0.800, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000},
  {0.000, 0.000, 0.000, 0.012, 0.050, 0.113, 0.200, 0.312, 0.450, 0.613, 0.800, 1.000, 1.000, 1.000, 1.000, 1.000},
  {0.000, 0.000, 0.000, 0.000, 0.012, 0.050, 0.113, 0.200, 0.312, 0.450, 0.613, 0.800, 1.000, 1.000, 1.000, 1.000},
  {0.000, 0.000, 0.000, 0.000, 0.000, 0.012, 0.050, 0.113, 0.200, 0.312, 0.450, 0.613, 0.800, 1.000, 1.000, 1.000},
  {0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.012, 0.050, 0.113, 0.200, 0.312, 0.450, 0.613, 0.800, 1.000, 1.000},
  {0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.012, 0.050, 0.113, 0.200, 0.312, 0.450, 0.613, 0.800, 1.000},

  {0.000, 0.025, 0.100, 0.225, 0.400, 0.625, 0.900, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000},

  {0.000, 0.050, 0.200, 0.450, 0.800, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000},

  {0.000, 0.100, 0.400, 0.900, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000},
  {0.000, 0.000, 0.100, 0.400, 0.900, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000},
  {0.000, 0.000, 0.000, 0.100, 0.400, 0.900, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000},
  {0.000, 0.000, 0.000, 0.000, 0.100, 0.400, 0.900, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000},
  {0.000, 0.000, 0.000, 0.000, 0.000, 0.100, 0.400, 0.900, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000},
  {0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.100, 0.400, 0.900, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000},
  {0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.100, 0.400, 0.900, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000},
  {0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.100, 0.400, 0.900, 1.000, 1.000, 1.000, 1.000, 1.000},
  {0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.100, 0.400, 0.900, 1.000, 1.000, 1.000, 1.000},
  {0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.100, 0.400, 0.900, 1.000, 1.000, 1.000},
  {0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.100, 0.400, 0.900, 1.000, 1.000},
  {0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.100, 0.400, 0.900, 1.000}
};

QPredictor::QPredictor(){
    for(int i=0;i<MemorySize;i++){
        output[i]=0.0f;
        input[i]=0.0f;
    }

    state = 0;
    PrevState = 0;
}

float QPredictor::Process(float linePosition,float currentBaseSpeed){
    for(int i=1;i<DataVectorLength;i++){
        input[i] = input[i-1];
    }

    input[0] = m_abs(linePosition);

    int MinIndex = 0;
    float Distance = 10000.0f;

    float sum = 0.0f;

    for(int i=0;i<MemorySize;i++){
        sum = 0.0f;
        for(int j=0;j<DataVectorLength;j++){
            sum +=m_abs(input[j] - Memory[i][j]);
        }

        if(sum <= Distance){
            MinIndex = i;
            Distance = sum;
       }
    }

    sum = 0.0f;
    for(int i=0;i<DataVectorLength;i++){
        sum += input[i];
    }

    float eta = 0.95f;

    output[MinIndex] = eta * output[MinIndex] + (1 - eta) * sum;

    return -m_sgn(linePosition) * output[MinIndex];
}

float QPredictor::rewardFunction(float *inputData,float currentBaseSpeed){
    float sum = 0.0f;

    for(int i=0;i<DataVectorLength;i++){
        sum += inputData[i];
    }

    sum /= DataVectorLength;

    return sum;
}
</code>```

I now only have average Error and currently not using learning because it's not complete without reward function. How can I adjust it according to the dimensions of my Robot?

答: Adaptive PID control is based on a manual coded algorithm for line-following which is modified by reinforcement learning. The idea is, that in the PID function a parameter is unknown (e.g. the distance from line which can be tolerated as deviation) and this parameter will be calculated on-the-fly while driving the robot. The rewards are given manual by an operator Clicker training or can be determined in a loop. The robot is driving a parcurs, the time is measured. The robot drives the parcurs again and the goal is to decrease the time.</p>


问:
Inverse Kinematics Computation -- why are alpha angle values not included?
Given a desired transform matrix of the end effector relevant to the base frame of the P560:

John J. Craig, in his book, Introduction to Robotics
Mechanics and Control, computes the inverse kinematic solutions of a Puma 560, with (correct me if wrong) Modified DH parameters and gets the following set of equations for theta angles:

and I noticed that there are no alpha angles in these calculations.

So, my question is why aren't the alpha angle values not used in the calculation for the desired pose with the given end effector transform? Why is it independent of the axes twist angles of the robot?

答:
Check out Equation 3.6:

$$
^{i-1}_iT = \left[
\begin{array}{c}
c\theta_i & -s\theta_i & 0 & r_{i-1} \\
s\theta_ic\alpha_{i-1} & c\theta_ic\alpha_{i-1} & -s\alpha_{i-1} & -s\alpha_{i-1}d_i \\
s\theta_is\alpha_{i-1} & c\theta_is\alpha_{i-1} & c\alpha_{i-1} & c\alpha_{i-1}d_i \\
0 & 0 & 0 & 1
\end{array}
\right]
$$

and Figure 3.21, "Link parameters of the PUMA 560":

$$
\begin{array}{c}
i & \alpha_{i-1} & r_{i-1} & d_i & \theta_i \\
\\
1 & 0           & 0   & 0   & \theta_1 \\
2 & -90^{\circ} & 0   & 0   & \theta_2 \\
3 & 0           & a_2 & d_3 & \theta_3 \\
4 & -90^{\circ} & a_3 & d_4 & \theta_4 \\
5 & 90^{\circ}  & 0   & 0   & \theta_5 \\
6 & -90^{\circ} & 0   & 0   & \theta_6 \\
\end{array}
$$

Here I've used $r$ instead of $a$ to prevent any confusion between $\alpha$ and $a$. In Equation 3.6, $s$ means $\sin$ and $c$ means $\cos$.

To your question, $\alpha$ is more related to the orientation of two joints relative to each other as opposed to the motion of the joints relative to each other. That is,  $\alpha$ is generally fixed by physical construction and thus, as a parameter, isn't time-dependent.

So hopefully you can see that, from Figure 3.21, all of the $\alpha$ values are either +/- 90 degrees or zero. Equation 3.6 then uses it only in sine and cosine terms, meaning that they can all be reduced to +/-1 or zero.

I really, really hate when authors jump through simplifications like this without a heads up, so I totally understand the confusion.


问:
What is difference between RoboEarth and KnowRob?
I am not able to clearly differentiate between the two platforms:

RoboEarth, and;

KnowRob.

答: RoboEarth was the name of a European project. Knowrob is software that was developed, in part, by the RoboEarth project.</p>


问:
Heading and Yaw Rate Measurements
I am working in the field of automated vehicles mainly in the domain of passenger and commercial vehicles. I have been studying whatever I can get regarding the measurement the state (relative position, relative velocity, relative heading and roation, a.k.a. yaw rate) of surrounding objects especially other vehicles using sensors.

While everything else is possible to measure precisely using on-board sensors, I have found out that not much literature is available for measuring the vehicle heading and yaw rate of other vehicles which is baffling to me given the extreme precision of laser based sensing (albeit using time stamps).

I am looking for:

Reference to literature with experiments for estimation of yaw rate and vehicle heading.

As I can see from the literature available (or the lack thereof), no direct way of measuring yaw rate is available but by using LIDAR or Camera with consecutive time stamps or scans of data. However, this inherently requires the data to be correct. Hence, I would think that due to the inaccuracies involved, this method is not used! Is this correct?

Are there any commercially available sensors that give accurate heading and yaw rate information of other vehicles?

Sources and research papers would be most welcome!

Edit: By this inherently requires the data to be correct I mean, given the high sensitivity to error in heading or yaw rate at high vehicle speeds, the values computed using sensor information is not accurate enough to be put to use in practice!

答:
You're looking for a heading sensor - do you mean a compass? Or is there something else you're looking for? A compass gives you an absolute measurement, and a gyroscope provides yaw rate information.

:EDIT:

OP clarified that the yaw angle and yaw rate of interest is that of other vehicles, specifically the vehicle in front of the controlled vehicle.

I'm not sure I understand why you even care about their heading, unless you're trying to fake autonomy by just copying what the car in front is doing. That's a dangerous assumption, though, as the car in front may change lanes when it is safe for them and not for you, may make turns and exit roads you don't want to, etc.

You also state (about yaw estimation from LIDAR and cameras) that "this requires the data to be correct," which is the problem with all sensors. This is why we use filters. Noise, measurement error, biases - these all degrade feedback and create erroneous feedback signals, which are then treated as "truth" and acted on by the system.

All sensors have flaws; it's up to you to know your sensor and compensate for those flaws accordingly. A gyroscope not only has noise and bias offsets, but also a random walk that means the bias offset actually shifts over time, so even if you start out with a perfect measurement of the offset, that value changes and thus you still don't get a perfect feedback.

These problems exist even in weapons-grade (tactical) IMU sensors. The problem will likely be worse for LIDAR and camera-based systems, but again, it's always something you need to look out for and correct yourself.

As with a lot of questions that get asked here, it seems that you've already talked yourself into a solution (calculate the yaw angle and rate of the car in front of you) and have come here trying to determine how to implement that solution.

My advice would be to give more context to the problem you're trying to solve, introduce your solution concept, then state the trouble you're having. In that way you can simultaneously get feedback on your method and also get suggestions for other ways to solve the problem.

Title: Heading and Yaw Rate Measurements


问:
Odometry motion model for Kalman filter, but is the error zero mean?
I was planning on using the odometry model in the prediction stage of an Extended Kalman Filter.
State transition equations:
$$ f(X_t,a_t) = \begin{bmatrix}
x_{t+1} = x_t + \frac{\delta s_r + \delta s_l}{2} \cdot \cos(\theta_t) +u_1
\\ y_{t+1} = y_t + \frac{\delta s_r + \delta s_l}{2} \cdot \sin(\theta_t) + u_2
\\ \theta_{t+1} = \theta_t + \frac{\delta s_r + \delta s_l}{b} \cdot \sin(\theta_t)+u_3
\end{bmatrix} $$
with $\delta s_r$ and $\delta s_l = \frac{n}{n_0} \cdot 2 \cdot \pi \cdot r$

$X_t = \begin{bmatrix} x_t & y_t & \theta_t\end{bmatrix}^T$ state matrix containing XY-coordinate and heading $\theta$ of vehicle in global reference frame

$\delta s_r$ and $\delta s_l$ distance travelled by respectively right and left wheel

$b$ distance from center of the vehicle to the wheel

$n$ encoder pulses count during sampling period t

$n_0$ total pulses count in 1 wheelturn

$r$ wheel radius

$u_1,u_2$ and $u_3$ random noise N(0,$\sigma^2$)

Now I doubt if this noise indeed does have a zero mean?
Wheelslip will always make the estimated distance travelled shorter than the measured distance isn't it?

答:
The noise term will always be zero mean. If you believe the odometry equations will not accurately capture wheel slip and you believe the filter will not adequately track your state then the solution is more accurate equations used in the prediction step.

However, if you believe the process noise if not a constant, you can construct a process noise as a function of the state of the vehicle. It will still be a zero mean noise, that will always be true.

I'd suggest solving for this non-zero mean component of the noise and just adding that to your odometry equations.


答:
Some testing gave me the following solution:

converting from (longitude,latitude) to (X,Y)
$$X = r \cdot cos(lat.) \cdot cos(long.)$$
$$Y = r \cdot cos(lat.) \cdot sin(long.)$$

rotating the frame so that the Y-axis is always in front of you
$$X' = [r \cdot cos(lat.) \cdot cos(long.)-X_0]\cdot cos(\alpha-90°)- [r \cdot cos(lat.) \cdot sin(long.)-Y_0] \cdot sin(\alpha-90°) $$
$$Y' = [r \cdot cos(lat.) \cdot cos(long.)-X_0]\cdot sin(\alpha-90°)+ [r \cdot cos(lat.) \cdot sin(long.)-Y_0] \cdot cos(\alpha-90°) $$

$r$ : earth radius 6371000 m

$\alpha$ :  heading at start (so vehicle pointing east $\alpha = 90°$, pointing north $\alpha = 0°$)

$X_0$ and $Y_0$ : first formula's filled in with start longitude and latitude


问:
Source to learn Kalman Fusion, explanatory code snippets
Currently I am reading a book of Mr. Thrun: Probabilistic Robotics. I find it really helpfull to understand concept of filters, however I would like to see some code in eg. Matlab. Is the book "Kalman Filter for Beginners: with MATLAB Examples" worth buying, or would you suggest some other source to learn the code snippets from?</p>

答:
The Kalman Filter is based on some assumptions - a linear process with independent normally distributed noise. Noise over time is independent. Each measurement is also independent.

The Wikipedia article (http://en.wikipedia.org/wiki/Kalman_filter) is quite complete in information on this. This article should be enough to allow you to implement the Kalman Filter. Other sources also exist on the internet. Most people here will not be able to give an opinion on the book you mentioned - since we have not read it, and I will never read it because I do not need to.

The Wikipedia article contains, in particular, detailed equations showing each step that a Kalman filter takes. In particular the equations given implement a filter allowing the covariance (noise in measurements) to differ on different timesteps, and keeps an updated estimate of the covariance (accuracy) of the estimated states.

There is also an example which helps walk through the equations.

An alternative way of implementing the Kalman filter is simply as a fixed state-space linear time-invariant filter. The relevant equation is $x(k)=x(k-1)+Ky(k)$. This is a simplification of the full set of equations, because $K$ - the Kalman gain, is fixed if the covariances are fixed. The gain can also be obtained from the solution to the Discrete-time Algebraic Ricatti equation.


问:
Ultrasonic Sensor through a column
I am trying to measure the height of water inside a column. The column is 50mm in dia and 304mm long. I have mounted the sensor just above the column.

To measure the accuracy of the sensor, I filled the column up to a known value (a) and got the average sensor reading (b). a+b should give me the height of the sensor from the base of the column.

Repeating this for different values of a, I got very different values for (a+b). see attached chart.

My question is

Is the sensor expected to have error of this order?

Is my setup of confining the sensor through a column producing such errors.

Any other ideas to get the water column height. Please note that during the actual test, the water inside will be oscillating (up and down).I am thinking of making a capacitive sensor using aluminium foil. Water will work as the dielectric and the level of water will determine the capacitance.

P.S. I also did some open tests (not through a column) to get the distance of a fixed object, and it was quite accurate.

Any help is appreciated.

Arduino Code

```<code>#include <NewPing.h>

#define TRIGGER_PIN  7  // Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PIN     8  // Arduino pin tied to echo pin on the ultrasonic sensor.
#define MAX_DISTANCE 200 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.

double DB_ROUNDTRIP_CM = 57.0;

NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.

void setup() {
  Serial.begin(9600); // Open serial monitor at 115200 baud to see ping results.
}

void loop() {
  delay(100);
  unsigned int uS = sonar.ping();
  double d = uS / DB_ROUNDTRIP_CM;

  Serial.println(d);
}
</code>```

答: I think the code is just fine. You must however test the code by placing ultrasonic sensor at fixed distance from the wall and testing the distance. Also, it seems you are using SR04 ultrasonic sensor which has a beam angle of 15 degrees and accuracy of 3mm. This might result beam being reflected from water column container. As mentioned in the datasheet SR04 DataSheet, minimum area of measurement must be 0.5 square meters to get correct readings.

Title: Ultrasonic Sensor through a column


问:
I-Robot Create 2 reset after sleep issue?
I am having issues with bringing the robot out of its sleep or off mode. Seems it goes into sleep mode when there is no activity for about 4 minutes. I am using the i-Robot Create 2 serial cable. When it is in its sleep mode I try removing the cable end plugged into robot and connect jumper wire between pins 5 and 6 on the robot 7 pin connector for a brief time period. This effectively shorts the BRC pin to GND for a short period of time ( less than 1 second). Then I reconnect the serial port cable into the robot 7 pin connector and try giving the robot a command but no go. I have also read that commands 173 and 173 173 can help with this issue but I may be mistaken. Any help on this is very much appreciated !!!! Rick</p>

答:
The Create 2 cable will wake the robot when plugged in without any modifications.
173 is the 'stop' command that stops the OI. It does not do anything if the robot is sleeping.
Also, in the OI Manual it states the robot goes into sleep every 5 minutes unless in full or safe mode.</p>


问:
Measure 2 diffrent battery voltages on arduino
Is it possible to measure the voltage of 2 different batteries on arduino? Currently I am able to use a resistor divider / voltage divider of 2x 10K resistors to an analog pin to read the voltage of the battery supplying the arduino.

Currently the system looks like 6v battery -> 5v power regulator to Arduino -> resistor divider attached to 6v (unregulated) battery. GND is common throughout.

How could I measure the voltage of another battery given that it will be on a different circuit? e.g. different ground loop.

答:
You cannot measure a voltage if you don't have any reference to measure it.

So you have to connect the two wire of your second battery to your arduino circuit :
just connect the ground of the second battery to the common ground and apply the same technique for the voltage measurement.

Here is an image to show how you can do :

B1 is your main battery

R2 and R1 make the voltage division for measurement on ANA_1 (any analog pin of the arduino is OK)

B2 is your second battery

R4 and R3 make the voltage division for measurement on ANA_2 (any analog pin of the arduino is OK)


答:
The bias of your distribution will depend on parameters outside of your model. Acceleration, incline, terrain properties, tire temperature, etc.

Your noise term is zero bias, because it is a blanket assumption for all these cases. Consider for example your robot going downhill. The bias would be positive in this case.

To tweak your model, you could for example include the slip as a constant factor on the distance traveled for each wheel. Note that this factor will be very depending on your situation.

Another component to consider is your $\sigma^2$. Having it constant, and thus independent of your $\delta s$ generates the same increase in uncertainty when you are not moving compared to a very fast movement.

Title: Odometry motion model for Kalman filter, but is the error zero mean?

Body:
I was planning on using the odometry model in the prediction stage of an Extended Kalman Filter.
State transition equations:
$$ f(X_t,a_t) = \begin{bmatrix}
x_{t+1} = x_t + \frac{\delta s_r + \delta s_l}{2} \cdot \cos(\theta_t) +u_1
\\ y_{t+1} = y_t + \frac{\delta s_r + \delta s_l}{2} \cdot \sin(\theta_t) + u_2
\\ \theta_{t+1} = \theta_t + \frac{\delta s_r + \delta s_l}{b} \cdot \sin(\theta_t)+u_3
\end{bmatrix} $$
with $\delta s_r$ and $\delta s_l = \frac{n}{n_0} \cdot 2 \cdot \pi \cdot r$

$X_t = \begin{bmatrix} x_t & y_t & \theta_t\end{bmatrix}^T$ state matrix containing XY-coordinate and heading $\theta$ of vehicle in global reference frame

$\delta s_r$ and $\delta s_l$ distance travelled by respectively right and left wheel

$b$ distance from center of the vehicle to the wheel

$n$ encoder pulses count during sampling period t

$n_0$ total pulses count in 1 wheelturn

$r$ wheel radius

$u_1,u_2$ and $u_3$ random noise N(0,$\sigma^2$)

Now I doubt if this noise indeed does have a zero mean?
Wheelslip will always make the estimated distance travelled shorter than the measured distance isn't it?


问:
why is quadrotor motion planning hard?
With introduction of incremental sampling algorithms, like PRM and RRT planning in higher dimensional spaces in reasonable computation time has become possible though it is PSPACE-hard. But why is a quadrotor motion planning problem still difficult even with simplified quadrotor model?

I was solving a dynamic car problem with OMPL, which produced solution within 10s but I set a planning time of 100s for quadrotor, but it still does not find a solution.

答:
The main problem with motion planning is the time-dimension. Not only that the UAV can move up, down, forward or backward, but the motion is also defined along the time-axis. A motion plan like "up, up, down" is fundamental different then "up, down, up". After few steps, the number of possibilities grows exponential.

Even on simple examples like quadrotor path planning, Sokoban or grasping objects there are more then one million solutions which build a complex RRT graph. For the planner it's unclear which of the RRT nodes are better then the others, so the planner has to evaluate all. On the one hand graph-search with PRM or A* is the most efficent way to find a solution (thats the reason why they are implemented in OMPL), on the other hand, graph-search can not prevent that one million or more nodes has to calculated.

How to speed up the process? The naive answer is to use faster hardware (multi-core-processing, cloud computing) but thats not the way it works (Moores law is over, and doubling of current performance is very hard for Intel or AMD). A better alternative is to use a concept which is called hybrid planning (combination of RRT with PDDL solver): A symbolic planner reduces the search-space, and RRT is used only for local planning. Or more in general: PDDL Solver determines the subgoals and RRT calculates the paths to the subgoals.

Title: why is quadrotor motion planning hard?


问:
Combine individually working cartesian coordinates

I am trying to control a Dobot arm.  The arm moves with angles whereas I need to work with cartesian coordinates. From inverse kinematics equations and polar coordinates I have implemented x,y and z coordinates working very well on their own. But I can not combine the coordinates in order to work all together. When I add them up it is not going to the desired place. How can I combine these coordinates? I got some help from (https://github.com/maxosprojects/open-dobot) but could not manage to successfully move dobot.

Edit: I've written the codes in Qt and also I've added the triangles used for angle calculations.

//foreArmLength=160mm rearArmLEngth=135mm

```<code>float DobotInverseKinematics::gotoX(float x) //func for x-axis
float h=qSqrt(qPow(lengthRearArm,2)-qPow(x,2)); //height from ground
QList<float> zEffect=gotoZ(h); //trying to find the effect of x movement on z-axis
float cosQ=h/lengthRearArm; //desired joint angle
float joint2=qRadiansToDegrees(qAcos(cosQ));
//move in range control
if(joint2 != joint2)
{joint2=0;
    qDebug()<< "joint2NAN";}
return joint2;

QList<float> DobotInverseKinematics::gotoY(float y) //func for y-axis
QList<float> result ;
float actualDist=lengthForeArm+distToTool; //distance to the end effector
float x=(qSqrt(qPow(actualDist,2)+qPow(y,2)))-actualDist; //calculating x movement caused by y movement
float joint1=qRadiansToDegrees(qAcos(actualDist/(actualDist+x))); //desired joint angle
float joint2=gotoX(x);  //the angle calculation of y movement on x axis
if(joint1 != joint1)
{joint1=0;
    qDebug()<< "joint1NAN";}
result.append(joint1);
result.append(joint2);
return result;

QList<float> DobotInverseKinematics::gotoZ(float z) //func. for z-axis
QList<float> result ;
float joint3=qSqrt(qPow(160,2.0)-qPow(z,2.0))/ 160; //desired joint angle
float temp=160-qSqrt(qPow(160,2.0)-qPow(z,2.0));
float joint2=qSqrt(qPow(lengthRearArm,2)-qPow(temp,2.0))/lengthRearArm; //desired joint angle
if(joint3 != joint3)
{joint3=0;
    qDebug()<< "joint3NAN";}
joint2=qAcos(joint2)*(180/M_PI);
joint3=qAcos(joint3)*(180/M_PI);
result.append(joint2);
result.append(joint3);
return result;
</code>```

答:
$a_1, a_2$ : Link lengths

$p_x,p_y$ : Target $x$ and $y$ coorditate

$\theta_1=atan2(p_y,p_x)$

$p_r=\sqrt{p_x^2+p_y^2}$ : Target radial distance

$p_z$ : Target $z$ coorditate

$\kappa=\frac{p_r^2+p_z^2-a_1^2-a_2^2}{2a_1a_2}$

If $\kappa>1$ the position cannot be reached.

$\theta_3=cos^{-1}(\kappa)$

There are 2 solutions, elbow up or elbow down. Below use $\theta_3^*=\theta_3$ or $\theta_3^*=-\theta_3$

$\Delta=a_1^2+a_2^2+2a_1a_2cos(\theta_3^*)$

$c\theta_2=\frac{p_r(a_1+a_2cos(\theta_3^*))+p_za_2sin(\theta_3)}{\Delta}$

$s\theta_2=\frac{p_z(a_1+a_2cos(\theta_3^*))-p_ra_2sin(\theta_3)}{\Delta}$

$\theta_2=atan2(s\theta_2,c\theta_2)$

These are joint angles. To get motor angles, you will have to adjust the angles based on how the motors are connected to the robot. $\theta$ is 0 when horizontal, $\theta_3$ is 0 when straight (in-line) with Link 2.

A detailed explanation can be found in Robot Analysis by Tsai. ISBN 9780471325932 pp 71


问:
Why don't cheap toy robotic arms move smoothly?
Why don't cheap toy robotic arms like this move smoothly?  Why can't it even move itself smoothly, (even without any load)?

In other words - what do real industrial robotic arms have, that cheap toys don't?

答:
Poor programming algorithms, cheap motors, poor mechanics, low weight, lack of part rigidity, bad balance, farming out production to the lowest bidder, take your pick.

Or simply because they are cheap toys.


问:
Is it possible to use a LiPo charger as a lab bench power supply?
I recently thought about building a lab bench power supply, it comes in cheaper and I love to build things...

But then I also have a LiPo charger an iMax B6AC, that I had bought for my quadcopter, then came the idea of whether I can use the charger as a lab bench power supply...

My questions is, could this work and how could I make it work?

答:
The LiPo charger probably doesnt put out enough current to be very useful, and it likely doesn't have the circuit design to provide power at a stable voltage and current.

You would be better off converting a switching power supply for a desktop PC.

Here's a good example

http://www.instructables.com/id/Convert-A-Computer-Power-supply-to-a-Bench-Top-Lab/&ved=0ahUKEwj2pZ6VoMzOAhUFySYKHXXmBXsQFggbMAA&usg=AFQjCNEC2GWbuuvQinSSW4sJptmYU3irHg&sig2=sin4n44XrDZmciFVh_QTKg


答:
The reason the robotic arm that you linked to does not move smoothly is that the commands given to it are not smooth. That type of actuator does not have any internal logic to generate a smooth motion from one point to another. Instead it tries it's hardest to go to the angle commanded using position control. Hobby servos use PID control and this control method will oscillate around the target point if not configured correctly.

A secondary reason is probably that a combination of friction in the joints and too-big payload are near the maximum that those little motors can handle.

A person with more robotics experience could probably make that arm move a lot more smoothly as long as they operated it within the limits of what the design allows for.

Low cost, high performance, electro-mechanical devices are possible. A portable tape player is a great example if you are old enough to have disassembled one. The mechanisms inside a printer are also a good example. The internal mechanisms of an automobile are another example.

There is not a big enough market for toy robot arms to justify the engineering cost. The closest thing in robotics right now for low cost / high performance design is the Nao or the Baxter.

Title: Why don't cheap toy robotic arms move smoothly?

Body:
Why don't cheap toy robotic arms like this move smoothly?  Why can't it even move itself smoothly, (even without any load)?

In other words - what do real industrial robotic arms have, that cheap toys don't?


答:
You could trick the charger into providing power for you by applying a voltage to the balance sensing lines. However the control you have over it would be limited.

Switching power supplies are ridiculously cheap these days. Search ebay for "switching power supply dc 24v" for whatever voltage you want. I just keep a pile of these in the closet for the voltages I use the most (5, 12, 24 and 48). That plus one low power bench supply with current limiting to debug new boards with.

Title: Is it possible to use a LiPo charger as a lab bench power supply?

Body:
I recently thought about building a lab bench power supply, it comes in cheaper and I love to build things...

But then I also have a LiPo charger an iMax B6AC, that I had bought for my quadcopter, then came the idea of whether I can use the charger as a lab bench power supply...

My questions is, could this work and how could I make it work?


答: Cheap toy arms usually use cheap off the shelf servos, the kind you would find on model airplanes. Usually these servos don't have any control over speed. You give the servo the target angle and the servo tries to get to that position as fast as possible. They also don't compensate for things like load. With more expensive servos you give them both the target position and speed. There are also servos where you can play around with values (such as PID) and get information on things like load. This allows to to get smooth movement</p>


答:
Smooth control of a robotic arm is accomplished by force control instead of strictly by position control. This kind of control is generally referred to as compliance.

On that page there is a comparison between compliant and non-compliant actuators, where the non-compliant actuators are referred to as "stiff". This is, in my opinion, a great way to explain the "jerky" motion you see in the video. A stiff actuator passes any forces or torques back to the structure and does nothing to attempt to damp those forces.

Here is a video that shows the difference between force- and position-based control.

The reason for a lack of compliance in cheap robots is easily summed up in one word: Cost.

In order to implement force-based control, you need a means to sense force. This means force transducers such as strain gauges installed along the arm to measure forces in the arm or torque sensors at the joints. Both of these are more expensive to design, purchase, install, and program that it would be for a similar robot without compliance.

There is a relatively new method that enables force control and force sensing (among other things) that is called series elastic actuation.

Briefly, the concept is that you put a spring between the actuator and the load. The actuator then acts to compress the spring rather than drive the load directly. The force output of the spring is given by $kx$, where $x$ is the displacement of the spring. So two neat things are happening - if you can measure the displacement, then the load position is the actuator position plus spring displacement, and the force output is $kx$.

But again, to answer your question, cheap robots don't do any form of force control or compliance, so the rapid start/stop motion profiles @hauptmech mentions excites the physical structure. With nothing to damp the motion, those oscillations continue, giving a "jerky" appearance.


问:
What are good methods for tuning the process noise on Kalman filters?
Most often tuning the Kalman filter noise matrices is done by trial and error or domain knowledge. Are there more principled ways for tuning all the Kalman filter parameters?</p>

答:
You can get experimental data, and perform some statistical analysis to determine the process noise (noise between time steps), and sensor noise (compared to a ground truth).

To get the ground truth for sensor noise, you either need a more accurate sensor, or else experimentally test while keeping the state of interest at a known (usually fixed) value.

If you do not have experimental data, you can use the datasheets or specifications for each sensor to determine its noise. The process noise would be more difficult in this instance, but you may be able to guess at its value by assuming a certain amount of noise due to, for example, an actuator, if the actuator is the primary source of process noise.

Another way is to consider the maximum settling time allowed for estimation. This will determine the ratio between the process noise and sensor noise. This allows you to have the maximum filtering effect while meeting your settling time requirements.

Note that this does not provide a good way to tune the ratio between different sensors, or between different states, so is not perfect.

Basically, if you have experimental data, you can obtain optimal performance. Otherwise, you can only calculate process noise based by assuming the likely noise of the dominant contributor to process noise, or by determining what minimum performance is required (which is not optimal, but at least gets what is needed).


答:
Knowrob is the brainchild of the german computer scientist Michael Beetz who published the first paper in 2009, KNOW ROB - Knowledge Processing for Autonomous Personal Robots
It uses a OWL-semantic-web (PDDL like) description for task modelling and a prolog interpreter to reach symbolic goals. Roboearth is a project from the netherlands (TU Delft) from same year 2009 to build a robotic cloud for sharing ressources RoboEarth - connecting Robots worldwide</p>

Title: What is difference between RoboEarth and KnowRob?

Body:
I am not able to clearly differentiate between the two platforms:

RoboEarth, and;

KnowRob.


问:
Can I reuse the hall sensors in a brushless motor as an encoder?
I have upgraded the motors in my robotic arm to sensored, brushless RC car motors. The hope was to reuse the Hall sensors to double as a rotary encoder, by tapping 2 Hall sensors and treating the 2 bits as a quadrature signal (a crude quadrature since 2 of the 4 states will be longer than the other 2).

This works when none of the motor phases are powered and I just rotate the motor manually. But once the stator coils are energized, the encoder no longer counts correctly: When running at low power, the counting is correct, but when running under high power, the count is monotonic (only increases or decreases) no matter if I run in reverse or forward.

I'm almost certain this is because of the stator coils overpowering the permanent magnets on the rotors. So is there still a way to use the Hall sensors as an encoder?

Sorry if this is an obvious question. I'd love to research this problem more if I had more time.

Update:
I've measured the wave forms with my DSO quad and see the expected 120 degree separated signals (the measurement for phase C gets more inaccurate over time because I only had 2 probes, so I measured phases A & B first, then A & C, and then merged them.

When ESC speed is 0.1:

When ESC speed is 0.3:

Previously, I was using a hardware quadrature counter (EQEP module on a BeagleBone). At speed=0.3, this was counting backwards no matter if I do forward or reverse!

I then implemented quadrature counting on an LPC1114FN28 uController. The result was still bad at high speeds (count didn't change at all). The logic was:

```<code>void HandleGPIOInterrupt()
{
  const uint8_t allowableTransitions[4][2] = {1, 2, 3, 0, 0, 3, 2, 1};
  static int prevState = -1;
  int state = phaseA | (phaseB * 2)
  if (prevState != -1)
  {
    if (allowableTransitions[prevState][0] == state)
    {
       ++rotations;
    }
    else if (allowableTransitions[prevState][1] == state)
    {
      --rotations;
    }
  }
  prevState = state;
}
</code>```

Then I got the idea to change the code to not update prevState until an expected state happens (to deal with glitches):

```<code>  int state = phaseA | (phaseB * 2)
  if (prevState != -1)
  {
    if (allowableTransitions[prevState][0] == state)
    {
       ++rotations;
       prevState = state;
    }
    else if (allowableTransitions[prevState][1] == state)
    {
      --rotations;
      prevState = state;
    }
    else
    {
        // assume transition was a glitch
    }
  }
  else
    prevState = state;
</code>```

Now the counting finally is correct in both directions, even at speeds higher than 0.3!
But are there really glitches causing this? I don't see any in the waveforms?

答: Yes, I am a technician who works on stabilized camera gimbals for drones and we use hall effect sensors as encoders on our camera gimbals. You must mount the hall effect sensor IC facing toward the motor pole in the rear side of the motor as close as possible without touching. This will detect the magnetic flux as the motor shaft rotates. This works very well for DC brushless motors, I cannot guarantee that it will work as well for any other type of motor.</p>


问:
Running a cycle on brushless outrunner motors?
Is it possible to convert a cycle into an electric bike by using brushless outrunner motors that usually are for RC planes, multicopter, helicopter, etc?

If it is possible, what specs do my motors need to be to provide enough power to bring my cycle to speed?

Will I need a gear system?

答: Its going to be very difficult to make a cycle run with motors that small. You would be better off looking at an electric wheelchair motor. You need starting torque to bring the bike up from a standstill, and a motor that is typically light enough to run an rc plane isn't going to have the "balls" to push a bike, especially with a rider on it. They make motors already spec'd for this task, why reinvent the wheel(pun intended).</p>


问:
Do DH parameters change for a scaled robot 3d model?
I have the actual DH parameters of a robot:

```<code>d1 = 0.4865 m
d2 = 0.600 m
d3 = 0.065 m
a1 = 0.150 m
a2 = 0.475 m
</code>```

all other di's and ai's are zero.

Can I use these for an inverse kinematics analytic closed form computation or should I measure the virtual distances in the 3d environment?

I am actually asking if the theta angles that will be yeld after the computations are dependent on the scale of those distances.

EDIT: Scale factor is unknown

答: You will need to provide target coordinates (x,y,z, etc) to your inverse kinematics equations. As long as they have the same scale as your DH parameters, the joint angles calculated will be the same. But since you don't know the scale factor, you don't know how to scale your inputs.  </p>