问:
Robotc color sensor error
I am trying to write a simple program where the robot(Lego NXT2) will follow a blue line.

```<code>#pragma config(Sensor, S1,     ,               sensorCOLORBLUE)
//!!Code automatically generated by 'ROBOTC' configuration wizard               !!//

task main()
{
    while(true)
    {
        if(SensorValue[S1] == sensorCOLORBLUE)
        {
            motor[motorB] = 0;
            motor[motorC] = -50;
        }
        else
        {
            motor[motorB] = -50;
            motor[motorC] = 0;
        }
    }
    wait1Msec(1);
}
</code>```

I am using an nxt color sensor and the problem is that only 1 motor is moving. I know that none of the motors are broken either because I tested them out.
Can somebody help me diagnose my problem?

答:
According to this page the sensor basically gives you three integers corresponding to the intensity of red/green/blue light. The larger the number, the brighter the incoming light.

The error I suspect is that SensorValue[S1] actually is a value from 0 to 255 and the chance that you get exactly the number sensorCOLORBLUE is very small.

However, such an output means, that you can adjust the thresholds you want to be recognized as blue very nicely in software: for example by saying if the blue value is the highest of those 3, you have a blue line and act accordingly. Example (pseudo) code would be something like this:

```<code>if ( (sensor_output_blue > sensor_output_red) && (sensor_output_blue > sensor_output_green) {
    //react to blue
    //for example by turning left
} else {
    //react to red or green
    //for example by turning right (ie. in opposite direction)
}
</code>```

If using all three colors at the same time is inconvenient, you can do something similar using only the brighness of blue:

```<code>if (sensor_output_blue > threshold_blue) {
    //react to blue
} else {
    //react to the other colors
}
</code>```

Title: Robotc color sensor error

Body:
According to this page the sensor basically gives you three integers corresponding to the intensity of red/green/blue light. The larger the number, the brighter the incoming light.

The error I suspect is that SensorValue[S1] actually is a value from 0 to 255 and the chance that you get exactly the number sensorCOLORBLUE is very small.

However, such an output means, that you can adjust the thresholds you want to be recognized as blue very nicely in software: for example by saying if the blue value is the highest of those 3, you have a blue line and act accordingly. Example (pseudo) code would be something like this:

if ( (sensor_output_blue > sensor_output_red) && (sensor_output_blue > sensor_output_green) {
    //react to blue
    //for example by turning left
} else {
    //react to red or green
    //for example by turning right (ie. in opposite direction)
}

If using all three colors at the same time is inconvenient, you can do something similar using only the brighness of blue:

if (sensor_output_blue > threshold_blue) {
    //react to blue
} else {
    //react to the other colors
}


问:
Is there a place for posting "look at what I did" videos?
Robots are somewhat videogenic, and the old saying "show me, don't tell me" is especially applicable.

But of course, a video is not a question, so it doesn't fit the Stack Exchange format.  Maybe video links would be more suitable in a CodeProject post.  It just seems like this board hits the right cross-section of people, whose projects I would be interested in seeing.

答: The AAAI video competition is a good yearly place to put them.  Otherwise, submitting them to IEEE Spectrum is a good idea as well.  Though its not the best robot news ever, it is the most consistent and most people in the industry check it at least weekly.</p>

ContentLicense: CC BY-SA 3.0


问:
What is the most appropriate SLAM algorithm for quadrotors with RGB-D camera?
I have been researching on SLAM. I came across EKF SLAM which uses odometry to measure the robot's initial position in the map and as well as landmarks which helps the robot's position to be more accurate. Based on the SLAM for dummies, it has a problem of loop closure. In another journal, it was compared to fastSLAM and EKF has a big-O function of $O(K^2)$ where $K$ is the number of landmarks while fastSLAM has $O(M\log(K))$.

It was also said that the most promising SLAM algorithm from the journal "The vSLAM Algorithm for Navigation in Natural Environments"
 is FastSLAM
However, the vSLAM used by an experiment done by the University of Pennsylvania is the occupancy grid SLAM.

I want to ask what would be the most approriate SLAM algorithm for vSLAM given an unmanned aerial vehicle like the quadrotor and RGB-D camera + IMU? Also are there any algorithm that can be extended to support co-operation?

答:
I assume that your target environment is indoors as you use RGB-D camera.
When you want to use it with quadrotor, you need high update rate for accurate pose estimation. Some packages that you can look at are

http://vision.in.tum.de/data/software/dvo

http://wiki.ros.org/demo_rgbd

https://github.com/ccny-ros-pkg/ccny_rgbd_tools

Next, if you want to use only RGB camera + IMU, you must look at this

http://wiki.ros.org/ethzasl_ptam

M. Li and A. I. Mourikis, “High-precision, consistent EKF-based visual–inertial odometry,” Int. J. Rob. Res., vol. 32, pp. 690–711, 2013.

There might be many others but these might be some starting points...


问:
Why does the Pixhawk have 2 IMUs
I was looking at the Pixhawk specs and noticed that it has 2 different IMUs- Invensense and STM. Is it for redundancy or does it have any other higher purpose?</p>

答:
Generally engineers implement dual, triple or more sensors with the same function for one or more of the following reasons:

Reliability: the system should be reliable. Several values can be fetched from several sensor. A voter decides the output(final) value. Boing 777 has 6 sensors for each function.

Safety and critical systems: if one sensor fails, there should be another one which can replace it.

Power consumption: some sensor consume more power because of their higher precision. Using two sensor with different precisions can make a big difference on power consumption. The sensor with high precision is turned on whenever high precision sampling is needed.

Frequency analysis: if you sample from a sensor at 1200Hz and another external frequency with same value is applied then you will get a dc-offset because of the two frequencies interfering with each other.

In case of Pixhawk, I think the main reason is frequency analysis. There are strong vibrations during flight.

Title: Why does the Pixhawk have 2 IMUs


问:
What motors should I use that do not require gearboxes? This is a car like robot
I am new to robotics, and ime looking for a <12v motor that can be used to power a car-like robot.I will have two of these, so I can turn on-spot. Furthermore I want them not to require a gearbox, so I can just attach them to the wheels. I don't really know where to start looking for one.

I have heard servos have built in gearboxes, but don't they only have 180 degree rotation?

So does any body know a motor like I described in paragraph 1, or at least point me in the right direction?

答:
Without knowing more about your robot nobody can help size your motor. We would need to know things like weight, desired top speed, desired acceleration, where you plan to drive it (indoor vs outdoor) etc. Here is a good starting point tutorial at Society of Robots that covers how to size a motor. </p>

<p>That same site also has nice explanations of the different kinds of motors here. </p>

Body:
Without knowing more about your robot nobody can help size your motor. We would need to know things like weight, desired top speed, desired acceleration, where you plan to drive it (indoor vs outdoor) etc. Here is a good starting point tutorial at Society of Robots that covers how to size a motor.

That same site also has nice explanations of the different kinds of motors here.


问:
2D Robot Arm Inverse Kinematics with minimum joint loads
Suppose I have a robot arm with $n$ linkages of fixed length and equal density whose motion constrained within a 2D plane.  I want the end effector to reach a particular pose $(x^*,y^*,\theta^*)$.

I know that in general, there can be multiple solutions that can reach this pose.  For my particular application, I'm interested in a solution that minimizes the maximum torque exerted over any joint under the influence of the weights of all the linkages, combined.

Is there a way I can reformulate the inverse kinematics problem as a minimization problem over the joint loads?  Can I formulate my objective function to be differentiable (i.e. so that I can use traditional optimization techniques)?  Would this yield an unique solution (in a least squares sense) for the 2D planar motion problem?

答:
Kawato M. Developped the technique called the Minimum Commanded Torque and Minimum Commanded Torque Change to optimize joint torques (see article from Kaneko Y., Kawato M. and al., 2005).

A similar approach in the kinematics domain is the Minimum Jerk (MJ) model. It have been proven to be the domain in which humans plan movements, see article from Flash T. and Hogan N., 1985 (not to mention it is also simpler to plan trajectories in the kinematics domain). Details of implementation can be found on Shadmehr R. website. It consist of 5th degree polynomials combined together and minimize the jerk (derivative of acceleration) over the whole trajectory, thus minimizing acceleration changes.

MJ in the articular coordinate system yield a unique trajectory in the articular space, that depends on the choice of the configuration for the robot at the intermediate passage points.
MJ model in the Cartesian coordinate system yield a unique trajectory in the Cartesian space, thus multiple possible solution in the articular space.

Using traditional optimization techniques with the MJ model is possible. Using the Resolved Motion Rate (RMR) technique after having computed the result of a pure MJ trajectory, the optimization function is

$z_{MJ}= \frac{1}{2}(q-q_{MJ})^TK^TK(q-q_{MJ})$

with $z_{MJ}$ the function to minimize, $K$ the gain coefficients, $q$ the articular position, and $q_{MJ}$ the MJ articular position. Computing the gradient $h$ of such function will allow you to find $\Delta \theta$ (see Huo, L. and Baron, L., 2008, for similar technique for joint limit avoidance).


问:
Continous rotation with cables
A motor needs to spin n*360 degrees. On top of the motor there are distance sensor which scan the room. I.e. lidar. What options do I have for implementing a continous rotation while having cables which are in the way?</p>

答:
For fast rotations, you can turn to transmitting information using wireless protocols or light. e.g. a turret with laser for detection purpose, can have its own separate circuit and power on a rotating plane, while information is sent using a LED to its base that have a light receiver.

For slow rotations, use a Slip Ring. Be careful as this solution is not very good for long-lasting devices, as the mechanism deteriorate with time.

Title: Continous rotation with cables


问:
Connect to video stream with Java app instead of console and mplayer
I'm building a quadcopter using Raspberry Pi. There is the Pi Camera connected to the Raspberry Pi which is streaming the captured video. I can connect to this stream via Wi-Fi on my notebook (Linux) by using the console command "nc" and then show it by "mplayer".

What I want to do though is avoid the console commands and connect to this stream directly through my Java application. The reason is I want to do some image processing operations with this video so I need to have it in my application.

Is there anyone able to help me?

答:
Alternatively, you could embrace the console commands instead of avoiding them, and still have it interact with your java program.  This would have the advantage of continuing to deliver the video stream to the notebook even if the java program fails.

I'd look at mkfifo, which will make a special file on your system that the java program could open for processing.

To put data into that file, use the tee command to copy the input data from STDIN to both STDOUT and the FIFO file you created.

e.g.

```<code>bash# mkfifo /path/to/myOutputFifo
bash# nc | tee /path/to/myOutputFifo | mplayer
</code>```

Then, point your java program at /path/to/myOutputFifo for input.

Body:
Alternatively, you could embrace the console commands instead of avoiding them, and still have it interact with your java program.  This would have the advantage of continuing to deliver the video stream to the notebook even if the java program fails.

I'd look at mkfifo, which will make a special file on your system that the java program could open for processing.

To put data into that file, use the tee command to copy the input data from STDIN to both STDOUT and the FIFO file you created.

e.g.

bash# mkfifo /path/to/myOutputFifo
bash# nc | tee /path/to/myOutputFifo | mplayer

Then, point your java program at /path/to/myOutputFifo for input.


问:
Is the accuracy of estimated position in localization better than estimated position in SLAM?
We estimate position of robot in localization and SLAM. My intuition says we get better position estimation in localisation than in SLAM because we have better sensor model likelihoods in localization because of given complete environment than in SLAM.

I would like to know the difference in accuracy of estimated position in localization and SLAM.

答:
Your intuition is good.  SLAM and a-priori map localization both use (roughly) the same technique for localization, but your SLAM position is only as good as the confidence you have in your map.

With an a-priori map, the confidence in the map is 100%.


问:
Strategies for managing power on electrical systems for mobile robots
What are some good strategies to follow while designing power supply for electrical systems on mobile robots?

Such robots typically comprise of systems with

microprocessor, microcontroller, DSP, etc units and boards along with immediate peripherals

Motor control

Analog Sensors(proximity, audio, voltage, etc)

Digital Sensors (Vision, IMU, and other exotica)

Radio comm circuits (Wifi, Bluetooth, Zigbee, etc)

Other things more specific to the purpose of the robot being designed.

Are there unified approaches/architectural rules to designing power systems which can manage clean power supply to all these various units which may be distributed across boards, without issues of interference, common ground, etc? Furthermore, also including aspects of redundancy, failure management, and other such 'power management/monitoring' features?

well explained examples of some such existing power systems on robots would make for excellent answers.

答:
These are the rules I follow when I am building power supply systems on my (small, mobile) robots:

I always separate the motors' power supply from any other circuitry, to reduce interference (as @Manishearth mentions).

For the rest of my electronic systems, I step down (using linear regulators) from a battery to each of the required voltages (usually 5V and 3.3V in my applications) in parallel.

I always include standard diodes as the first component after the battery's connection to any circuit boards, to protect against damage by reverse polarity. The voltage drop here should be taken into account when looking at regulator drop-outs.

Most of my robots have been fairly simple and have not merited much in the way of redundancy, but a common way to add basic redundancy in the case of one power supply failing is through a simple relay-based switch box. This can be configured such that the power supply powers the relay coil in parallel to passing through the Normally-Open contacts to the robot. A second backup supply can be wired to pass through the Normally-Closed contacts. If the first supply fails, the relay will toggle over to the second supply. Cleverer systems can monitor power supply health and manually switch between primary and backup sources as required.


问:
Plastic that's transparent to IR range sensors
Sharp IR range finders are pretty popular sensors, but I usually see them externally mounted and directly exposed to the environment which makes them prone to being damaged or getting crufty.

I have a few that I'd like to use on an outdoor rover, and I'd like to cover them with some sort of transparent case to protect them dirt and impacts in the environment. What type of plastics would be completely transparent to these sensors, and where would I buy simple sheets of it?

答:
First you need to know the wavelength of the sensor. According to the sharp sensors datasheet for GP2Y0A21YK, the cover should efficiently transmit light throughout the wavelength range of the LED(λ = 850 nm ± 70 nm).

Second you need to find the exact material which can transmits the wavelength of the sensor. Some transparent plastics such as acrylic glass are used where there is need to transmit IR-light or visible light. Poly(methyl methacrylate) (PMMA) passes infrared light of up to 2,800 nm and blocks IR of longer wavelengths up to 25,000 nm. Colored PMMA varieties allow specific IR wavelengths to pass while blocking visible light (for remote control or heat sensor applications, for example). A company called ePlastics has a variety of plexiglas for different wavelengths. But there are several other suppliers.

Note: Sometime IR-range sensor don't function properly under direct sunlight.
Further reading: http://www.plasticgenius.com/2011/05/infrared-and-ultraviolet-transmission.html


问:
Simulator for an adaptive, under-actuated robotic gripper
I am looking to build an adaptable robotic arm with under-actuated three (or four) fingered hands. Before I start shelling out money, I want to test my prototypes in a simulator which would ideally

allow me to try out various actuators, and also possibly a tactile sensor (like a pressure sensitive resistor or a pressure sensitive conductive sheet).

simulate different environments and tasks like gripping various shapes, sizes, weights etc.

be able to talk to an external learning/inference programs for the adaptive part (which, I think, goes under the name 'Dexterous Manipulation Planning' tasks), with sensory feedback from tactile sensors within the simulator and also camera input from a separate module.

What are my options for such a simulator, including those that only
  partially address my requirements above?

A bit about my background: I dont have any recent experience in building electronics hardware projects, although I have experienced it as part of my labs during electronics engineering under-graduation, a field that I have left a long time back. I am just a wannabe hobbyist now.

答:
For designing you can use Solidworks. And for simple simulation use Solidworks Simulation with Solidworks Motion Analysis. You can import/export data from/to MatLab or various other programs. Sensors and actuator can be placed on arbitrary points to sense the stress, displacement, etc. Use solidworks to test and improve the design.

Another very good simulator is Webots. Check out their movies section as there is a gripper similar to what you are looking for.

There are various other software for simulation according to this link.

ContentLicense: CC BY-SA 4.0


答:
FWIW, I once needed to create a plexiglass window/shell for a near-IR camera. Most CCD and CMOS sensors are sensitive in the near IR range (e.g. around 850nm), which is where @user3095849 suggested your sensor sits.

I went to a local plexiglass supplier and asked for samples of various sheets (they often have lots of leftover pieces) and simply tried them with my sensor.

This was actually simpler than looking for data-sheets for the materials the supplier had.

Interestingly, many of the colored plexiglass sheets were completely transparent in IR. I ended up using one that appears a completely opaque black.

Title: Plastic that's transparent to IR range sensors

Body:
Sharp IR range finders are pretty popular sensors, but I usually see them externally mounted and directly exposed to the environment which makes them prone to being damaged or getting crufty.

I have a few that I'd like to use on an outdoor rover, and I'd like to cover them with some sort of transparent case to protect them dirt and impacts in the environment. What type of plastics would be completely transparent to these sensors, and where would I buy simple sheets of it?


问:
Calculating the force of this system
My native language is not English, so I don't know all the specific terms you may expect me to use. I apologize for that.

Anyway, I have a motor and three connecting rods (in French, bielles). So point C will have a circular trajectory and A, thanks to the sliding pivot (pivot glissant, I really hope I am using the right translations), should have a perfectly vertical trajectory.

My question is, how could I calculate the force F? I need this to emboss a piece of paper.

Thanks a lot for your attention!

答:
I have tried to analyze the system, and the process is shown in the picture.

The mechanism is called as Slider Crank Mechanisms, Please open the website (kinematics) for some other analysis.

$(1)~\tau = F_1 . l_{DC} . sin \alpha \implies F_1 = \dfrac{\tau}{l_{DC} . sin \alpha}$

$(2)~F_1 = F_2$

$(3)~F_2 . cos \beta = F \implies F = F_2 . cos \beta = F_1 . cos \beta = \dfrac{\tau . cos \beta}{l_{DC} . sin \alpha}$

Title: Calculating the force of this system


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

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

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

答:
I would say you should use the diameter of the wheel (and any gearing embedded in the motor) to calculate how much force each motor can provide in the point of contact, and estimate the amount of friction your wheel would have against the expected surface your robot would be moving around on.

Note that this isn't exactly trivial to estimate, so usually what people do as far as I know is either choose a motor that is obviously much stronger than what would be necessary or prototype until they reach a sweet spot. Open-source projects are also a great way to become more aware of the realistic needs of your robot.

I will also add another point that wasn't included in your question but is mighty important: if you plan to use DC motors, make sure they have encoders. That way, you will be able to perform closed-loop control and your robot will be able to walk in a straight line. Also, if its possible, try to use current sensing so you can detect overloading conditions when your robot is stalled.

Title: Choosing motors for 2 wheel drive robot


问:
Communicating with syringe pump using PySerial
Let's first start of by explaining that I do not have a decent background in electronics and interfacing with them, so maybe this is a stupid question. I am currently trying to connect an old Harvard 33 syringe pump (website, PDF manual) to a computer, with the goal of controlling things like pump rates and direction. For this purpose, I connected the instrument to my computer using a D-sub/USB conversion dongle. I then connected to the dongle with PySerial without issues. However, whenever I try to send commands or request the instrument's output, for example write("RUN\r"), the instrument does not do anything at all. Requesting data (read(100)) returns only a couple of \x00. I suspect I am communicating with the dongle itself rather than the pump. When the pump is turned off or unplugged, I get exactly the same results!

Could anyone explain to me why my method does not work?

My Python code for reference:

```<code>import serial # PySerial module

# open the connection
ser = serial.Serial("/dev/ttyUSB0", baudrate=9600, bytesize=8, stopbits=2, timeout=1)
print ser # returns [Serial<id=0x1cc7610, open=True>(port='/dev/ttyUSB0', baudrate=9600, bytesize=8, parity='N', stopbits=2, timeout=1, xonxoff=False, rtscts=False, dsrdtr=False)]

# see if the connection is truly open
print ser.isOpen() # prints True

# run the pump motor
ser.write("RUN\r")
</code>```

Additional observations: when the instrument is plugged in but the above code is not running, the pump does all sorts of things at random (move one way, stop, move the other way, etc.). This behaviour is much less pronounced but still present when the code runs (and 'locks' the channel or something?). This seems to suggest that the reference voltages (logical high and low) are not properly set at 2-5V and 0-0.5V respectively

答: ser.write is always returning number of bytes written. It is not the response to your command. In order to get the response, you need to perform a read command.


答:
I don't know how it would be specifically in Python, but generally speaking, when you open a file, you get a handle which you may possibly write to or read from. Again, generally speaking, the read and write system calls return the number of bytes they have read or written.

In your case, you are writing "VER\r" to serial port. You get 4 because all four characters are sent. The write function is not responsible for waiting and retrieving a result for you. In short, it's not an API that's specifically designed to talk with your specific device.

I imagine you should call ser.read to read from the serial port.

Title: Communicating with syringe pump using PySerial

Body:
Let's first start of by explaining that I do not have a decent background in electronics and interfacing with them, so maybe this is a stupid question. I am currently trying to connect an old Harvard 33 syringe pump (website, PDF manual) to a computer, with the goal of controlling things like pump rates and direction. For this purpose, I connected the instrument to my computer using a D-sub/USB conversion dongle. I then connected to the dongle with PySerial without issues. However, whenever I try to send commands or request the instrument's output, for example write("RUN\r"), the instrument does not do anything at all. Requesting data (read(100)) returns only a couple of \x00. I suspect I am communicating with the dongle itself rather than the pump. When the pump is turned off or unplugged, I get exactly the same results!

Could anyone explain to me why my method does not work?

My Python code for reference:

```<code>import serial # PySerial module

# open the connection
ser = serial.Serial("/dev/ttyUSB0", baudrate=9600, bytesize=8, stopbits=2, timeout=1)
print ser # returns [Serial<id=0x1cc7610, open=True>(port='/dev/ttyUSB0', baudrate=9600, bytesize=8, parity='N', stopbits=2, timeout=1, xonxoff=False, rtscts=False, dsrdtr=False)]

# see if the connection is truly open
print ser.isOpen() # prints True

# run the pump motor
ser.write("RUN\r")
</code>```

Additional observations: when the instrument is plugged in but the above code is not running, the pump does all sorts of things at random (move one way, stop, move the other way, etc.). This behaviour is much less pronounced but still present when the code runs (and 'locks' the channel or something?). This seems to suggest that the reference voltages (logical high and low) are not properly set at 2-5V and 0-0.5V respectively


问:
Unable to hover my quadcopter
I'm currently flying a f450 Quadcopter using a APM 2.6 flight controller.While i am able to get the quad off the ground and relatively steady horizontally(via the use of trims).However, i am unable to get the quad to hover no matter what i do.I've tried using trims on throttle,but i am still unable to get it hover.On my transmitter (WFLY WFT06II), where the throttle has "ticks", i am currently stuck between too little lift and too much lift, where i push the throttle up by 1 "tick" and the quad goes from slowly decending to ascending, and vice versa.

Is there any way i can get my quad to hover ( with my hands off the throttle if possible), as currently, evern with me trying to fly it, i can never get it to hover vertically as it alternates between ascending and descending whenever i fiddle with the throttle.

答: This would be a hack, but you could add a small amount of weight to it so the tick that makes the quad ascend slightly would now be the hover tick. </p>

Title: Unable to hover my quadcopter


问:
Has hierarchical learning been embodied in a robot before?
I've been reading about hierarchical reinforcement learning (HRL) and it's applications. A well-written literature review on the subject can be found here. However, I was wondering if research has ever been done where an HRL system has been implemented on an individual robot? This paper seems to imply that it has been, by saying that the delivery task that it models "is commonly used in HRL, both in computational and experimental settings". However, my Google Scholar searches haven't turned up any fruit as to what this real-world experimental setting might be. Help would be appreciated for finding either model-based or model-free implementation of hierarchical reinforcement learning in a robot.</p>

答:
HRL has been embodied in a robot in multiple cases.

In a reaching, shelving robot.

In a robot learning how to stand-up.

In robot navigation.

However, how HRL applied in each of these cases varies. The first uses HRL to manipulate Dynamic Movement Primitives, while the second, older method focuses moreso on learning state space values.


答:
There is no meaning of this kind of comparison. It is evident that the localization will be more accurate than SLAM. Let's see why. SLAM is usually constructed by using probabilistic methods as follows
$$
p( x_{t}, m | z,u)
$$

One seeks to solve the aforementioned conditional probability where $x$ is the state vector, $m$ is the map, $z$ is the observations and $u$ is the control input. For localization, also by using probabilistic methods is as follows

$$
p( x_{t} | z,u, m)
$$
You will notice the $m$ in localization is provided which means the true location of the map is known with absolute certainty. This is not the case in SLAM in which we need to estimate the map $m$ which means the absolute certainty is not provided (i.e. impossible to access to the true location of the map). In SLAM, more work need to be done to filter this noise. As you can see, loosely speaking, localization is a simplified version of the SLAM where we assume the map is given. This is why the authors of "Probabilistic Robotics" started the discussion with localization before SLAM. That being said, SLAM is more realistic than localization.

Title: Is the accuracy of estimated position in localization better than estimated position in SLAM?

Body:
We estimate position of robot in localization and SLAM. My intuition says we get better position estimation in localisation than in SLAM because we have better sensor model likelihoods in localization because of given complete environment than in SLAM.

I would like to know the difference in accuracy of estimated position in localization and SLAM.


问:
Implementing a torque-controlled method on a position-controlled robot
I am working with a position-controlled manipulator. However, I want to implement a torque-controlled method on this robot. Is there any way to convert a torque command to a position command?

I try to find research papers on this but I have no idea where I should start or which keywords I should use in searching. Do you have any suggestion?

答: Many robotics textbooks should have descriptions on control algorithms for arm.  Typically, you will wrap position or velocity control around torque control.  You can use PID control for this, but i think there are other methods.</p>


答:
There are many places to buy raw motors, or motors with integrated gear boxes:

solarbotics

Pololu

RobotShop

Trossen Robotics

Robot Marketplace

Note that you can run most DC motors at a large range of voltages.

Yes, most hobby servos are not continuous rotation.  But you can modify them (or buy them modified) to be continuous rotation.  But there are many other better options than hobby servos.  Dynamixels are nice and versatile for example.

As I mentioned in the comment, you typically don't use a motor without a gearbox because it spins too fast, and doesn't have enough torque.  That is why so many motors have integrated gearboxes.

If you provide info on your robot size, weight, wheel size, required speed, etc. (perhaps in another question), I'm sure we will be able to help you pick a motor and gearbox combination for your application.

Title: What motors should I use that do not require gearboxes? This is a car like robot

Body:
I am new to robotics, and ime looking for a <12v motor that can be used to power a car-like robot.I will have two of these, so I can turn on-spot. Furthermore I want them not to require a gearbox, so I can just attach them to the wheels. I don't really know where to start looking for one.

I have heard servos have built in gearboxes, but don't they only have 180 degree rotation?

So does any body know a motor like I described in paragraph 1, or at least point me in the right direction?


答:
What you are trying to accomplish is impossible in any practical sense; you are trying to perfectly balance the weight of your quadcopter with the force from the thrusters -- without any sensor input.  99.99999% of the possible values you could set for your throttle are either too high or too low, and the correct value may change over time.

To make your quadcopter maintain a constant height, you will need to look at PID control.  For that, you will need some form of altitude sensor and possibly an accelerometer (depending on what sort of accuracy you need).

Title: Unable to hover my quadcopter

Body:
I'm currently flying a f450 Quadcopter using a APM 2.6 flight controller.While i am able to get the quad off the ground and relatively steady horizontally(via the use of trims).However, i am unable to get the quad to hover no matter what i do.I've tried using trims on throttle,but i am still unable to get it hover.On my transmitter (WFLY WFT06II), where the throttle has "ticks", i am currently stuck between too little lift and too much lift, where i push the throttle up by 1 "tick" and the quad goes from slowly decending to ascending, and vice versa.

Is there any way i can get my quad to hover ( with my hands off the throttle if possible), as currently, evern with me trying to fly it, i can never get it to hover vertically as it alternates between ascending and descending whenever i fiddle with the throttle.


答:
First, ensure that your wiring is consistent with the wiring diagram on p. 24-25.  I've seen similar "random" behavior when the grounds are not connected properly.

Before attempting to programmatically talk to the pump, try it manually.  I use TeraTerm to talk to my Harvard 33 during testing - but any like terminal software will do (even Hyperterminal).  First, check the pump's address (p. 16) - is it correct? If so, issue a "VER" command a few times.  Note that the pump's Remote LED becomes illuminated once the pump chain command is established.  If the LED does not illuminate, your serial commands will not work. If the VER command works, then move on to setting run modes.  When I use the pump, I issue the following sequence before attempting to run the pump: PAR ON, MOD PRO, DIA A 26.600, DIR INF. A meaningful sequence of configuration commands is key: the pump has a bit of intelligence and will respond appropriately to erroneous and/or conflicting commands.

If the pumped responded positively to those commands, attempt to run the configured syringe: RAT A 1.0000 MM and then RUN.  If that works, you can issue the stop command: STP.

If the pump checks out manually, then proceed to programmatic use.  When doing so, take extra care to follow the formatting rules for rates, etc.  The interpretation of the  ffffff rate and diameter specifications is inflexible, and the rules must be followed exactly (see p.18 for example).  Note that the pump also has a strict set of rules for command usage during operation (i.e. don't issue a DIA command while the pump is running).  Likewise, note that the pump chain commands are ignored if the device is in SET mode (p. 16).

When looking for return characters, keep in mind how mind-boggling slow 9600 baud actually is.  You'll likely have to set up a polling routine to handle the pump's response.  As shown on p.16, the response should lead with a '\r' and end with a '\n'.  For example: you might set up a loop to wait until the '\n' char is seen once a command has been issued.

Likewise, be prepared to parse and handle the pump's command responses: ?, NA, and OOR (p.20).

Good luck!


问:
Collaborative Behavior: Implementing a Bucket Brigade With Robot Arms
I was wondering whether something like this is possible: A block of ice(say) needs to be transferred piece by piece from a source to a destination with the help of 5 robots standing in a straight line between the source and destination. The first robot picks up a piece of the block from the source and checks if the next robot in line is busy. If yes, it waits for it to complete its task and proceeds, otherwise it transfers the piece and goes back to collect another piece. Please help me on implementing this if it is possible, as I am thinking to make it a project topic.

to clear out the confusions, here's a smaller prototype of the project i'm thinking,

i have two cars, one wired, another wireless. the wired car is the master here, the wireless, the slave. through a remote, i send a command to the wired car to instead command the wireless car to move forward. the wired car will then check if the wireless slave is already executing some previously given command or no, and accordingly send the command.

conversely, the master may send the command as soon as it receives it, it's on the slave now to complete the task it's doing, and then execute the command it just received.

答:
A standard way to model that kind of discrete-event behavior is through Petri Nets or a Parallel Composition of Automata.

An interesting start might be to simply create the model and see if it works in simulation first. That will help you solve the high-level logic of your problem. After that is dealt with, you can begin to think about which robot you want to use (or whether you want to build your own) and how you'll implement that high-level logic in your programming language of choice.

The good thing about using these models is that you have means to systematically evaluate whether you have solved your problem or not. Ad-hoc programming might work if the problem is simple enough, but as soon as you incorporate more difficult situations it becomes too error-prone IMO.


答:
Robotic arm are basically controlled using torque input to reach a position reference. Most common control techniques for such robot are computed torque (also called inverse dynamics approach), and P-D controller with gravity compensation.

You can find all the information you need on the bible of robot modeling and control, Robot Modeling and Control, Spong W. and al., 2005.

PS: searching papers about that subject is a very bad idea since this is no new controller that you are looking for, this is well established control techniques.

Title: Implementing a torque-controlled method on a position-controlled robot

Body:
I am working with a position-controlled manipulator. However, I want to implement a torque-controlled method on this robot. Is there any way to convert a torque command to a position command?

I try to find research papers on this but I have no idea where I should start or which keywords I should use in searching. Do you have any suggestion?


答:
Thank you for directly linking to the manual -- that makes answering questions like this much quicker.

I connected the instrument to my computer using a D-sub/USB conversion
  dongle.

I'm assuming that you've already figured out that the thing that looks like a standard 9-pin D-sub connector on the Harvard Model 33 is completely incompatible with standard RS-232, and you have (or can make) something that looks like the proper cable between a PC and the pump.

The first thing I would do is "beep out" the cable:
The cable should have a DB9 female on one end, and a RJ11 plug on the other end,
and connections as shown on in Appendix D and Appendix F (p. 24-25) of the manual.

As far as I can tell, for your application, you don't wan't anything plugged in to the "I/O" D-sub connector on the back of the pump.
Instead, you want the RJ-11 plug end of your cable plugged into the "Port #1" RJ-11 socket on the back of the pump; and the DB9 female end of your cable plugged into the male DB-9 connector on the USB-to-RS232 dongle.

Throwback1986 has many good tips.

Requesting data (read(100)) returns only a couple of \x00.
  ...
  Could anyone explain to me why my method does not work?

These pumps are designed to be connected in a chain,
and they are designed to ignore commands sent to other pumps in a chain.
Also, they ignore commands sent while the pump is in setting mode (see p. 16).

I might run a script like this to see which (if any) address the pump is responding to:

```<code># communicate with a Harvard 33 syringe pump
# http://robotics.stackexchange.com/questions/5079/communicating-with-syringe-pump-using-pyserial
# pump website: http://www.harvardapparatus.com/webapp/wcs/stores/servlet/product_11051_10001_44004_-1_HAI_ProductDetail___
# pump manual: http://www.instechlabs.com/Support/manuals/HA33Manual.pdf
# WARNING: untested code

import serial # PySerial module: http://pyserial.sf.net/

# open the connection
ser = serial.Serial(port="/dev/ttyUSB0", baudrate=9600, stopbits=STOPBITS_TWO, timeout=0.5)
print ser

# see if the connection is truly open
print ser.isOpen()

# See if the pump is at address 0:
# try to get the software version of that pump
# using the VER command from p. 19 of the manual
command_string = "VER\r"
ser.write( command_string )
response = ser.read(100)
print "version: %r." % response

# guess every possible address 0 to 99
for guessed_address in range (0, 100):
    # request prompt
    prompt_request = "%d\r" % guessed_address
    ser.write( prompt_request )
    response = ser.read(100)
    print "prompt: %r." % response

    # try to get the software version of that pump
    # using the VER command from p. 19 of the manual
    command_string = "%dVER\r" % guessed_address
    ser.write( command_string )
    response = ser.read(100)
    print "version: %r." % response

print "All done."
</code>```

Does this script show any "interesting" responses?

If I had this pump in front of me, I would follow the "Configuring the Pump Chain" process on p. 14 to figure out the current pump address and baud rate.

Does the pump display "b:9600" on the pump's front LED display when I do that?
Does the pump display "Adr:00" on the pump's front LED display when I do that?
If not, I would go through the "Configuring the Pump Chain" on p. 14 to get that set.

I might try getting pyserial to communicate through that USB dongle to and from some other device, perhaps a simple loop-back wire,
just to make sure that pyserial works with that USB dongle.

Good luck!

Body:
Thank you for directly linking to the manual -- that makes answering questions like this much quicker.

I connected the instrument to my computer using a D-sub/USB conversion
  dongle.

I'm assuming that you've already figured out that the thing that looks like a standard 9-pin D-sub connector on the Harvard Model 33 is completely incompatible with standard RS-232, and you have (or can make) something that looks like the proper cable between a PC and the pump.

The first thing I would do is "beep out" the cable:
The cable should have a DB9 female on one end, and a RJ11 plug on the other end,
and connections as shown on in Appendix D and Appendix F (p. 24-25) of the manual.

As far as I can tell, for your application, you don't wan't anything plugged in to the "I/O" D-sub connector on the back of the pump.
Instead, you want the RJ-11 plug end of your cable plugged into the "Port #1" RJ-11 socket on the back of the pump; and the DB9 female end of your cable plugged into the male DB-9 connector on the USB-to-RS232 dongle.

Throwback1986 has many good tips.

Requesting data (read(100)) returns only a couple of \x00.
  ...
  Could anyone explain to me why my method does not work?

These pumps are designed to be connected in a chain,
and they are designed to ignore commands sent to other pumps in a chain.
Also, they ignore commands sent while the pump is in setting mode (see p. 16).

I might run a script like this to see which (if any) address the pump is responding to:

# communicate with a Harvard 33 syringe pump
# http://robotics.stackexchange.com/questions/5079/communicating-with-syringe-pump-using-pyserial
# pump website: http://www.harvardapparatus.com/webapp/wcs/stores/servlet/product_11051_10001_44004_-1_HAI_ProductDetail___
# pump manual: http://www.instechlabs.com/Support/manuals/HA33Manual.pdf
# WARNING: untested code

import serial # PySerial module: http://pyserial.sf.net/

# open the connection
ser = serial.Serial(port="/dev/ttyUSB0", baudrate=9600, stopbits=STOPBITS_TWO, timeout=0.5)
print ser

# see if the connection is truly open
print ser.isOpen()

# See if the pump is at address 0:
# try to get the software version of that pump
# using the VER command from p. 19 of the manual
command_string = "VER\r"
ser.write( command_string )
response = ser.read(100)
print "version: %r." % response

# guess every possible address 0 to 99
for guessed_address in range (0, 100):
    # request prompt
    prompt_request = "%d\r" % guessed_address
    ser.write( prompt_request )
    response = ser.read(100)
    print "prompt: %r." % response

    # try to get the software version of that pump
    # using the VER command from p. 19 of the manual
    command_string = "%dVER\r" % guessed_address
    ser.write( command_string )
    response = ser.read(100)
    print "version: %r." % response

print "All done."

Does this script show any "interesting" responses?

If I had this pump in front of me, I would follow the "Configuring the Pump Chain" process on p. 14 to figure out the current pump address and baud rate.

Does the pump display "b:9600" on the pump's front LED display when I do that?
Does the pump display "Adr:00" on the pump's front LED display when I do that?
If not, I would go through the "Configuring the Pump Chain" on p. 14 to get that set.

I might try getting pyserial to communicate through that USB dongle to and from some other device, perhaps a simple loop-back wire,
just to make sure that pyserial works with that USB dongle.

Good luck!


问:
Nano Quadcopters Microcontroller and battery
I am looking into building a nano quadcopter, But as i watch more resources and videos i get more confused, regarding some of the things that i hope would be answered here. I am in very basic level of expertise here, i haven't built any robots or quadcopters to be exact.

What i want to know is, when i program a quadcopter say using intel edison chip, how do i power the quadcpter? i could not find that small size battery to move the propellers and start the chip.

Further more what is the procedure i should follow while developing a nano or small quadcopter, i saw a link on instructable that uses python on raspberry pi and then that raspberry pi control the arduino to control the robot. Can it be done only by using raspberry pi itself?

I am getting confused and i would like to know if i have to make small or nano quadcopter what should i be doing to get started?

Most of the latest chip support linux and high level programming language like python, so i hope i can go about programming the entire quadcopter using python or similar high level language and i don't suppose i have to stick with c langauge now. If i am wrong please help me understand the matter, there is high chance that i could be wrong.

答:
If you are just starting out with quadcopters, it might be better if you buy an off-the-shelf quadcopter first.  Then hack it for your needs while learning the ropes.  (i.e. you wouldn't build a car, bike, computer, etc. from scratch if you've never taken one apart, hacked it, and completely understand what every piece is for.  so why do this with a robot?)

I am not sure, but i kind of doubt you will be able to do some of the low-level flight controls in Python.


答:
If your number n is small enough then there are simpler and more durable ways to hook things up.

Car steering wheel style: these wheels turn ~ 5 times from steering lock to lock,  I understand they use coiled flat flex cable that coils around the steering shaft with 90degree bends/turns on the ends to mate to connectors on the steering wheel and the static point of the steering column. If you have the volume this is neat, tidy and simple.  Try scavenging cables from inkjet printers, heads for some low friction stuff.

If you have a long distance between the rotating part and the farthest no rotating part, try stuffing excess cable in a tube between the two place. No special connectors necessary.  Some cables can take a lot of turns before kinking to the point of damage if set up this way.  I have heard this is the easiest way to get power from a wind generator down a pole to ground; it works because random wind patterns usually cancel the twists out and regular maintenance takes care of biases.

Both of these only work for small n with little construction fuss.

Have fun building your toys!

```<code>   Albert.
</code>```

Title: Continous rotation with cables

Body: A motor needs to spin n*360 degrees. On top of the motor there are distance sensor which scan the room. I.e. lidar. What options do I have for implementing a continous rotation while having cables which are in the way?</p>

Body:
If your number n is small enough then there are simpler and more durable ways to hook things up.

Car steering wheel style: these wheels turn ~ 5 times from steering lock to lock,  I understand they use coiled flat flex cable that coils around the steering shaft with 90degree bends/turns on the ends to mate to connectors on the steering wheel and the static point of the steering column. If you have the volume this is neat, tidy and simple.  Try scavenging cables from inkjet printers, heads for some low friction stuff.

If you have a long distance between the rotating part and the farthest no rotating part, try stuffing excess cable in a tube between the two place. No special connectors necessary.  Some cables can take a lot of turns before kinking to the point of damage if set up this way.  I have heard this is the easiest way to get power from a wind generator down a pole to ground; it works because random wind patterns usually cancel the twists out and regular maintenance takes care of biases.

Both of these only work for small n with little construction fuss.

Have fun building your toys!

   Albert.


问:
following a trajectory with LQR controller
We want our wheeled robot to follow a (rather short) trajectory. We wrote an LQR controller, which works well in simulation. However, our robot offers two problems:

1.) The reported state information does not seem to be very accurate.

2.) Its motion seems to underly some random deviations. We did not succeed in establishing a good model to predict the robots motion with a given control input.

Is it possible to manage these problems with the LQR controller? If yes, how?

答:
It depends on the actual source of problems. If you just have a lot of noise in your state estimate you can improve things a bit by adjusting weights to be less aggressive.

If the problem is that your state estimate is consistently far off you can't do anything until you fix your estimator. Quite often in vehicle control this is actually the biggest challenge.


问:
optimal number of robots for cooperative surveillance
Suppose we need to detect the occurrence of a special event in a large area(e.g. a city). If we need that each point being visited every h hours, how could we find the optimal number of robots for cooperative surveillance?

Notice that there is no control center!

答:
Let's say your environment is a weighted graph. The weight of each edge shows the distance. Edges ($E$) could be roads and nodes ($V$) could be junctions. Let's further assume that each robot has velocity $v$.

You say each "point" needs to be surveyed every $h$ hours. I assume that means each point in the city, which means each point in every road and junction. Since this is a city, we can also assume that the graph is connected.

As a final assumption, let's say that the junctions have zero dimension.  That is a single point in the junction is taken as the graph node and the distances from the edges of the roads to that point are added to that roads weight (road length). This implies that there is no time spent in a node and all time is spent walking the edges.

Lower Bound

First, let's find a lower bound to the number of robots. If we sum the weights of the edges, we get the total distance that needs to be travelled. The minimum number of robots required is:

$N_{min} = \bigg\lceil \dfrac{\sum_{i \in E} w_i}{h \times v} \bigg\rceil$

If it was possible for the robots to travel the edges without travelling on each road more than once, then this lower bound is the actual number required. Think of it this way. Imagine the city is like this:

```<code>              X----------X
             /            \
            /              \
           /                \
          X                  X
           \                /
            \              /
             \            /
              X----------X
</code>```

And imagine each edge is 1Km, and the speed of the robots ($v$) is 0.7Km/h. Imagine $h$ is two hours. Each robot can to travel $h \times v = 2 \times 0.7 = 1.4Km$ in that two hours. Now if you place robots at regular intervals around the loop and they all go for example clock-wise, then just as the 2 hours limit is getting expired on a point, another robot should arrive at that point. This means that the robots should be placed at 1.4Km intervals. Simply dividing the circumference of the loop by 1.4 (and taking the ceiling) gives the number of required robots.

Note: An Eulerian graph is essentially a twisted loop and for such graphs the formula above gives the exact number of required robots. Unfortunately, a city is far from an Eulerian graph.

Upper Bound

This is a harder problem. However, here is an idea.

First, let's solve the problem for another simple case. Imagine the graph is just a line:

```<code>     X--------X------------------X-------X----X-----------X
</code>```

Then, the robots can't circle around anymore, but they have to "patrol". That means they have to use half of their time going one way and the other half coming back. In other words, the number of robots needed becomes:

$N_{min} = \bigg\lceil \dfrac{\sum_{i \in E} w_i}{(h/2) \times v} \bigg\rceil$

Another point of view could be robots that loop this path by going to one end and coming back to the other end in which case the number of robots would be:

$N_{min} = \bigg\lceil \dfrac{2 \times \sum_{i \in E} w_i}{h \times v} \bigg\rceil$

Which is exactly the same as patrolling the path.

That said, here is an algorithm that gives an upper bound to the number of needed robots.

```<code> 1. do
 2.   G' = G with marked edges removed
 3.   if loop L exists in G'
 4.     put robots looping in L
 5.     mark edges of L
 6.   else
 7.     find a random unexpandable path P in G'
 8.     find the shortest path P' in G that connects both ends of P
 9.     create a loop L by combining P and P'
10.     N1 = number of robots needed to patrol P
11.     N2 = number of robots needed to loop in L
12.     if N1 < N2
13.       put robots patrolling P
14.       mark edges of P
15.     else
16.       put robots looping in L
17.       mark edges of L
18. while unvisited edges remain
</code>```

Notes:

At 3, we try to extract out Eulerian loops out of the graph for which we know the optimal answer.

At 7, we try to get paths as long as possible out of the graph and have robots patrolling them. Make sure the path is expanded as far as possible. That is, if there is an unmarked edge connected to any end of the path, just augment the path with that edge.

The purpose for 8 and 9 is that, having robots patrolling the found path may be far from optimal. In fact, if we allow the robots to move from one end of the path to the other end via the edges that are possible already marked, then perhaps we find a loop which results in a smaller number of robots. 10 and 11 calculate the number of robots for the two possible cases and 12 decides which one was better.

Here is an example. Imagine the following graph:

```<code>              X----------X
             /            \
            /              \
           /                \
          X                  X
           \                /
            \              /
             \            /
              X----------X
             /            \
            /              \
           /                \
          X                  X
           \                /
            \              /
             \            /
              X----------X
</code>```

First, we find a loop and mark it. Imagine this is the top loop:

```<code>              X**********X
             *            *
            *              *
           *                *
          X                  X
           *                *
            *              *
             *            *
              X**********X
             /            \
            /              \
           /                \
          X                  X
           \                /
            \              /
             \            /
              X----------X
</code>```

Now we are left with this path:

```<code>              X          X
             /            \
            /              \
           /                \
          X                  X
           \                /
            \              /
             \            /
              X----------X
</code>```

We can either patrol the path with a larger number of robots, or make a loop with an edge previously visited and have fewer robots travelling it. In the end, two loops is better.

The algorithm could have also found a different solution. For example, the first loop could have been the outer loop:

```<code>              X**********X
             *            *
            *              *
           *                *
          X                  X
           *                *
            *              *
             *            *
              X----------X
             *            *
            *              *
           *                *
          X                  X
           *                *
            *              *
             *            *
              X**********X
</code>```

After which we are left with the center edge as a path:

```<code>              X----------X
</code>```

And obviously, it's better to have robot(s) patrolling it than to create a very large loop out of the visited edges.

It is interesting to note that in this case, the shortest path P' as in the algorithm above is in fact this path itself. As a result, the loop is essentially robots that loop between the ends of this path (rather than patrolling only their specific portion of the path). The optimal number of robots in either way is the same as mentioned before.

Optimal Number

I really don't know. It is possible (but I haven't proven anything) that this problem doesn't even belong to $P$, so there may not be any useful solution for it at all (again, I may be wrong).

If you find that the "Upper Bound" algorithm doesn't provide small enough number of robots, for example by examining the graph yourself and find obvious optimizations, you could also always try optimization algorithms (such as genetic algorithms).

Notice that there is no control center!

Mind you, my solution is to calculate the paths each robot needs to circle in (or patrol) offline and then program the robots to keep to their path forever. This doesn't address problems such as a robot breaking and others having to cover for it for example.

Body:
Let's say your environment is a weighted graph. The weight of each edge shows the distance. Edges ($E$) could be roads and nodes ($V$) could be junctions. Let's further assume that each robot has velocity $v$.

You say each "point" needs to be surveyed every $h$ hours. I assume that means each point in the city, which means each point in every road and junction. Since this is a city, we can also assume that the graph is connected.

As a final assumption, let's say that the junctions have zero dimension.  That is a single point in the junction is taken as the graph node and the distances from the edges of the roads to that point are added to that roads weight (road length). This implies that there is no time spent in a node and all time is spent walking the edges.

Lower Bound

First, let's find a lower bound to the number of robots. If we sum the weights of the edges, we get the total distance that needs to be travelled. The minimum number of robots required is:

$N_{min} = \bigg\lceil \dfrac{\sum_{i \in E} w_i}{h \times v} \bigg\rceil$

If it was possible for the robots to travel the edges without travelling on each road more than once, then this lower bound is the actual number required. Think of it this way. Imagine the city is like this:

              X----------X
             /            \
            /              \
           /                \
          X                  X
           \                /
            \              /
             \            /
              X----------X

And imagine each edge is 1Km, and the speed of the robots ($v$) is 0.7Km/h. Imagine $h$ is two hours. Each robot can to travel $h \times v = 2 \times 0.7 = 1.4Km$ in that two hours. Now if you place robots at regular intervals around the loop and they all go for example clock-wise, then just as the 2 hours limit is getting expired on a point, another robot should arrive at that point. This means that the robots should be placed at 1.4Km intervals. Simply dividing the circumference of the loop by 1.4 (and taking the ceiling) gives the number of required robots.

Note: An Eulerian graph is essentially a twisted loop and for such graphs the formula above gives the exact number of required robots. Unfortunately, a city is far from an Eulerian graph.

Upper Bound

This is a harder problem. However, here is an idea.

First, let's solve the problem for another simple case. Imagine the graph is just a line:

     X--------X------------------X-------X----X-----------X

Then, the robots can't circle around anymore, but they have to "patrol". That means they have to use half of their time going one way and the other half coming back. In other words, the number of robots needed becomes:

$N_{min} = \bigg\lceil \dfrac{\sum_{i \in E} w_i}{(h/2) \times v} \bigg\rceil$

Another point of view could be robots that loop this path by going to one end and coming back to the other end in which case the number of robots would be:

$N_{min} = \bigg\lceil \dfrac{2 \times \sum_{i \in E} w_i}{h \times v} \bigg\rceil$

Which is exactly the same as patrolling the path.

That said, here is an algorithm that gives an upper bound to the number of needed robots.

 1. do
 2.   G' = G with marked edges removed
 3.   if loop L exists in G'
 4.     put robots looping in L
 5.     mark edges of L
 6.   else
 7.     find a random unexpandable path P in G'
 8.     find the shortest path P' in G that connects both ends of P
 9.     create a loop L by combining P and P'
10.     N1 = number of robots needed to patrol P
11.     N2 = number of robots needed to loop in L
12.     if N1 < N2
13.       put robots patrolling P
14.       mark edges of P
15.     else
16.       put robots looping in L
17.       mark edges of L
18. while unvisited edges remain

Notes:

At 3, we try to extract out Eulerian loops out of the graph for which we know the optimal answer.

At 7, we try to get paths as long as possible out of the graph and have robots patrolling them. Make sure the path is expanded as far as possible. That is, if there is an unmarked edge connected to any end of the path, just augment the path with that edge.

The purpose for 8 and 9 is that, having robots patrolling the found path may be far from optimal. In fact, if we allow the robots to move from one end of the path to the other end via the edges that are possible already marked, then perhaps we find a loop which results in a smaller number of robots. 10 and 11 calculate the number of robots for the two possible cases and 12 decides which one was better.

Here is an example. Imagine the following graph:

              X----------X
             /            \
            /              \
           /                \
          X                  X
           \                /
            \              /
             \            /
              X----------X
             /            \
            /              \
           /                \
          X                  X
           \                /
            \              /
             \            /
              X----------X

First, we find a loop and mark it. Imagine this is the top loop:

              X**********X
             *            *
            *              *
           *                *
          X                  X
           *                *
            *              *
             *            *
              X**********X
             /            \
            /              \
           /                \
          X                  X
           \                /
            \              /
             \            /
              X----------X

Now we are left with this path:

              X          X
             /            \
            /              \
           /                \
          X                  X
           \                /
            \              /
             \            /
              X----------X

We can either patrol the path with a larger number of robots, or make a loop with an edge previously visited and have fewer robots travelling it. In the end, two loops is better.

The algorithm could have also found a different solution. For example, the first loop could have been the outer loop:

              X**********X
             *            *
            *              *
           *                *
          X                  X
           *                *
            *              *
             *            *
              X----------X
             *            *
            *              *
           *                *
          X                  X
           *                *
            *              *
             *            *
              X**********X

After which we are left with the center edge as a path:

              X----------X

And obviously, it's better to have robot(s) patrolling it than to create a very large loop out of the visited edges.

It is interesting to note that in this case, the shortest path P' as in the algorithm above is in fact this path itself. As a result, the loop is essentially robots that loop between the ends of this path (rather than patrolling only their specific portion of the path). The optimal number of robots in either way is the same as mentioned before.

Optimal Number

I really don't know. It is possible (but I haven't proven anything) that this problem doesn't even belong to $P$, so there may not be any useful solution for it at all (again, I may be wrong).

If you find that the "Upper Bound" algorithm doesn't provide small enough number of robots, for example by examining the graph yourself and find obvious optimizations, you could also always try optimization algorithms (such as genetic algorithms).

Notice that there is no control center!

Mind you, my solution is to calculate the paths each robot needs to circle in (or patrol) offline and then program the robots to keep to their path forever. This doesn't address problems such as a robot breaking and others having to cover for it for example.


问:
What algorithm should I use for balancing a two wheeled robot using a gyroscope?
Is there a good, popular and reliable algorithm I can use by taking input from a gyroscope and using this to control two independant wheels to keep such a balanced robot reliably upright? I'm looking for an algorithm that will let me use it to drive a robot around as well as keep it upright when stationary. The ability to deal with inclines and people nudging it would also be a bonus, but not essential.

答: I believe the most popular solution to this problem is an LQR controller. The problem you are trying to solve is the inverted pendulum problem. Using those keywords, you should be able to Google someone's open-source code. The next problem will be mapping most of the relevant physics quantities to your application (weight, motor torque, etc...)</p>


问:
What is a suitable model for two-wheeled robots?
What is a suitable model for two-wheeled robots? That is, what equations of motion describe the dynamics of a two-wheeled robot.

Model of varying fidelity are welcome. This includes non-linear models, as well as linearized models.

答: If you really want to dive into the mathematics of it, here's the seminal paper that unified and categorized most models for wheeled robots.</p>


答:
It is possible under limited conditions. The Linear-quadratic regulator (LQR) controller assumes that the system under control has linear dynamics and that the transition and observation models are deterministic. While in practice it works if these conditions are violated, the more extreme the violation the more likely it is to fail.

An alternative is the Linear-quadratic-gaussian controller because it allows for noise in the motions and percepts. A challenge with using LQG is that you must have model of the noise.

More specifically, assume you have the following dynamical model:

$\dot{\mathbf{x}}(t) = A\mathbf{x}(t) + B\mathbf{u}(t) + \mathbf{v}(t), \mathbf{v}(t) \sim \mathcal{N}(0, M) \\
\mathbf{y}(t) = C\mathbf{x}(t) + \mathbf{w}(t), \mathbf{w}(t) \sim \mathcal{N}(0, N)$

where $\mathbf{x}(t)$, and $\mathbf{u}(t)$ represent the state of the system and the control applied to at it at time $t$ respectively, $A$, $B$, and $C$ represent the natural dynamics, the control dynamics, and the observation dynamics respectively, and finally $\mathbf{v}(t)$ and $\mathbf{w}(t)$ represent noise of the motion and observation models respectively and are zero mean gaussian distributions with covariances $M$ and $N$.

In order to use LQG you need to know $A$, $B$, $C$, $M$, and $N$ as well as the initial state of the system, i.e. $\mathbf{x}(0)$.

Title: following a trajectory with LQR controller

Body:
We want our wheeled robot to follow a (rather short) trajectory. We wrote an LQR controller, which works well in simulation. However, our robot offers two problems:

1.) The reported state information does not seem to be very accurate.

2.) Its motion seems to underly some random deviations. We did not succeed in establishing a good model to predict the robots motion with a given control input.

Is it possible to manage these problems with the LQR controller? If yes, how?


问:
Using an Xbox controller to fly a Quadrocopter
So I have a quadrocopter, it does come with a remote but I intend to run certain modifications to the copter, like installing a camera, a mechanical manipulator, and other random modifications. The remote that comes with the copter isn't flexible enough to help with such functions and plus it lacks any more buttons.

I was wondering if I could somehow program the quadrocopter to respond to my Xbox controller. I was planning on using my laptop's Bluetooth connection to talk to copter. The Xbox controller which is connected to the computer would be then used to control the quadrocopter. So my question is, how exactly do I program the controller? How do I go about making all of this possible?

I understand this question is really vague and that there are too many options out there, but I do need help figuring this out.

答: I know it's not software out of the box but if you are into programming, I suggest you to look into the gaming library GLFW3. It's the best library that is used in games and OpenGL, and you have many functions for controlling all input devices. It also has bindings for your favorite language probably


问:
Robot safety standards for software
I am looking for possible ISO standards for robot safety specifically for software.

I have come across this presentation that mentions many ISO standards and it's not very clear which exactly applies to software. The most probable ones are:

ISO 10218-1

ISO 13849-1 / IEC 62061

IEC 61508

ISO/TS 15066

The safety related to software seems to be categorized as Level 4 and Level 6 in the presentation above.

I would appreciate if anyone with knowledge in this area could point me to the right standard. They are quite expensive so I could simply go through them all to see which one applies.

As a side note, some standards like C have their standard "draft" freely available. Could there be free copies of drafts for those standards too?

答:
I believe the EN 61508 is the most important one from the software point of view.
But it is not only valid for robots. This is one of the most important standard for industrial development. It defines the safety of a system, that it has to be free of "unjustifyable risks"

There are all the requirements for:
 - rts
 - redundancy (including redundant software)
 - SIL
 - software development process and documentation

More detailed:

61508-1 is pretty general

61508-2 is lot about electronics, including programmable electronic parts

61508-3 is the main part about software

61508-4 has nothing to do with software, just some acronym's and the rest of the overhead you need to understand the rest

61508-5 How to calculate SIL

61508-6 Examples of Part 2 and 3

61508-7 Another genral part about application

From this standard lot of other standards are inherit:

61511 for process industry

60335 for home

60601 for medical applications

62061 for industrial tools

For source I have some university scripts, unfortunatly they are in german:

about 61508

general info about SIL

Title: Robot safety standards for software


问:
Robotic cell simulation software, PLC
I need to simulate robotic cell where cartesian robot trims a PCB arriving on conveyor, picks it up with vacuum cup and and places in another device. After receiving signal from device the robot would pick it up and place on another belt. I want to make the cartesian robot myself using servomotors and control cell using a PLC. Would there be software that can simulate all this? I would also need to integrate sensors and possibly machine vision.</p>

答: Yes, this is possible to do.  Check out some of these robotics simulators.</p>

Title: Robotic cell simulation software, PLC


问:
Gyro rate gets increase problem
I am using PID controller to stabilize quadcopter. Its working well on the jig. But when I removed jig it went up and hit ceiling. I analyzed my data and from which I come to the conclusion that at static poisition my gyro sensor is outputing +-6deg/sec but when I start motors (without being control in) gyro rate jupms to +-30deg/sec. This increase in rate due to vibrational noise is causing quadcopter to liftup without beign my intension. Any suggestions to get rid from this vibrational noise? </p>

答: I recommend you to use a kalman filter if you want to remove the noise without  disfiguring the usefull part of the gyroscope's signal.</p>

Title: Gyro rate gets increase problem


问:
Regarding Long distance wireless communication
I have a requirement to transmit some sensor data through wireless to a distance of 2 kilometers. I am a newbie to these technologies and concepts. Can anyone help me by providing some pointers to start with this. </p>

答:
This sounds like a question for the Electronics Stack Exchange.

"Long distance wireless communication"

"Long distance communication"

"Wireless communication over long distances"

"Zigbee communication outdoors at long distance ( around 1 - 1.5 km)"


问:
Looking for a cheap(ish) micromouse that I can program with C/C++
I'm looking to buy a micromouse (i.e. a small single-board unit with wheels and IR sensors that can move around freely). I've done a lot of searching but have only found resources relating to building one from components bought separately. However, I'm more of a programmer than an electrician so I fear I would struggle with this.

Anybody know where to buy one of these in the UK? (PICAXE does some suitable stuff but they're BASIC only unfortunately). My budget is about £60.

答:
I think you'll be hard-pressed to find a Micromouse off the shelf besides PICAXE.  If you want one that's a bit more advanced, I'd recommend putting the robot together yourself.  I would encourage you to try out the electronics on a project like this, they aren't too bad to figure out and there are lots of resources online.

Some recommendations:

An arduino-nano is capable for such a task, look into AVR-GCC for programming.

NEMA-17 sized stepper motors will supply enough power, Pololu is a good site to find these motors and matching wheels/controllers.

I've seen people use Sharp IR's before, this will simplify some of the electronics.

This is a difficult project but very rewarding!  Best of luck.


问:
3D Magnetometer calibration algorithm
I want to calibrate my compass, which is installed on a board which inherits a GPS module. Because the GPS antenna is up-side-down the compass is 180° inverted. The easiest way to correct the problem would be to invert the rotation matrix 180°.

However I got interested how a general approach to calibrate a compass would look like. I found some approaches like this. They seem to collect magnetometer readings an project them on a sphere. But what is actually the point in this?

Does someone know how a general calibration algorithm of a 3D magnetometer looks like?

答:
We always need a reference for calibration to which we calibrate our sensor. For example in case of 3D accelerometer we use gravity as a reference which is assumed vertically downwards at a place.

For magnetometer calibration we use Earth's magnetic field  as   a reference. But we dont know the direction of resultant magnetic field vector at the place unlike gravity in case of accelerometer. Hence we need to implement sphere fitting calibration method in order to calibrate our magnetometer.

This method is explained in this blogpost as well as this blogpost. You can also download a tool which can calibrate if you feed the data. You can also have a look at implementation in C here.

Title: 3D Magnetometer calibration algorithm


问:
redundant arm path planning and trajectory following
I have a 7dof robotic arm and a set of end effector trajectories in cartesian space I need it to follow.

How do I deal with the redundancy in the arm when planning to follow these trajectories both with and without obstacle avoidance?

答: Do you mean you have an end-effector trajectory?  Because typical arm planners (such as the one in OpenRAVE) output joint space trajectories.  So they tell you how to move each joint, even for 7 DoF arms.  If so, you should clarify the question because I think when you say you have a trajectory for your robot arm, it is assumed it is a joint space trajectory.


问:
How to find a solution for quadcopter PID control
I've built a quadcopter and a rig to safely test it on. I'm working on the PID for controlling the roll pitch and yaw. I understand how a PID works on a more simple plant like say a robot with wheels and I'm just really in the dark ( i believe ) with controlling and stabilizing a quad.

My question, how do I make these sensor readings effectively alter the motors' throttle?

Firstly, my approach is based on this model,

```<code>CW motors    A,C
CCW motors   D,B

           Front
           +1 pitch
          C   D
-1 roll    \-/     +1 roll   right
           /-\
          B   A
           -1 pitch
</code>```

My IMU calculates the roll and pitch as a value between +-1.0 where being perfect balance will read as 0.0.  Now a degree of +-1.0 means approximately 90 degrees from the original axis.

A normal input to the pitch to go forward would be something like 0.33, meaning tilt 30 degrees forward.

Now my motors take some value between 0 and 100. Originally I thought this would mean i would have to modify my motor values like so.

```<code>c = throttle - roll + pitch + yaw
d = throttle + roll + pitch - yaw
b = throttle - roll - pitch - yaw
a = throttle + roll - pitch + yaw
</code>```

Finally, I'm taking those floating point numbers, from the IMU and computing them like with this method, which appears to be the normal way as far as I've found.

```<code>RollPId.Compute( steering.roll - gyro.roll );
// pid_t is either #define pid_t float    or double, I know its a reserved type but, a pre-processor definition will change that before it would matter.
pid_t Compute(pid_t input) {
        uint64_t now = millis();
        if( ( now - last_time ) >= sample_time ) {
            pid_t error      = set_point - input;
            error_sum        += error;
            pid_t d_error    = error - error_last;

            *output = kp * error + ki * error_sum + kd * d_error;

            error_last = error;
            last_time  = now;
        }
    }
</code>```

I don't know where to go from here? Also I have angular rate calculated from my IMU i just haven't encountered a solution that called for it.

EDIT. Below is a graph of roughly 300 readings (20ms apart) so roughly six seconds where i hold it in one hand and roll it roughly 45degrees right. with kp=1 ki=0 kd=0

答:
The forces used to control the quad act around its center of mass, causing it to pitch, roll or yaw. Changes in the roll angle are induced by contrary variation of speeds in propellers A and C. Same effect with motors B and D can produce a change in the pitch angle and you will get lateral translation.

First of all, make sure that your IMU gives you an accurate estimated angle. Have you validated these angles while motors were spinning?

Then, define the control error as the difference between the desired angular position, y_des = 0° for example, and the actual measurement at time t, y(t). The y(t) value is the one computed by your IMU so that y(t)€[-1;1]. The error equation for your roll angle will be:

E_roll(t) = roll_des - roll(t)

The input to you Roll pid controller should be the error E_roll(t). And use the output, rollPid, in your equation to adjust motor angular velocities as shown below. These speed alterations contribute to the generation of torques in each of the three axis.

a = throttle + rollpid - yawpid;

b = throttle + pitchpid + yawpid;

c = throttle - rollpid - yawpid;

d = throttle - pitchpid + yawpid;

How do you feed your pid and what does steering.roll - gyro.roll is?

From the informations provided by your model description, I don't understand how your axis are oriented in space. Use the equations above if you are using the following reference system

For more details about the pid action see this link, and this.

Hope this helps.


答:
To solve the redundancy problem, you can use the Resolved Motion Rate technique. It consist of finding the articular position using the iterative equation
$$\Delta \theta = J^\dagger T \Delta x + J^\dagger (I-T) h$$
With

$J^\dagger$ the pseudoinverse of the jacobian matrix,

$T$ the projector that defines the null space of the task to accomplish,

$\Delta x$ the difference in cartesian position between $x(t_{i-1})$ and $F(\theta(t_i))$ ($F(.)$ being the forward kinematics),

h being the opposite of the gradient of the cost function to minimize.

Typically, we have the cost function $z(\theta)$ and the inverse of the gradient $h = - \nabla z$.

You can find more information and examples on the article from Huo L. and Baron L.

Title: redundant arm path planning and trajectory following

Body:
I have a 7dof robotic arm and a set of end effector trajectories in cartesian space I need it to follow.

How do I deal with the redundancy in the arm when planning to follow these trajectories both with and without obstacle avoidance?


问:
Inverse Kinematics Constant End Effector Angle
I have a simple RRR manipulator where one motor controls the base rotation, and the other two allow movement in a plane extending forward from the base and upwards/downwards. Are there any standard ways to ensure the angle of the end effector remains constant?

My current solution uses explicit trigonometric expressions based on distance between joints, but if there is a better way to solve it to include restraints I'd be open to suggestions.

Edit

The manipulator is essentially like the image below, but with an additional base rotation. This allowed for the inverse kinematics to be simplified. As a reference here is the site http://www.hessmer.org/uploads/RobotArm/Inverse%2520Kinematics%2520for%2520Robot%2520Arm.pdf

答:
For a RRR planar manipulator, typical state variables would be $x$,$y$ and $\theta$, the two first ones being the position of the end effector in the 2D plane, and $\theta$ the orientation of the end effector.

(please note, altough in the picture the articular positions are nammed $\theta_1$, $\theta_2$ and $\theta_3$, we will here use $q_1$, $q_2$, and $q_3$ for clarity)

The expression of $\theta$ with regards to the articular positions $q_1, q_2, q_3$ is
$$\theta = q_1 + q_2 + q_3$$

To ensure kinematically that $\theta(t)=\theta_d=Cste$, $\dot{\theta}(t)=0$ and $\ddot{\theta}(t)=0$, you simply need to impose it as constant for the resolution of the inverse kinematics and its derivatives.


问:
Finding the position of a servo
I am building a collision avoidance system for my robot. As a part of this system I am using a pan and tilt kit

(http://www.robotshop.com/en/lynxmotion-pan-and-tilt-kit-aluminium2.html)

My aim is to pan the sensor attached to this kit, and thus plan the route the robot should take.

In order to pan this sensor, I need to know the angle the kit has panned, and need to be able to call upon that angle at point in time.

Basically the sensor keeps panning, and at a point in time when certain conditions are met, it stops panning. When those conditions are met, I need to be able to extract the angle the sensor is panned at.

The servo being used on is: http://www.robotshop.com/en/hitec-hs422-servo-motor.html

If someone could help me find a way to extract this information that would be helpful. I did read somewhere that the servo could be hacked and changed into a closed loop system where the effective angle would be shown, but that option is not viable.

Thanks

答:
Servos use potentiometers to get information about the output shaft position and makes the internal feedback loop. In order to retreive the servo position, you will need to open and extract the output value of the potentiometer in order to use it for your own purpose.

You will need to solder a cable to the output of the potentiometer and connect it to your own circuit. You will get an analog signal relative to the position of the servo. Position can be found using the relation

$$\theta = \theta_0 + \frac{V_{out}}{V_{max}}$$

$0 \leq \theta \leq 360°$

$V_{max}$ is the maximum voltage at the potentiometer end. Usually, it is $V_{DD}$, the voltage of the servo.

$\theta_0$ is the initial position and depends on the servo.

If used with a microcontroller, you will need an ADC input (analog input).

Title: Finding the position of a servo


问:
How do I set up a rubber hand experiment with precise latency?
The rubber hand illusion (Wikipedia) involves touching both a fake arm and a subject's real arm simultaneously. This causes the subject to feel that the fake arm belongs to him. Normally a human delivers both touches, so the timing is approximate. I want to vary the latency between the fake touch and real touch precisely (~5 ms at minimum) to probe how close they need to be to create the illusion. What can I use to touch a human and fake hand lightly at variable but precise times?</p>

答:
What you want is a real-time system. Generally, you can do this either in a standalone or a hosted environment.

Standalone, otherwise known as bare-metal, means you write your code for a specific hardware, e.g. a microcontroller. That way, you have complete control of what executes and at what intervals, so you can be very precise. You can hardly go wrong with any microcontroller for such a simple task, so just choose one you like most.

Hosted environments means programming under a real-time operating system. There are a handful of those, but of course I would advocate free software. There are a couple of extensions for Linux that can make it real-time (RTAI, Xenomai, RT-Linux and others) and you can get precisions of even microseconds, which should be enough for your task.

Setting up a real-time Linux with proper configuration can be tricky, but once done the programming is easier and debugging tools are available. On the other hand, you can start programming a microcontroller right away and if you are experienced, not much more difficult than hosted either.

In the end it's your choice. If you feel comfortable with microcontrollers, I'd recommend a standalone application for your task.


答:
To expand on Alexandre's answer:

Controlling the arm with the Jacobian along an end-effector trajectory is one way to do it.  However, this will not give you obstacle avoidance.  Although you could manually check for collisions at each time step, but i imagine this could get ugly.  Additionally, this is a gradient technique, so you will be constrained to the arm configurations close to the current one.  But if you do want to go this route, I find the notation in the book: Robotics: Modelling, Planning and Control by Bruno Siciliano, Lorenzo Sciavicco, Luigi Villani, Giuseppe Oriolo a little easier to understand / use:

$$
\dot{q}=J^{\dagger}v_{e}+(I-J^{\dagger}J)\dot{q_o}
$$
where:
$$
J^{\dagger} = J^T(JJ^T)^{-1}
$$
is the right-pseudo-inverse of the Jacobian.  (This is needed because you are under-constrained and have more joints than the 6 DoF space of end-effector motion).  There are other ways to get the pseudoinverse, but this method works well for arm Jacobians.  $J$ is obviously the Jacobian, which changes based on the arm configuration, so it is really $J(q)$, and must be recalculated when the arm moves. $v_e$ is the end-effector velocity vector.  The first three elements are the Cartesian translation velocity in the global frame, and the last three are rotational velocities.  $I$ is the identity matrix.  $\dot{q}$ is the joint velocities, and $\dot{q_o}$ are joint velocities to move the arm in its null space (again, which you have since you are under-constrained).  I have never found this very useful, so I usually zero it out which greatly simplifies the equation.

To use this formulation, you will need a linear algebra package, which there are many available, and you will also need to calculate the geometric Jacobian of your arm.  This is a topic for another question.

NOTE: I typically only use this method for small motions or when i know the arm is in no danger of collision.

To expand on my other answer:

I think the more standard way to solve this problem is to use an arm planner.  These planners will have some model of the environment which constitutes obstacles.  You give the planner start and goal arm configurations (i.e. joint angles), and it figures out how to best move the arm between them while avoiding obstacles.  Note that you will typically have start and goal end-effector poses.  and because you have a redundant arm, there are many arm configurations that can satisfy them.  So you must first do some IK and find the configuration that is best for you based on some heuristic.

Some notable arm planners / toolkits:

OpenRave - Typically Linux based, but i believe can be cross complied.

ROS MoveIt! - again, ROS is typically Linux based, but i think has some limited cross-compile support, but i am not sure about MoveIt.

Matlab Robotics Toolkit - matlab based, so works on Windows, but is not C++.

Orocos - Typically Linux based, but i believe can be cross complied.  Not sure if it has arm planning actually.

Trajopt - no Windows support

Underneath these most of these libraries is a planner such as RRT.  If you want to do planning yourself, you should check out:

OMPL

SBPL

Having said all that, answering your questions specifically:

The planner will handle the arm's redundancy without issue.  (besides increasing the search space)

There are many planner algorithms.  Too many to list here.  For example, this is the list of planners available in OMPL.   But if you use an off the shelf planner, it will output a trajectory in joint space which is easy to follow with standard control techniques.

Libraries and some "do it yourself" code listed above


问:
Numerical-Example for Paden-Kahan subproblems?
I am writing a kinematics library in Go as part of my final year project. I am working with Product of Exponentials method and have successfully implemented the Forward Kinematics part of this. I need help with the Inverse Kinematics.

I understand the theoretical aspect of it. I would like a numerical example where actual numbers are used for the Paden-Kahan subproblems as the ones dealt in "A Mathematical Introduction to Robotic Manipulation - Murray,Li and Sastry" [freely-available online PDF].

I specifically need help with knowing what should p,q be when trying to solve the inverse kinematics. The book just says given, a point p,q around the axis of rotation of the joint. But how do you know these points in practice, like when the robot is actually moving, how do you keep track of these points? For these reasons I need a numerical example to understand it.

答:
I'm working through this book right now at that particular section.

Looking at the example on page 105 / section 3.3, with the elbow manipulator, it looks like once you define appropriate points q_w and p_b, you express them in the base frame S (as is every other quantity so far from the preceeding section).

So here's what I would do. Try q_w = (0, l1+l2, l0), p_b = (0, 0, l0). Solve the full problem with these points.

Then try plugging in test thetas and end effector poses g1 to verify that the model works (i.e. compute both forward and inverse kin on sample points). I'm fairly confident that the above points are expressed in the base frame S, but feel free to do this additional testing to create a numerical example.

Hope this helps.


问:
What is the maximum payload weight for create 2/can I use old create accessories with the Create 2?
I'm attempting to build a heavy platform on the Create 2 but am worried about weight on the platform.  What is the maximum weight for the platform and is there an optimum?

I have an old create and want to know if any of my existing cables and accessories can be used with the new Create 2?

答:
Assuming that you keep the payload in the bin or near the top of the robot, 9 kg is a safe amount of max payload weight on a flat floor. Create doesn't dynamically balance, so having the weight in both a statically and a dynamically stable location is important. We've also provided files for printing a bin with a caster, in the case that you find your robot is constantly doing wheelies. :)

Almost all existing cables and accessories should be supported in both directions, as long as they use the 7-pin serial connector. One of our goals was to allow current parts and accessories to stay useful! Unfortunately, there is no 25-pin payload connector, so any accessories which used that will not work. Finally, the original Create's dock is not compatible. The good news is that the Create 2 will avoid its predecessor's dock, and we ship every Create 2 with a new-style dock.

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


问:
What is recommended prerequisite knowledge to get kid started with Create 2?
What aged children is the Create 2 appropriate for?  What is prerequisite knowledge?  Is this an appropriate first robot kit for a child?</p>

答:
The short answer is "probably not".  The long answer depends on the abilities of you and your child.

Create 2 allows you to plug the robot into a computer via USB and interact with it through serial commands.  Many 3rd parties have created interfaces for this, some of which are in Python, (for example PyRobot).  Your child may be able to handle this depending on grade level.  This is probably the lowest bar to entry.

If you take a look at the Create 2 sample projects, you should be able to get a feel for the prerequisite knowledge required for other (perhaps more interesting) projects.  For example, can your child solder and hook up an Arduino?

That being said, as a robotics scientist, my 5.5 year old son has been around robots and technology from a very young age.  I plan on doing some Create projects with him.  Although I fully expect to do all the work.


问:
How can I start learning robotics?
For someone interested in robotics but do not know the ABC of robotics or mechanical/electronic engineering .What's a good roadmap for becoming an amateur roboticist . I'm studying theoretical physics so that I have no problems on the physics/math . If the question is too broad and doesn't meet the criteria of posting on this site . Please inform me of any helpful advice/study material etc. before the question get closed .
Thanks in advance.</p>

答:
Start with basic electronics, ditch the books, start empirically do stuff. Chances are you will be bored as hell and it will be over.

Buy some cheap breadboard, LEDs transistors, buttons and see if its fun. Next buy some cheap engines and play with them. Still reading? Buy some books like "Robot Building for Beginners-David Cook" or surf the web.
Next buy Arduino Uno (the cheapest) and learn some C or Java to program it.

Then you will know enough to decide for yourself and you will spend no more than 100$ on the stuff until then.

Title: How can I start learning robotics?