问:
Is the geometric inverse problem's solution "continuous" for a redundant robot?
Let's say my redundant robot is at an operationnal position $x$. Is the set of all possible joint configuration "continuous", which would mean that it is possible to explore all the possible configurations without moving the end effector. Is there a way to show that it is true or false? I am using a Kuka LBR robot with 7 dof so maybe there is a specific answer for this one.

I have been searching it and did not find any result but I will gladly accept any link or answer that you may have.

答:
I don't know if there is a formal proof to this, but in general, no the set of all possible joint configurations that correspond to a particular end-effector pose is not continuous.  I think of the set as islands in joint space.  Where each island has some local continuous joint range, but is disconnected from the other islands.

I think there are a few reasons for this: joint limits, and kinematic limits, and physical construction.

As for joint limits, i think a good example is the "standard" robot roll-pitch-roll wrist like the LBR has.  if these joints have limits, it will not be continuous rotation, which affect the arm's ability to stay at the end-effector pose while the rest of the arm moves through its redundancy.

As for physical construction, I think a good example is thinking of a planar 3 link arm which is redundant for end-effector 2D position, (with no rotation).  For example:

For many points, you could find a way to move the joints to keep the end-effector at the same point.  But if the point is too close to the base then unless the links can pass through each other, the links will collide and prevent you from getting to the other configurations.

Lastly, as for kinematic constraints.  If you fix the end-effector at a point, you can think of the arm as a four-bar linkage.  I can't post an animated gif, but the Wikipedia page has this nice example: http://en.wikipedia.org/wiki/File:4_bar_linkage_animated.gif.  You should consider the arm to be the 3 links: AD, DC, and CB.  The base of the arm is A and the end-effector is B.  (Ignore point E and the large triangle).  Here the arm is exploring the entire local null space of redundant solutions that it can reach.  However, there are is another set of solutions that can be achieved if the arm is flipped horizontally.  (if point C is below the line between A and B.)  Clearly the arm cannot move their with the end-effector constrained to stay at B.  But it is a valid arm configuration.


问:
Udoo board + Kinect sensor?
I am wondering if it would be possible to get Kinect to work with Udoo board (Quad). I have found that there is now support for ROS + Udoo. Also saw a question asked about Xtion + Udoo which shows some more interest. It would really be great if it could be possible for Kinect+Udoo. Was hoping to implement perhaps a miniature version of TurtleBot. I wish someone could give some insights on this matter. Thanks.</p>

答:
the kinect now is working with the UDOO. I tested it in the UDOO quad.
Just follow this steps:

http://www.mariolukas.de/2015/04/proof-of-concept-3d-scanner-with-kinect-and-raspberry-pi2/

Regards

ContentLicense: CC BY-SA 3.0

Title: Udoo board + Kinect sensor?


问:
Is ROS (Robot Operating System) mandatory?
Do we have to build ROS for robotic research/application? What is the main advantage? When or in which situations ROS is mandatory?</p>

答: "ROS" is a relative term, the APM runs full custom code specifically designed for quadrocopter control where a custom ROS might be desirable to keep from crashing, on the other hand the Navio+ runs on a Linux kernel and runs code other than the autopilot, and still manages to keep from crashing. Most ROSs are really a set of functions on top of an existing OS as opposed to writing an os from the ground up. As with anything, it depends.</p>


问:
Is GMIS really a breakthrough?
The GMIS (General Machine Intelligence System) from a new article posted at codeproject.com looks interesting.  Do you think that it could be a breakthrough in the field of robotics</p>

答:
I did some work on embedding decision trees in a hash table.  That worked extremely well.  I could embed many facets of the English language into it such as context sensitive spelling, in only a few seconds, using only a few megabytes. You could also embed complex patterns of movement into it very easily.  It basically ends up as so called feature hashing.  For example in 3 dimensions (x,y,z) you would create a hash function with 3 inputs h(x,y,z). This is a form of dimensional reduction and also data compression.  I took it slightly further and feed in only a few bits of information at a time into the hash function  for even better results and better generalization.<br>
It is clear to me that you could fit everything the human mind can do into 100 Gigabytes or less.  That means that a current mid-scale supercomputer with 300 Tbytes of SDRAM has 3000 times the capacity of the human mind and is much, much faster.  A few years ago the general consensus among computer scientists was that you would see human level AI around 2020.  I would agree, however their view was based on extreme hardware requirements.  My view is that the hardware is already there, it is just a code issue. Hopefully it won't really change anything. That it will only be like adding 1 million people to the human population, in terms of increased ability to do things.   </p>

Title: Is GMIS really a breakthrough?

Body:
I did some work on embedding decision trees in a hash table.  That worked extremely well.  I could embed many facets of the English language into it such as context sensitive spelling, in only a few seconds, using only a few megabytes. You could also embed complex patterns of movement into it very easily.  It basically ends up as so called feature hashing.  For example in 3 dimensions (x,y,z) you would create a hash function with 3 inputs h(x,y,z). This is a form of dimensional reduction and also data compression.  I took it slightly further and feed in only a few bits of information at a time into the hash function  for even better results and better generalization.

It is clear to me that you could fit everything the human mind can do into 100 Gigabytes or less.  That means that a current mid-scale supercomputer with 300 Tbytes of SDRAM has 3000 times the capacity of the human mind and is much, much faster.  A few years ago the general consensus among computer scientists was that you would see human level AI around 2020.  I would agree, however their view was based on extreme hardware requirements.  My view is that the hardware is already there, it is just a code issue. Hopefully it won't really change anything. That it will only be like adding 1 million people to the human population, in terms of increased ability to do things.


问:
What would I need to control a DC servo using a 4-20ma linear analog signal?
I'm looking to find a way to operate a small servo using a 4-20ma linear analog signal generated by a PLC in an industrial setting.

The purpose of this is to allow for automation for a task that currently is done by manually turning and adjusting a potentiometer with removable dial. Basically, I'm trying to ghetto together an oldschool Motor Operated Potentiometer (MOP) so it can be removed quickly and easily without affecting the operation of the original process.

I've spent hours looking for servo controllers/encoders that are capable of this, but I haven't been able to find any. Any way I could get pointed in the right direction would be fantastic. Surely such a thing must exist!
Thanks so much!

答:
The most simple way, is to let the current run over a shunt and just use the voltage as input signal. Voltage controlled motorcontrollers exist like "sand at the sea"

Basically you loose the safety feature of the current signal to detect cable break. So far industrial application you need a more sophisticated approach. If you do not this feature anyway then you should be fine with the shunt.
I use for a similar application I use e48-127 Ohm resistors. I get output signal between 0.5 and 2.5 volts.


问:
Cheap and efficient 3D sensor?
I'm searching for a cheap (under 100$) and efficient 3D sensor, which detects obstacles and moving objects, for robot applications like quadrotor navigation, swarm robotics, etc. Can you suggest a sensor that can be either a commercial product or a "do it yourself" project?

答:
Honestly it depends what you want, I will cover some options from cheapest to most expensive

Ultrasonic sensor on a servo 5-50$ depending on the model. It can be fairly accurate with around 1cm accurcy and 255 steps on a full circle, but it can have poor performance in dusty environments and can have poor results with curved items.

Ir distance sensor, 10-100$ depending on model. More accurate than ulatrosonic sensor (around .5cm accuracy). Preforms better with round objects, sensitive to dust, but can be placed in clear enclosures to protect them.

1d lidar/laser raingefinder on servo, 80-300$ some examples they work over longer ranges and collect data faster potentially allowing two axis collection to get a "3d" point cloud, but are more expensive and will require a more sophisticated controller to take advantage of them.

inexpensive 2d lidar sensor (possibly on a servo for 3d capture) example alloes for true 2d capture and can be moved up and down to allow for a 3d point cloud, more expensive and required even more procssing power probably no less than a Raspberry Pi or Intel Edison

Stereoscopic cameras, 400$+ my favorite is the ZED these provide "true" 3d and can be fairly accurate at around 10 centimeters but give you a real 3d point cloud in addition to being cameras that you can use to do object recognition and detection on, the only problem is that they require significant horsepower no less than an Nvidia k1 which could restrict some mobile applications

True LIDAR sensors, 1000$+ allowing for very robust 2d point clouds  example and are designed to be oscillated up and down to provide full 3d mapping, they can ve very expense up to 10k+ and will require an embedded computer to run

True 3d LIDAR sensors, 50,000$+ dollars are very accurate and can provide immense amounts of data but are very expensive heavy and require lots of processing power in order to use

If you provide more specifics on your application I can give a more specific answer.

Title: Cheap and efficient 3D sensor?


问:
Need suggestion about which microcontroller/processor and language to be used in my project
I am very new to robotics. but I will be writing algorithm for my robot to move around and gather information from its surroundings and process it. It will also process audio-visual signals. but I am in confusion about which micro-controller to use so it would be performance efficient and consumes less power.

The controller should also be capable of communication with wireless network (internet through wi-fi) and should also support memory integration.

Also I know to program in Java and C. please suggest which would be the best language to use for programming.

Thanks.

P.S. I would really like to use a microprocessor as it is highly customizable. Please suggest the best to use

答: It sounds like you are the perfect candidate for the Raspberry PI! It is an awesome microcomputer that can do plenty of things, has a great community of support and tons of add on boards that can do everything you might need including driving motors for a robot</p>


问:
Using 20 Servos at once, with raspberry pi
I have recently been asked to review a raspberry pi hat (from a programming view) that will allow PWM control of upto 16 servos, however I am hoping to use this time to work on a hexapod idea I have been thinking about for a while, which requires a minimum of 18 servo's, and preferably 20 (camera/sensor pan and tilt).

My question is:

What is a relatively cheap and uncomplicated way of extending my control over those extra 4 servo's?

It would appear most servo controller hat/shiels for arduino and raspi are upto 16 servos, and can be extended by buying another shield, are there any other options?

Any advice in this subject would be greatly appreciated, preferably dumbed down a bit, and I don't know a great deal about micro controller hardware (more of a software guy)

答: I would suggest something like the adafruit Adafruit 16-Channel PWM / Servo HAT for Raspberry Pi You can stack as many as you want to get as many outputs as you need.</p>


问:
Beginner question about software for calculations
I'm a complete beginner in robotics with background in programming...

I started thinking about a robot project yesterday and want to order some motors to test with. I saw the specs for the motors, torque etc, and I think I remember enough physics from high school to do simple calculations. For example, if the motor rotates an arm, then given the torque and the length of the arm, how much could it lift? Also, if it doesn't lift it straight up, but at an angle, I could with a bit of thinking tweak the calculations a bit... If there would be several joints attached to each other, the calculations would be more complex, but I could then probably create a program in node.js, for example, to be able to experiment with different values.

However, I would assume that these kinds of calculations would be very common when designing robots. So I would assume there are already programs for these types of calculations created. I don't know exactly what I mean with "these types of calculations", because I don't know yet what I don't know, so would like to ask which programs are there that you guys use for making calculations when you design your robots?

Preferable they should be open source...

答: For your first example, Max-Weight = Torque/arm-length. Going beyond that, there are several software applications and API's out there that can be a big help for these kinds of calculations (matlab or pyODE to name a couple), but they will be pretty useless without a decent understanding of what you are computing. A good resource to learn about the mechanics involved can be found here. Check out the Statics link on the left for details on the physics of forces, and then check out the Dynamics link to learn how the forces correlate to motion.


问:
How feasible is the idea of operating a robotic arm in a non-sophisticated way?
I and my team have to design a robot using an arduino chip. The objective of the robot is to grab golf balls at a set of golf pins at different heights and pre-defined locations. We couldn't figure out a possible mechanism that could collect the balls and drop them into the trailer except for a robot arm. However, we don't have experience and time in designing a sophisticated system for the arm like recognizing where the ball is and then grabbing it accordingly. What would a feasible option be compared to a non-sophisticated  robot arm?

Note:The robot must be autonomous.

答:
While I still like the rake idea, parallel slots wider than the support pegs, I worry it would push the pink ball instead of retrieve it.

My second thought is a simple suction device that retrieves the balls and drops them into a funnel in the bot. Though there might be concerns with the mass of a golf ball.

Collect all 6 without worrying about the fencing.
Travel to the smallest hole, open the gate on the funnel and let them pour.

Sensors:
Golf ball detection to direct the suction. (Chroma?Known Ball Color, Shape?Round, Dead Reckoning?Known positions)

Finding the target hole, positioning the funnel output over the hole
Fall back to a lower value hold if timer is running too low.


问:
What algorithm can I use for constructing a map of an explored area using a number of ultrasound sensors?
Ultrasound sensors are incredibly cheap these days which makes them a popular choice for many hobbyist robotic applications, and I'd like to use a bunch of them (say 10) around a robot with an algorithm to build a rough map of an area (as the robot explores it.) I'm not interested in dealing with moving objects at this stage, just pinpointing stationary ones, and I'll be using GPS for location. I realise that other components such as a laser scanner would produce much more accurate results, however such devices are also astronomically more expensive.

Does an algorithm exist for this purpose?

答:
There is a whole area of literature on this topic. The most general idea is that of Simultaneous Localization and Mapping (SLAM), where the robot must build a map at the same time as it locating itself in that map. Depending on how accurate you want your maps to be, you can attempt a simpler problem of creating an occupancy grid map, which assumes you know the location of the robot.

In general, GPS is pretty horrible, so generating an occupancy grid just using GPS as your primary location source will generate pretty fuzzy maps. However, it is possible to integrate GPS with acceleration, gyroscopes, compasses, cameras, wheel encoders and other sensors to approximate a good position in the world. Otherwise, you will need to look into a simple SLAM system to handle your problems.

A nice open-source package g2o, for so-called GraphSLAM, allows you to put in constraints like GPS and relative position to walls. It may not be an exact fit, but it is pretty general.


答:
For most applications, I think the calculation you describe is good enough when selecting hardware.  You want your arm to be able to have some lift capacity at the worst case, which is when the arm is fully extended.  Note that you should also take into account the weight of the arm itself which is typically non-negligible.

That being said, yes, there are fancy ways to do this math.  The arm's Jacobian is a matrix that relates joint velocities $\dot{q}$ to end-effector velocity $v_e$ .  Note that the Jacobian itself is a function of the current joint angles $q$:
$$
v_e = J(q)\dot{q}
$$
It should come as no surprise that the concepts of force and velocity are linked.  In fact, they are orthogonal.  This is called the kineto-statics duality.  This image shows a planar 2 link arm at a number of different configurations.  At each configuration, the velocity manipulability ellipsoid is shown.  The arm can move quickly where the ellipse is long.  There is also a force manipulability ellipsoid (not shown) that is the same except rotated 90 degrees.  In the force manipulability ellipsoid, the arm is strong (and slow) where the ellipse is long.

The Jacobian can represent this too:
$$
\tau=J^T(q)\gamma_e
$$

Where $\tau$ is the vector of joint torques, and $\gamma_e$ is the end-effector forces.

Calculating the Jacobian is beyond the scope of this thread.  You should get yourself a good textbook or robotics software library to help.  (Searching around on this site should provide some good starting points).

Also, this page seems to have a good discussion of manipulability ellipsoids.

Title: Beginner question about software for calculations

Body:
I'm a complete beginner in robotics with background in programming...

I started thinking about a robot project yesterday and want to order some motors to test with. I saw the specs for the motors, torque etc, and I think I remember enough physics from high school to do simple calculations. For example, if the motor rotates an arm, then given the torque and the length of the arm, how much could it lift? Also, if it doesn't lift it straight up, but at an angle, I could with a bit of thinking tweak the calculations a bit... If there would be several joints attached to each other, the calculations would be more complex, but I could then probably create a program in node.js, for example, to be able to experiment with different values.

However, I would assume that these kinds of calculations would be very common when designing robots. So I would assume there are already programs for these types of calculations created. I don't know exactly what I mean with "these types of calculations", because I don't know yet what I don't know, so would like to ask which programs are there that you guys use for making calculations when you design your robots?

Preferable they should be open source...


问:
STM32F3 timers & computing
I have an STM32F3 discovery board. I want to go to the next step and I want to try to use timers in a few configurations.

How can I calculate variables (such as prescaler, period)? I looked in all datasheets, manuals and didn't find anything that can describe these values as  - Input capture mode, OP, PWM, etc.

I think that prescaler is for downgrading a frequency from 1-65575.

So if I have fcpu=72MHz and want to generate a signal of frequency=40kHz, am I supposed to do: 72MHz/40kHz=1800?

Now should I subtract this prescaler with -1?

答:
http://www.st.com/web/en/resource/technical/document/datasheet/DM00058181.pdf

Let's use this datasheet as an example.
Page 18 holds what is known as the clock tree. It shows with what frequency every component ticks with. So let's try following it.
You have your crystal oscillator working on some frequency (or some internal clock). You multiply it by PLL multiplication factor. PLL is used to make a higher frequency signal from a lower one. You then divide by AHB prescaler. You then divide by APB1 or APB2 prescaler (depending on which timer you're using) and then multiply by 2 if APB prescaler is something other than 1. What we have now is the clock timer module "sees". Now it divides that clock with timer prescaler and it increments (or decrements) the counter with that frequency. Once it reaches a set point it will throw the interrupt.

AHB and APB registers are usually set in the project settings of your programming environment. For timer prescaler register refer to the datasheet of your MCU.

Title: STM32F3 timers & computing


问:
Education sources for robot building?
I teach FTC robotics to high school students, and while I'm a proficient programmer and can teach them coding fairly well, my mechanical skills are a bit soft.  I'm looking for good sources for myself and the students to go through that gets a little more in depth than "this is a gear, this is a chain, this is gear ratio, etc.," but maybe not quite the level of building professional / industrial robots.

I've used the Vex Robotics Curriculum as a starting reference - http://curriculum.vexrobotics.com/curriculum - but it doesn't go through some more advanced topics (for example, how to drive a single gear / drive shaft with multiple motors to achieve more power without having to gear down and lose speed.)

Are there any good intermediate sources like this?  Do I need to just bit the bullet and get a college level mechanics text?

答:
I feel that depending on the student's level of knowledge on entry to your program, the VEX curriculum might be sufficient, as it goes in depth on how torque is applied, systems with mutabal gears etc. I don't necessarily think that directly teaching concepts like

how to drive a single gear / drive shaft with multiple motors to achieve more power without having to gear down and lose speed

as they can be inferred from the sections on compound gears, and torque. The VEX curriculum also goes in depth on systems building and integration, in my opinion much more useful and basic concepts that can be hard to master in high school, especially when building the elements separately and then integrating them i.e. having a team build the drive and another building the actuator, This opposed to having the group just "build it" which inevitably leads to a very small group of people dominating the process .

Title: Education sources for robot building?


问:
Can a Jacobian matrix be used to derive joint angles from end-effector linear and rotational velocity (without a filter)?
I have a 2-link, 2 degree of freedom robotic arm, that only measures linear acceleration at each link(through an accelerometer), and rotational velocity on each joint (through a gyroscope).

I know that through using the Jacobian matrix, I can compute link velocity and acceleration from joint angles, and through the inverse of the matrix I can compute joint velocities from joint angles and link acceleration.

However, I am not sure if I can compute joint angles using only the link linear and rotational acceleration? I am aware that the joint angle could be estimated by integrating the joint velocities (and applying some sort of filter), but is there an algebraic way this can be computed? It doesn't seem likely to me.

答:
Joint angles can be determined by looking at the gravity vector of each accelerometer.

The paper Low-cost Accelerometers for Robotic Manipulator Perception by Morgan Quigley, Reuben Brewer, Sai P. Soundararaj, Vijay Pradeep, Quoc Le, and Andrew Y. Ng describes exactly what you are attempting to accomplish.


答: I'm using Springer Handbook of Robotics written by Bruno Siciliano (Editor) is a great source and I think easy to understand. It includes almost all contents about robotics. Also you can look video courses from coursera and edx

Title: Education sources for robot building?

Body:
I teach FTC robotics to high school students, and while I'm a proficient programmer and can teach them coding fairly well, my mechanical skills are a bit soft.  I'm looking for good sources for myself and the students to go through that gets a little more in depth than "this is a gear, this is a chain, this is gear ratio, etc.," but maybe not quite the level of building professional / industrial robots.

I've used the Vex Robotics Curriculum as a starting reference - http://curriculum.vexrobotics.com/curriculum - but it doesn't go through some more advanced topics (for example, how to drive a single gear / drive shaft with multiple motors to achieve more power without having to gear down and lose speed.)

Are there any good intermediate sources like this?  Do I need to just bit the bullet and get a college level mechanics text?


答:
Raspberry Pi 2 will give you lot of options to play with in robotics field, ardunio would be nice addon with it. Another nice option would be ODROID , you can setup it up with ROS.
Now regarding the language, C would be good.</p>

Title: Need suggestion about which microcontroller/processor and language to be used in my project

Body:
I am very new to robotics. but I will be writing algorithm for my robot to move around and gather information from its surroundings and process it. It will also process audio-visual signals. but I am in confusion about which micro-controller to use so it would be performance efficient and consumes less power.

The controller should also be capable of communication with wireless network (internet through wi-fi) and should also support memory integration.

Also I know to program in Java and C. please suggest which would be the best language to use for programming.

Thanks.

P.S. I would really like to use a microprocessor as it is highly customizable. Please suggest the best to use


问:
Building my first quadcopter
I am trying to build a quadcopter from scratch. I have selected few parts but I have no idea whether the quadcopter will come together and fly.

I would appreciate your feedback on whether the parts I have selected are compatible (UBEC, Motor). If not, I would appreciate suggestions.

The frame for my quadcopter is in the X configuration and I am making my own. I am expecting the average weight of the quad to be around 800g. I hope the motors and prop combination can hover it well.

答:
So generally for Quadcopter design you want the hover throttle (the point where the weight is balanced with the thrust produced) should be 50%. So if you look at the product page for the motor you posted you will see some measured thrust values

10x4.7 - 11.1v - 21A - 1150g Thrust

9050 - 11.1v - 18A - 900g Thrust

1060 (3 blade) - 11.1v - 23A - 1200g Thrust

with a 9x4.5 prop  your going to get a hair less than the rated thrust for a 9050 (9x5) prop, with four motors you will probably get around 3000g of thrust or, based on a 800g frame a 26% hover throttle, as you can see the motor is capping out at 18A meaning you could go with a 20A esc to save weight. This data is based on a 3s battery so with a hover current draw of 18A*4*.26=18.7A you could get around 7mins of flight time with a 2.2Ah battery (2.2Ah/18.75A)

4 x motors 304g

4 x props 36g

4 x 30A esc 128g

1 x 2.2Ah 3S battery 163g

this is already 632g pretty close to 800g this is without a flight controller or misc connectors receiver frame etc... is it possible? yes but expect it to be a little heavier.

Title: Building my first quadcopter


问:
How can computer vision distinguish one object being contained by another vs being on top of it?
How do we know that an object is contained inside another object or is just lying on top of it?

Lets take an example of a cup-plate-spoon. The cup is lying on top of the plate. But the spoon is inside the cup. How do we distinguish between the 2 situations? What are the criteria to decide whether A is contained inside B or just lying above B?

I am trying to solve it using kinect.

答:
Actually we don't. This is the source of myriad visual illusions. Through a life time of experience we learn context which tells us when one thing can be on another vs. in it. But even then a sculpture can be built to trick us. For example it can look like a plate, cup, and spoon organized in a certain way but in fact be non of the above. A good example of this are the 3D printed Escher pieces.

The Kinect has the added ability to sense depth. With such information you may be able to make better determinations but we can still conceive of structures that would trick the system. I cannot speak to what CV methods exist to assist in your endeavor but I know that Deep Learning from the ML world has been making inroads here.


问:
recommendation of robot for special education
I saw a video of a robot used in special education with children on the autism spectrum (https://www.youtube.com/watch?v=FQcjfebQXgQ).  My son isn't autistic, he has Tourette Syndrome, ADHD, executive function problems, and OCD.  A robot could be quite helpful for him.  Where can I buy one?  I don't need it to look like a human being.  It just needs to be interactive and reasonable cute.  As my son is getting ready for bed, he needs someone to talk him through his steps, give him positive feedback, and ask questions like "Okay, you're in your pajamas.  Great!  What else do you need to do to get ready for bed?"  And the robot would have a mental list (preprogrammed) of everything that's needed (brush teeth, wash face, put on eczema ointment, put dirty clothes in hamper).  My son is 12 and would like to get ready by himself -- without Mama or Papa -- but he gets sidetracked when he's in his room on his own.  The robot doesn't need to be able to "see" him brushing his teeth.  He just needs to be able to hear my son saying, "I brushed my teeth."  Because when the two of them together decide he has made it through his routine, then they can call me in, and I'll check, and then we'll do our bedtime reading.

That's an example of what I have in mind.  There are other situations where I could imagine a robot being helpful for him.

答: Honestly, this would be extremely complex to program and I am not aware of any off the shelf solutions. Somewhere you might start is using somthing like jasper to implment some simple procudures, you could even put it along with its microphone and speaker in a cute case.</p>


答:
Books

FIRST and VEX are fairly large competitions, so it should come as no surprise that people have literally written books on how to participate.  My favorite book aimed at FTC is FTC Robotics: Tips, Tricks, Strategies, and Secrets.  They've made several editions of this book; although it's not a structured curriculum, it is a great guide and a must have for a team.

If you're looking for inspiration, but not necessarily a guidebook, the FIRST Robotics: Behind the Design books (editions for Aim High and Rack 'N' Roll), which document the designs of world-championship bots from those years.  It's not detailed enough of a description to copy their work, per se, but they do present some very interesting concepts.

Some non-FTC/VEX specific books can be helpful, too.  For instance, I found Building Robot Drive Trains to be a helpful book, and should be reachable by any highschooler with a working knowledge of trig.  A detailed-but-good book is Constructing Robot Bases that describes different methods of chassis construction.  Some of it is not so applicable because it assumes you have access to any and all materials.

Online Curriculum/Classes

You've already found the VEX curriculum; another great resource are the CMU curricula.  Since I'm VEX-centric, I know about the Cortex Video Trainer.  I'm sure there's something similar for the TETRIX platform.

Another answer mentioned Coursera's Control of Mobile Robotics course from Georgia Tech.  This is an incredible course (I took it my senior year in high school, and have actually met the professor who created it), but a working knowledge of the basics of differential equations is pretty much a requirement to understand all of it... so that's most likely out of reach of most high schoolers.  Some of the early videos could be helpful to your programmers, but it doesn't discuss construction/design at all.  I can't speak to the edx course (I haven't taken it, but might now that I've heard of it), but I'd assume it's probably in the same vein of prerequisites.

Team Websites

One of the best ways to learn how to build competition robots is to read blogs and websites made by competitors.  For a taste of blatant self-promotion, my team's website has a series of tutorials on how to certain VEX components.  Xander Soldaat's blog, BotBench, is the source for a lot of ROBOTC related content.  Find out who won the World Championships for FTC last year, and look up their websites; the best teams often share their secrets.

Title: Education sources for robot building?


问:
What are the different ways to control distance to be covered by a robot?
I want to move a robot to a certain distance say 1 meter.
What are the different ways that i can implement to do so?
For example I can measure the circumference of the wheel and assign time of rotation to move it. what are other techniques to achieve this?</p>

答:
There are far too many to list them all here but I can list the most common ones:

As you said base the movement off the motor RPM, and the diameter of the wheels and move for a period of time. This is not normally very accurate and can result in the robot "leaning" one way or another.

Use potentiometers to directly measure the wheel rotation and bring the robot to a halt when the desired distance is reached, this can be more accurate

Measure an external reference with somthing e.g. ultrasonic sensor, camera, lidar etc. this can have varying degrees of accuracy depending on the specific setups but can be very good

Use an optical flow sensor to measure the ground movement under you e.g. laser mouse sensor , this can have varying degrees of accuracy but generally very good

Use a ball mouse in the same fashion, generally less accurate, and needs a very flat smooth surface.

What specific application do you have in mind?


问:
Quadruped Learning Simulator
I'm currently building a robot with four legs (quadruped), 3 DOF (Degrees of Freedom) and Its been suggested here that I use a simulator to do the learning on a computer and then upload the algorithms to the robot. I'm using an Arduino Uno for the robot and what software could I use to simulate the learning and then be able to upload to the Arduino board?</p>

答:
Gazebo is a good tool for what you want to do. Since you're using a custom robot you will need to build a model for the simulator to use. They have managed to make doing so pretty easy but for a quadraped I can imagine it will take a bit of time.

Gazebo is also nice because it works well with ROS which means that if you build you could build a program to control your robot and send the commands to the simulated robot via the integration or to the real robot via rosserial. Just beware that if you have not used any of these tools then it will take some time to develop your solution.

Title: Quadruped Learning Simulator


问:
Is ROS (Robot Operating System) mandatory?
Do we have to build ROS for robotic research/application? What is the main advantage? When or in which situations ROS is mandatory?</p>

答:
I'm back to a computer!

Like I said in this comment, ROS is generally not mandatory. ROS is one platform among many, famous mostly due to Willow Garage giving away free robots at some point in time to whoever wrote the most ROS modules. That said, it's not the best platform possible, and is certainly nothing overly special. Particularly, the said contest resulted in a lot of low-quality modules just to get the numbers higher.

Over time, the quality of the ROS modules have got better and there are a lot of them as well. Using ROS therefore, you have the benefit of reusing a lot of what's already done. You can read here some reasons why you may want to use ROS.

With that in mind, you should look out for the side effects as well.

Distributed Control

With ROS, you have many nodes that talk with each other through the network. This is sometimes good and easy, but generally results in a wildly varying delay in reception of messages. As a result, you would have to have a large control delay to make sure all messages arrive, which means you cannot react fast to events, which in turn means you have to move your robot at slower speeds so as not to miss those events.

Believe it or not, people actually do robot control through ROS (MoveIt! is the name of the relevant set of components). Slow. Unsafe. But easy!

Non-Real-time

Even when not distributed, ROS is not a real-time platform. That means you are at complete discretion of the Linux kernel to schedule your tasks at any time it sees fit. This is ok for some applications, but not ok for others. So you need to look at your own requirements. Do you need to have a guarantee that your task would finish within a known time frame? If so, you need a real-time system.

Hosted Runtime Environment

Another point to consider is that, while ROS is a general protocol of communication, it's essentially only supported for hosted environments. Hosted means the code runs on top of a kernel, as opposed to freestanding which means the code directly controls the hardware (e.g., on a microcontroller).

If your robotics application is run close to hardware, and therefore you would require a program that runs on a microcontroller, ROS is of no help to you.

Platform Lock-in

Last but not least, developing for ROS results in a platform lock-in. This means that if in the future, for one reason or another, you decide to base your work on another robotic platform, such as OROCOS, YARP, etc, that would be excruciating.

You would also be somewhat locked to Linux. Linux is the best, no doubt, but one day you may end up having to support another system, such as QNX, VxWorks etc, and you would have problems there as well.

If you are writing for microcontrollers, then forget about ROS. If you are writing high-level modules, I highly recommend writing portable code. For example, say you have developed a new sensor, and you want to write a module that acquires data from this sensor, which is connected to your computer via the CAN bus.

What you could do in this situation is to write an independent library, with functions that are able to work with your sensor and acquire data. You could even think of spawning a thread in the library that acquires and enqueues data periodically.

Once you have this helper library, you are free to write a CLI, GUI, ROS module, OROCOS module, YARP module, connect to Matlab, or whatever else you want to use to interact with your sensor.

Final note: what I've said here is generally applicable to all robotics platforms and not just ROS.


问:
What is the difference between Positioning and Localization Systems
I would like to know what are the differences between Positioning and Localization Systems. In most review papers they are used interchangeably. Are they the same?
 For example:
GPS(Global Positioning system): gives coordinates of receiver and
SLAM(Simultaneous localization and mapping): constructing or updating a map of an unknown environment

Is difference :

Positioning: only gives information about receiver coordinates.No information about enviorement

Localization: gives information about receiver coordinates and also enviorement. positioning is a subtopic of localization

答:
In my opinion, the main difference is :

Positioning : gives information about the robot coordinates. It gives raw data that you can use.

Localization : it is the process of the robot (or other actor) locating itself (or the robot) on the map. Here a "method is applied" to locate the robot.

Positioning gives you the coordinates. Localization is determining the place of those coordinate on the map.

Most of the time the difference boil down to "do you have the position information directly available" (positioning) or "do you need to determine it on a map using other data you got" (localization).

Bear in mind that it is very often context dependent and that the two terms are nowadays used with very similar meaning. See this link for more info.


问:
What servos does this robot use?
Well, I wanted to use some very small servos for a project and the smallest I could find there these:
https://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=33401

But Danny Choo (a Japanese blogger) started a business with robotic dolls some time ago and I remember him mentioning somewhere on his site that he uses servos in his dolls.

(also this pic, containing doll nudity: https://farm4.staticflickr.com/3889/14502508165_fde682636b_o.jpg)

This is about 60cm in height and therefore the servo in my first link is obviously too big, to e.g. fit inside the arm.

I was wondering what kind of servo(or motor in general if it's not a servo in the end) he is using that is so tiny it can fit in there.

Does anyone here have any idea?

答:
I'm currently building an humanoid and I was starting from a ball join base so, I have done a lot a research onn how to mechanise them until I found Danny Choo who give us a brilliant couple of solution. So I do the exact same things than you and Danny Choo

I source the majority of my components from aliexpress since there is a lot for an humanoid. And I found that tiny motors for a ridiculous amount of cost.

that is what you are looking for, for the arm :

http://fr.aliexpress.com/item/10PCS-DC-3V-6V-9V-micro-Planetary-gear-motor-Variable-Speed-Gearmotor-micro/32239559111.html

some other results here

http://fr.aliexpress.com/w/wholesale-planetary.html?initiative_id=SB_20150511024702&site=fra&groupsort=1&SortType=price_asc&shipCountry=fr&SearchText=planetary

http://fr.aliexpress.com/w/wholesale-planetary.html?initiative_id=SB_20150511024702&site=fra&groupsort=1&SortType=price_asc&shipCountry=fr&SearchText=planetary

Solarbotic is really expensive, too much, the prices are insane, I never bought anythings to that seller for that reason.
you rather try aliexpress and buy your items directly from china where it is build, you could experiments some huge delay as the goods travel by boat. be aware of exchanges taxes shipping cost etc...

Keep in mind that you should add some postion sensor and electronic and programming to have a working servo. you should apreciate that :

http://fr.aliexpress.com/item/Plastic-motor-crown-gear-white-eleven-kinds-of-standard-module-0-5-for-DIY/32229478401.html

I didn't found a sensor to do the job yet.
before buying try to know how much tork you need and how much you'll get from the motor.

Title: What servos does this robot use?


问:
Are there working instances of Kilobot projects?
The interesting Kilobot project from Harvard for investigating multi-robot behavior with masses of small dumb robots has been made open hardware for a year now.

However I cannot find so much activity about robot creation and movies about results. Is it too hard to create the robots, the programmer, the charger or isn't the project interesting enough?

答: It appears that Nikolaus Correll at CU-Boulder is doing research with a derivative of the kilobots: http://www.colorado.edu/news/releases/2012/12/14/cu-boulder-team-develops-swarm-pingpong-ball-sized-robots</p>


问:
Issue with multiple bytes from Irobot Create 2
I was having problems reading sensor information from my Irobot Create 2 and sent an email asking for help from the Irobot staff. They were super helpful and gave me an answer(the next day!!!) that helped push along my project. I was requesting data from the create2 to print to the screen so I could figure out how to write a code that would read the data. I started with this section of code that was not working for me (I trimmed some of the code off that controlled other functions):

```<code>from Tkinter import *
from subprocess import call
import datetime
import serial
import ttk
import struct
import thread

port = '/dev/ttyUSB0' #sets the com port for Atlas
baud = 115200 #sets the baud rate
connection = serial.Serial(port, baud) #starts the serial communication

#program to read communication from create2
def program2(threadName):
    while True:
        x = connection.read()
        print x

#program to write to create2
def program1(threadName):
    atlas = Tk() #starts a new GUI for atlas control
    atlas.geometry('1000x500') #sets the size of the control window
    atlas.title('Atlas Control Panal') #sets the name of the control window

    def sendCommandASCII(command):#used to send a command to the create2
    cmd = ""
    for v in command.split():
        cmd += chr(int(v))

    sendCommandRaw(cmd)

    def sendCommandRaw(command):#used to send a command to the create2
    global connection

    try:
        if connection is not None:
            connection.write(command)
        else:
            tkMessageBox.showerror('Not connected!', 'Not connected to a robot!')
            print "Not connected."
    except serial.SerialException:
        print "Lost connection"
        tkMessageBox.showinfo('Uh-oh', "Lost connection to the robot!")
        connection = None

    def test():#sets a test command up to check connection
        global buttonpress
        buttonpress='test'
        sendCommandASCII('142 7')

    #makes a button on the GUI that starts the test command
    button1 = Button(atlas, text = 'test mode', command=test)
    button1.place(x=600, y=400)
    button1.config(width=10, height=5)

    atlas.mainloop() #runs the GUI as a loop to keep the window open.

#runs the read and the write program at the same time
try:
    thread.start_new_thread(program1, ("program1",))
    thread.start_new_thread(program2, ("program2",))
except Exception, e:
    print str(e)
</code>```

They told me that the code was actually working fine but I was trying to print out the value of the sensor packet without parsing it in any way. They then recommended I change the code in program2 to this:

```<code>while True:

    def toHexFromByte(val):
        return hex(ord(val))[2:}.rjust(2, '0').upper()

    x = connection.read()
    for b in x:
        print toHexFromByte(b)
</code>```

this works beautifully and prints to the screen if the bumper is pressed or a wheel drops. My question is how to deal with responses that are longer than one byte (ie Packet ID: 22 for voltage)?

When I try Packet ID: 22 it prints to screen and it sends the high byte of 3F and a low byte of D7. I can manually combine them to get 3FD7 and convert it to a decimal of 16.343 Volts but I would like to figure a way to print to screen the the voltage by having my program do this for me. Many of the sensors send data in 2 bytes and I need a way to make sure that it is combined automatically.

Robb

答:
Many of the sensors send data in 2 bytes and I need a way to make sure that it is combined automatically.

Robb,

I have been working on a project and have faced a similar problem. The best way that I have found to combine individual bytes has been to use bit shifting to concatenate the bytes into a single variable.

I am using Arduino to interface with the Create 2, and I am trying to work with the encoder counts of each wheel, which are two bytes signed. I load an integer array with the bytes individually, and then, I join them as follows:

```<code>right_encoder=(array[0] << 8)|(array[1]);
</code>```

array[0] is the high byte, and array[1] is the low byte. The bit shifting shifts the high byte by 8 bits, which makes room for the low byte. The low byte is then 'or'ed with the shifted high byte, which finalizes the concatenation.

Obviously, the syntax will look different for you, but the idea is the same.

Body:
Many of the sensors send data in 2 bytes and I need a way to make sure that it is combined automatically.

Robb,

I have been working on a project and have faced a similar problem. The best way that I have found to combine individual bytes has been to use bit shifting to concatenate the bytes into a single variable.

I am using Arduino to interface with the Create 2, and I am trying to work with the encoder counts of each wheel, which are two bytes signed. I load an integer array with the bytes individually, and then, I join them as follows:

right_encoder=(array[0] << 8)|(array[1]);

array[0] is the high byte, and array[1] is the low byte. The bit shifting shifts the high byte by 8 bits, which makes room for the low byte. The low byte is then 'or'ed with the shifted high byte, which finalizes the concatenation.

Obviously, the syntax will look different for you, but the idea is the same.


答:
The program shown below illustrates two ways of determining result size, and a method that reads the right number of bytes to combine.

The first method suggested in the program below is to define singleSet, a set containing the packet numbers of sensors that return single-byte results.  [The function resultSize() as shown uses return ord(sizesList[sensor]) - ord('0'); a method depending on singleSet would instead say return 1 if sensor in singleSet else 2.

The second method shown is slightly more adaptable than the first, and if extended would allow treatment of large packets #0-#6.  With a bit more work it could accomodate packets #100-#107.

Here is the output from the program:

```<code> 7  8  9 10 11 12 13 14 15 16 17 18 21 24 32 34 35 36 37 38 45 52 53 58
 1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1

 0  1  2  3  4  5  6 19 20 22 23 25 26 27 28 29 30 31 33 39 40 41 42 43 44 46 47 48 49 50 51 54 55 56 57
26 10  6 10 14 12 52  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2

 1  16      54  0x36         54.000
 1  17      71  0x47         71.000
 1  18      88  0x58         88.000
 2  19   27002  0x697a    27002.000
 2  20   35740  0x8b9c    35740.000
 1  21     173  0xad        173.000
 2  22   48847  0xbecf       48.847
 2  23   57585  0xe0f1       57.585
 1  24       3  0x3           3.000
 2  25    5157  0x1425        5.157
 2  26   13895  0x3647       13.895
 2  27   22633  0x5869    22633.000
</code>```

Here is the program itself.  Replace the call to dummy routine connectionread() with your connection.read() call.

```<code>#!/usr/bin/env python
# re: Combining bytes from Create2 sensor inputs
# http://robotics.stackexchange.com/questions/7219/issue-with-multiple-bytes-from-irobot-create-2

singleSet = set((7,8,9,10,11,12,13,14,15,16,17,18,21,24,
                 32,34,35,36,37,38,45,52,53,58))

sizesList = 'J:6:><d1111111111112212212222222121111122222212222221122221'

def resultSize(sensor):
    if sensor < 59:       # Sensor groups > 58 not handled
        return ord(sizesList[sensor]) - ord('0')
    else: return -1

# The next 11 lines print debugging / demo  output
for i in singleSet:  print '{:>2}'.format(i),
print
for i in singleSet:  print '{:>2}'.format(sizesList[i]),
print; print

for i in range(len(sizesList)):
    if i not in singleSet: print '{:>2}'.format(i),
print
for i in range(len(sizesList)):
    if i not in singleSet: print '{:>2}'.format(resultSize(i)),
print; print

# Routine to scale a sensor result and return real result
def scaleResult(sensor, r):
    if sensor in (22,23,25,26,54,55,56,57):
        return r/1000.0
    else:
        return r

# Dummy routine in place of connection.read()
crv = 37
def connectionread():
    global crv;
    crv = (crv+17)%255
    return crv

# Routine to query a sensor, read one or two bytes, and return result
def readResult(sensor):
    if 6 < sensor < 59:         # Work on basic sensors, not groups
        valu = 0
        for i in range(resultSize(sensor)):
            valu = (valu<<8) | connectionread()
        return valu
    else:
        return -1

# Some test cases
for i in range(16,28):
    r = readResult(i)
    print '{:>2} {:>3} {:>7}  {:8}  {:9.3f}'.format(resultSize(i), i, r, hex(r), scaleResult(i, r))
</code>```

There are of course dozens of ways to address the issue, and the two shown above are two of the simpler ones.  If you are going to create a large software suite, you might instead use a more sophisticated approach, in which you would set up a record for each kind of packet, with each record containing packet number and name, some brief id, size, scale, and units.  For example, packet 25 would have a record like (25, 'Battery Charge', 'B_Ch', 2, 1000m 'Ah').  Records would be stored in a dict indexed by packet number.  Records could also include group-packets membership information.

Title: Issue with multiple bytes from Irobot Create 2

Body:
I was having problems reading sensor information from my Irobot Create 2 and sent an email asking for help from the Irobot staff. They were super helpful and gave me an answer(the next day!!!) that helped push along my project. I was requesting data from the create2 to print to the screen so I could figure out how to write a code that would read the data. I started with this section of code that was not working for me (I trimmed some of the code off that controlled other functions):

```<code>from Tkinter import *
from subprocess import call
import datetime
import serial
import ttk
import struct
import thread

port = '/dev/ttyUSB0' #sets the com port for Atlas
baud = 115200 #sets the baud rate
connection = serial.Serial(port, baud) #starts the serial communication

#program to read communication from create2
def program2(threadName):
    while True:
        x = connection.read()
        print x

#program to write to create2
def program1(threadName):
    atlas = Tk() #starts a new GUI for atlas control
    atlas.geometry('1000x500') #sets the size of the control window
    atlas.title('Atlas Control Panal') #sets the name of the control window

    def sendCommandASCII(command):#used to send a command to the create2
    cmd = ""
    for v in command.split():
        cmd += chr(int(v))

    sendCommandRaw(cmd)

    def sendCommandRaw(command):#used to send a command to the create2
    global connection

    try:
        if connection is not None:
            connection.write(command)
        else:
            tkMessageBox.showerror('Not connected!', 'Not connected to a robot!')
            print "Not connected."
    except serial.SerialException:
        print "Lost connection"
        tkMessageBox.showinfo('Uh-oh', "Lost connection to the robot!")
        connection = None

    def test():#sets a test command up to check connection
        global buttonpress
        buttonpress='test'
        sendCommandASCII('142 7')

    #makes a button on the GUI that starts the test command
    button1 = Button(atlas, text = 'test mode', command=test)
    button1.place(x=600, y=400)
    button1.config(width=10, height=5)

    atlas.mainloop() #runs the GUI as a loop to keep the window open.

#runs the read and the write program at the same time
try:
    thread.start_new_thread(program1, ("program1",))
    thread.start_new_thread(program2, ("program2",))
except Exception, e:
    print str(e)
</code>```

They told me that the code was actually working fine but I was trying to print out the value of the sensor packet without parsing it in any way. They then recommended I change the code in program2 to this:

```<code>while True:

    def toHexFromByte(val):
        return hex(ord(val))[2:}.rjust(2, '0').upper()

    x = connection.read()
    for b in x:
        print toHexFromByte(b)
</code>```

this works beautifully and prints to the screen if the bumper is pressed or a wheel drops. My question is how to deal with responses that are longer than one byte (ie Packet ID: 22 for voltage)?

When I try Packet ID: 22 it prints to screen and it sends the high byte of 3F and a low byte of D7. I can manually combine them to get 3FD7 and convert it to a decimal of 16.343 Volts but I would like to figure a way to print to screen the the voltage by having my program do this for me. Many of the sensors send data in 2 bytes and I need a way to make sure that it is combined automatically.

Robb

Body:
The program shown below illustrates two ways of determining result size, and a method that reads the right number of bytes to combine.

The first method suggested in the program below is to define singleSet, a set containing the packet numbers of sensors that return single-byte results.  [The function resultSize() as shown uses return ord(sizesList[sensor]) - ord('0'); a method depending on singleSet would instead say return 1 if sensor in singleSet else 2.

The second method shown is slightly more adaptable than the first, and if extended would allow treatment of large packets #0-#6.  With a bit more work it could accomodate packets #100-#107.

Here is the output from the program:

 7  8  9 10 11 12 13 14 15 16 17 18 21 24 32 34 35 36 37 38 45 52 53 58
 1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1

 0  1  2  3  4  5  6 19 20 22 23 25 26 27 28 29 30 31 33 39 40 41 42 43 44 46 47 48 49 50 51 54 55 56 57
26 10  6 10 14 12 52  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2

 1  16      54  0x36         54.000
 1  17      71  0x47         71.000
 1  18      88  0x58         88.000
 2  19   27002  0x697a    27002.000
 2  20   35740  0x8b9c    35740.000
 1  21     173  0xad        173.000
 2  22   48847  0xbecf       48.847
 2  23   57585  0xe0f1       57.585
 1  24       3  0x3           3.000
 2  25    5157  0x1425        5.157
 2  26   13895  0x3647       13.895
 2  27   22633  0x5869    22633.000

Here is the program itself.  Replace the call to dummy routine connectionread() with your connection.read() call.

#!/usr/bin/env python
# re: Combining bytes from Create2 sensor inputs
# http://robotics.stackexchange.com/questions/7219/issue-with-multiple-bytes-from-irobot-create-2

singleSet = set((7,8,9,10,11,12,13,14,15,16,17,18,21,24,
                 32,34,35,36,37,38,45,52,53,58))

sizesList = 'J:6:><d1111111111112212212222222121111122222212222221122221'

def resultSize(sensor):
    if sensor < 59:       # Sensor groups > 58 not handled
        return ord(sizesList[sensor]) - ord('0')
    else: return -1

# The next 11 lines print debugging / demo  output
for i in singleSet:  print '{:>2}'.format(i),
print
for i in singleSet:  print '{:>2}'.format(sizesList[i]),
print; print

for i in range(len(sizesList)):
    if i not in singleSet: print '{:>2}'.format(i),
print
for i in range(len(sizesList)):
    if i not in singleSet: print '{:>2}'.format(resultSize(i)),
print; print

# Routine to scale a sensor result and return real result
def scaleResult(sensor, r):
    if sensor in (22,23,25,26,54,55,56,57):
        return r/1000.0
    else:
        return r

# Dummy routine in place of connection.read()
crv = 37
def connectionread():
    global crv;
    crv = (crv+17)%255
    return crv

# Routine to query a sensor, read one or two bytes, and return result
def readResult(sensor):
    if 6 < sensor < 59:         # Work on basic sensors, not groups
        valu = 0
        for i in range(resultSize(sensor)):
            valu = (valu<<8) | connectionread()
        return valu
    else:
        return -1

# Some test cases
for i in range(16,28):
    r = readResult(i)
    print '{:>2} {:>3} {:>7}  {:8}  {:9.3f}'.format(resultSize(i), i, r, hex(r), scaleResult(i, r))

There are of course dozens of ways to address the issue, and the two shown above are two of the simpler ones.  If you are going to create a large software suite, you might instead use a more sophisticated approach, in which you would set up a record for each kind of packet, with each record containing packet number and name, some brief id, size, scale, and units.  For example, packet 25 would have a record like (25, 'Battery Charge', 'B_Ch', 2, 1000m 'Ah').  Records would be stored in a dict indexed by packet number.  Records could also include group-packets membership information.


问:
Robotic winch force sensor
I have a requirement for a motor that pulls a piece of rope until the rope is taught. However I'm at a loss as to how to achieve this, I'm sure it must've been done before but I'm not sure how to best describe this in a way that would get me more results. I wondered if there are any sensors or pre-established methods for sensing resistance to motion in electrical motors?</p>

答:
There are two ways that I can think of measuring this:

Motor current, as the resistance to motion increases the current increases linearly, you could measure the desired torque and the current and simply pull until this is met

You could have a tensioner wheel with a potentiometer to measure when the rope is taut.

Title: Robotic winch force sensor


问:
Are LiPo really 100 times more energy dense than model rockets?
Lately I've been interested in comparing the energy density of model rocket engines to lithium polymer batteries (attached to motors and propellers) for propelling things upwards.

To get a feel for this, I decided to compare an Estes C6-5 motor to a 3DR Iris + quadcopter.

Estes C6-5 has initial mass of 25.8g, and produces 10 N s total impulse. So, the "Impulse density" is about 10 N s / 25.8g = 0.38 N s g^-1.

3DR Iris+ weighs 1282g without battery. 3.5ah battery weighs 250g and will power hover for about 20 minutes (so about 10.5a draw). Thrust produced to hover on Earth is 9.8N kg^-1 * 1.532 kg = 14.7N. "Impulse density" is 14.7N * 1200s / 250g = 70.6 N s g^-1 .

So, according to my math here, the LiPo is about 0.38/70.6 = 186 times more energy dense than the model rocket engine.

Of course, the model rocket engine will lose 12.48g of propellant by the end of the flight so it will be effectively a little lighter, but that's not going to affect things by a factor of 100.

Does this seem right to you? Am I missing anything?

答:
I think the main difference is that the energy in the rocket engine is (probably, I'm not a rocket scientist) far less effectively used than the one of the LiPo. Also, the actual weight of the fuel in the rocket engines might be way lower than the weight of the engine (so your masses are not consistent, one is only the battery/"fuel", one includes the motor).

It would be interesting comparing the weight of a LiPo/Motor/Quadcopter with a Rocket engine with similar thrust, to see how size effects play into this.

For a "similar" comparison of a zippo vs a phone battery, look here.


问:
Can I use ROS with a Roomba?
Is there anything different between a iRobot Roomba and the Create?  I want go start building my own turtlebot and playing with ROS but with the cost of all the parts I'm going to have to do it piece by piece.  It's pretty easy to find cheap used Roombas.  </p>

答:
Yes, there is a difference between the Create and an off-the-shelf Roomba.  The Create doesn't have a vacuum motor or any of the cleaning brushes.  And there is an empty payload bay where all of the cleaning stuff used to be.  Additionally, the Create has an added microcontroller on it that you can push code onto.

But both the create and the Roomba let you control the robot directly over a serial interface.  I think this API is the same between the Create and the 500 series Roomba.  I am not sure about the 600 or 700 series Roombas, but i kind of doubt it changed.

Title: Can I use ROS with a Roomba?


问:
Arduino-Create 2: Reading Sensor Values
Over the past few weeks, I have been attempting to interface the iRobot Create 2 with an Arduino Uno. As of yet, I have been unable to read sensor values back to the Arduino. I will describe by hardware setup and my Arduino code, then ask several questions; hopefully, answers to these questions will be helpful for future work with the Create 2.

Hardware:
The iRobot Create 2 is connected to the Arduino Uno according to the suggestions given by iRobot. Instead of the diodes, a DC buck converter is used, and the transistor is not used because a software serial port is used instead of the UART port.

Software:
The following is the code that I am implementing on the Arduino. The overall function is to stop spinning the robot once the angle of the robot exceeds some threshold. A software serial port is used, which runs at the default Create 2 Baud rate.

```<code>#include <SoftwareSerial.h>
int rxPin=3;
int txPin=4;
int ddPin=5; //device detect
int sensorbytes[2]; //array to store encoder counts
int angle;
const float pi=3.1415926;
#define left_encoder (sensorbytes[0])
#define right_encoder (sensorbytes[1])
SoftwareSerial Roomba(rxPin,txPin);

void setup() {
  pinMode(3, INPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(ledPin, OUTPUT);
  Roomba.begin(19200);

  // wake up the robot
  digitalWrite(ddPin, HIGH);
  delay(100);
  digitalWrite(ddPin, LOW);
  delay(500);
  digitalWrite(ddPin, HIGH);
  delay(2000);

  Roomba.write(byte(128));  //Start
  Roomba.write(byte(131));  //Safe mode
  updateSensors();

  // Spin slowly
  Roomba.write(byte(145));
  Roomba.write(byte(0x00));
  Roomba.write(byte(0x0B));
  Roomba.write(byte(0xFF));
  Roomba.write(byte(0xF5));
}

void loop() {
    updateSensors();
    // stop if angle is greater than 360 degrees
    if(abs(angle)>2*pi){
      Roomba.write(173);
      delay(100);
    }
}

void updateSensors() {
  // call for the left and right encoder counts
  Roomba.write(byte(148));
  Roomba.write(byte(2));
  Roomba.write(byte(43));
  Roomba.write(byte(44));
  delay(100);

  // load encoder counts into an array
  int i = 0;
  while(Roomba.available()) {
    int c = Roomba.read();
    sensorbytes[i] = c;
    i++;
  }
  angle=((right_encoder*72*pi/508.8)-(left_encoder*72*pi/508.8))/235;
}
</code>```

Questions:

Am I loading the sensor values into the array correctly? This same code works when a bump and run program is implemented, but that requires knowing only one bit rather than two bytes.

How many bytes can be read over the serial connection at a time? A previous post (Help sending serial command to Roomba) highlights that one byte can be sent at a time. Does this imply that the reverse is true? If so, would a solution be to use a char array to read the values instead and then to append two chars to form an signed int?

Is serial communication synchronization a problem? I am assuming that synchronization is not a problem, but is it possible for the bytes to be split on the nibble boundaries? This would present a problem because there is not a nibble datatype.

答:
NBCKLY, have you been able to connect and send commands to the Create 2 with your Arduino?

Did you put the Create into 19200 Baud mode as referenced in page 4 of the OI Specifications1?

Method 1: While powering off Roomba, continue to hold down the Clean/Power button after the light has turned off. After about 10 seconds, Roomba plays a tune of descending pitches. Roomba will communicate at 19200 baud until the processor loses battery power or the baud rate is explicitly changed by way of the OI.

Method 2: Use the Baud Rate Change pin (pin 5 on the Mini-DIN connector) to change Roomba’s baud rate. After turning on Roomba, wait 2 seconds and then pulse the Baud Rate Change low three times. Each pulse should last between 50 and 500 milliseconds. Roomba will communicate at 19200 baud until the processor loses battery power or the baud rate is explicitly changed by way of the OI.

1 iRobot® Create® 2 Open Interface (OI) Specification

Title: Arduino-Create 2: Reading Sensor Values


问:
Minimising lateral drift in a PID (Arduino) controlled quadcopter using a 6DOF IMU
I'm developing a stabilisation system for an 'off-the-shelf' quadcopter by using an Arduino Mega and an IMU. The IMU is reading the angle of the quad, calculating motor commands by using a PID controller and applying them to the motors. It works well when constrained in a test bed, however in reality, although the quad is straight and level, it's drifting to one side because of its recent motor commands correcting the pitch/yaw. Is there any way I can (without using a vision system) keep the quad in one place without drifting?

I've looked into obtaining velocity by integrating the acceleration value, however it's extremely noisy and doesn't give a meaningful reading.

答:
If you are constrained to using an IMU without external sensors, then you would have to play with the platform to increase its stability. This could possibly be achieved by implementing a dihedral angle to all the prop-arms. So that natural disturbances would be naturally taken care of.

About using acceleration, it's a worthwile idea to try. You could try implementing a stability augmentation controller loop based on your acceleration data (without integrating it). This can be simply done-- similar to pitch/roll correction- by tilting the vehicle against the direction of the acceleration (e.g. if the vehicle is accelerating towards the right, tilt the vehicle a little bit to the left). This technique depends a lot on your acceleration data quality, and may not be practical at all.


问:
iRobot Create 2: Encoder Counts
This post is a follows from an earlier post (iRobot Create 2: Angle Measurement). I have been trying to use the wheel encoders to calculate the angle of the Create 2. I am using an Arduino Uno to interface with the robot.

I use the following code to obtain the encoder values. A serial monitor is used to view the encoder counts.

```<code>void updateSensors() {
  Roomba.write(byte(149)); // request encoder counts
  Roomba.write(byte(2));
  Roomba.write(byte(43));
  Roomba.write(byte(44));
  delay(100); // wait for sensors
  int i=0;
  while(Roomba.available()) {
    sensorbytes[i++] = Roomba.read();  //read values into signed char array
  }

  //merge upper and lower bytes
  right_encoder=(int)(sensorbytes[2] << 8)|(int)(sensorbytes[3]&0xFF);
  left_encoder=int((sensorbytes[0] << 8))|(int(sensorbytes[1])&0xFF);

  angle=((right_encoder*72*3.14/508.8)-(left_encoder*72*3.14/508.8))/235;
}
</code>```

The code above prints out the encoder counts; however, when the wheels are spun backwards, the count increases and will never decrement. Tethered connection to the Create 2 using RealTerm exhibits the same behavior; this suggests that the encoders do not keep track of the direction of the spin. Is this true?

答: This is true.  The encoders on the Create are square-wave, not quadrature.  Therefore, they rely on the commanded direction to figure out which way the wheel is spinning.  When driving forward, they count up, and when driving backward they count down as expected.  But if you move the wheel when the robot is not moving, or move the wheel opposite the commanded direction, you will get incorrect results.  The latest OI Spec available at www.irobot.com/create has a small discussion of this in the section for Opcode 43 on page 30.  This was only recently updated, and contains a number of notes regarding gotchas like this.  So you may want to re-download.</p>

Title: iRobot Create 2: Encoder Counts


问:
How many quadcopters would it take to lift a burrito?
I am investigating a possible business opportunity in which quadcopters perform high-precision nutritional delivery via a burrito medium. I have never used a burrito, but I have read on the internet that they typically weigh 600-700 grams (1). This is much too heavy for commercially available platforms.

How many quadcopters would it take to lift a single burrito?

(1): https://www.facebook.com/chipotle/posts/390817319252

答: It all depends on the payload of your quadcopter. For example I use the Ascending Technologies Hummingbirds quadcopters, which have a payload of 200 grams. You will need 4 of them. Now if you go for heavier quadrotors with payloads of more than a kilogram then you only need one. This is obviously the best solution as attaching several quadcopters together is hazardous.</p>


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

答:
You might want to read "A Tool for Kalman Filter Tuning" by
Bernt M. Åkesson, et. al.  It describes the autocovariance least-squares (ALS) method.  </p>


问:
Quadcopter - is iPhone the ultimate flight controller?
iPhone contains

Gyroscope

GPS

Two photo and video cameras

Self-sufficient battery that outlives the motor battery

Wifi

Backup connectivity (cellular, bluetooth)

Programmable computer

Real-time image processing capabilities and face detection

General purpose IO (with something like this)

and old models are available very cheap.

What is the main benefit of having a separate dedicated flight controller and camera on hobbyist rotorcraft rather than a general purpose device like the iPhone?

答:
Speaking from experience, smartphones (android in my case) do work as flight controllers but they have significant drawbacks

The operating system gets in the way. You don't have root access and can't kill off unnecessary processes.

The cameras are decent, but somewhat narrow field-of-view. Dual cameras  are not setup to enable stereo vision and even trying to use both at the same time overheats the phone quickly.

Camera placement is fixed relative to the body (problem if you want to look forward rather than down)

IMU sensors are really cheap which leads to noisy signals

Everything is thermally connected and not well cooled, so sensors exhibit significant drift.

You still need extra processors. Most motors talk over PWM or i2c so you need a board to receive commands from the phone and translate.

WIFI range is smaller than most RC transmitter/receiver pairs.

Like I said, you can make it work but it is not optimal.


答:
As it turns out, I was not loading the sensor values into the array properly. It seems that data is transmitted one byte at a time, so the sensorbytes array needed to be an array of 4 elements rather than two. Once this was corrected, the correct encoder counts could be determined by joining the upper and lower bytes of the encoder counts from each wheel using the following scheme:

```<code>// highbyte is shifted left eight bits, lowbyte is added to highbyte
// encoder_count=highbyte<<8+lowbyte
left_encoder=sensorbytes[0]<<8+sensorbytes[1];
</code>```

This scheme made sure that the resulting left_encoder was a signed int rather than an unsigned int had the word() function been used. The revised updateSensors() code can be found in this post: iRobot Create 2: Encoder Counts.

Serial communication synchronization was not a problem. I suspect that this sort of thing is handled behind the scenes and does not need to be programmed at the high level that I am working on.

Title: Arduino-Create 2: Reading Sensor Values

Body:
Over the past few weeks, I have been attempting to interface the iRobot Create 2 with an Arduino Uno. As of yet, I have been unable to read sensor values back to the Arduino. I will describe by hardware setup and my Arduino code, then ask several questions; hopefully, answers to these questions will be helpful for future work with the Create 2.

Hardware:
The iRobot Create 2 is connected to the Arduino Uno according to the suggestions given by iRobot. Instead of the diodes, a DC buck converter is used, and the transistor is not used because a software serial port is used instead of the UART port.

Software:
The following is the code that I am implementing on the Arduino. The overall function is to stop spinning the robot once the angle of the robot exceeds some threshold. A software serial port is used, which runs at the default Create 2 Baud rate.

```<code>#include <SoftwareSerial.h>
int rxPin=3;
int txPin=4;
int ddPin=5; //device detect
int sensorbytes[2]; //array to store encoder counts
int angle;
const float pi=3.1415926;
#define left_encoder (sensorbytes[0])
#define right_encoder (sensorbytes[1])
SoftwareSerial Roomba(rxPin,txPin);

void setup() {
  pinMode(3, INPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(ledPin, OUTPUT);
  Roomba.begin(19200);

  // wake up the robot
  digitalWrite(ddPin, HIGH);
  delay(100);
  digitalWrite(ddPin, LOW);
  delay(500);
  digitalWrite(ddPin, HIGH);
  delay(2000);

  Roomba.write(byte(128));  //Start
  Roomba.write(byte(131));  //Safe mode
  updateSensors();

  // Spin slowly
  Roomba.write(byte(145));
  Roomba.write(byte(0x00));
  Roomba.write(byte(0x0B));
  Roomba.write(byte(0xFF));
  Roomba.write(byte(0xF5));
}

void loop() {
    updateSensors();
    // stop if angle is greater than 360 degrees
    if(abs(angle)>2*pi){
      Roomba.write(173);
      delay(100);
    }
}

void updateSensors() {
  // call for the left and right encoder counts
  Roomba.write(byte(148));
  Roomba.write(byte(2));
  Roomba.write(byte(43));
  Roomba.write(byte(44));
  delay(100);

  // load encoder counts into an array
  int i = 0;
  while(Roomba.available()) {
    int c = Roomba.read();
    sensorbytes[i] = c;
    i++;
  }
  angle=((right_encoder*72*pi/508.8)-(left_encoder*72*pi/508.8))/235;
}
</code>```

Questions:

Am I loading the sensor values into the array correctly? This same code works when a bump and run program is implemented, but that requires knowing only one bit rather than two bytes.

How many bytes can be read over the serial connection at a time? A previous post (Help sending serial command to Roomba) highlights that one byte can be sent at a time. Does this imply that the reverse is true? If so, would a solution be to use a char array to read the values instead and then to append two chars to form an signed int?

Is serial communication synchronization a problem? I am assuming that synchronization is not a problem, but is it possible for the bytes to be split on the nibble boundaries? This would present a problem because there is not a nibble datatype.

Body:
As it turns out, I was not loading the sensor values into the array properly. It seems that data is transmitted one byte at a time, so the sensorbytes array needed to be an array of 4 elements rather than two. Once this was corrected, the correct encoder counts could be determined by joining the upper and lower bytes of the encoder counts from each wheel using the following scheme:

// highbyte is shifted left eight bits, lowbyte is added to highbyte
// encoder_count=highbyte<<8+lowbyte
left_encoder=sensorbytes[0]<<8+sensorbytes[1];

This scheme made sure that the resulting left_encoder was a signed int rather than an unsigned int had the word() function been used. The revised updateSensors() code can be found in this post: iRobot Create 2: Encoder Counts.

Serial communication synchronization was not a problem. I suspect that this sort of thing is handled behind the scenes and does not need to be programmed at the high level that I am working on.


问:
Is there a bug in the Encoder Counts packets 43&44?
I think I have just found another bug - there was one that was mentioned in another post about the angle and distance. This one is about reading the encoder's counts. I was using them as a workaround for the other bugs but what I found in one instance is that the counts I was reading from the right encoder were incorrect. I was reading in a loop sleeping for 100msec while turning the create2. Here is part of the counts where it definitely shows a problem:

```<code>32767
-32763
32766
-32768
</code>```

This kept on going until I stopped. It seems that it has a problem when it reaches the max.

Has anyone else ran into this or can explain or provide another workaround?

答:
Jack,

I have been working on determining the angle from the encoders. I recall running up against a similar problem to the one that you are facing.

First off, unless you are spinning the wheels really fast, the encoders should not give readings like that (508.8 counts per revolution means that you would be spinning the wheels ~130 revolutions in 100 ms--practically light speed for the Create 2). For this reason, I suspect that there is something odd going on inside the Create 2. I would suggest resetting the Create 2 using Op code [7], then trying again; this fixed my problem.

When you try again, you should do the following:

Connect to a computer and setup using RealTerm, or some other simlar program.

Reset the Create 2 with [7].

Send the following string of commands: [128 131 149 2 43 44]. This will print the encoder counts of each wheel each time you send the commands.

If this does not work, try taking out the battery and putting it back in, then repeating steps 1 and 3 above.

In addition, there are some things that you should keep in mind. From an earlier post (iRobot Create 2: Encoder Counts) and the updated OI specs, the encoders are square wave and do not keep track of the direction of spin directly, so you should see only positive increases in the encoder count, regardless of spin direction.


问:
Cool robotics projects
I'm a robotics student but very new to this field.

Can you suggest any websites which provide projects/helpful info that I can learn from?

Thanks

答: I would suggest looking into computer vision. Computer vision is frequently used to allow robots to perceive their surroundings.  All you need is a webcam and some time to spend here!  Opencv is an open source computer vision library that is commonly used with robotics. The tutorials will walk you through all the code and explain what is going on.</p>

Title: Cool robotics projects


问:
Sensing the level of a liquid in a tube
I'm looking to build a sensor which will detect the level of liquid in a tube.

It does not have to be precisely accurate, just detect whether the level is approximately above a certain height.

The liquid level can be seen in the red oval

I thought about monitoring this with a webcam and using opencv to detect the liquid level. but this seemed a bit overkill. Especially if I have to have a dedicated PC to process the images.

Surely there's a simpler solution.

Perhaps a component I can attach to a raspberry PI or arduino board ...

I'm not very familiar with laser sensors so I don't know what is suitable.

As long as it's reliable ...

EDIT

I should add that the tube contains toluene which is flammable, and it is vacuum sealed. So we can't just drill into it. Some kind of optical/laser sensor might be  OK, as long as it can recognise a clear liquid.

答:
You have to look at pressure sensor usually used in washing machines market.

Usually are components or amplifier where you can connect your tube directly, and it will give you an output proportional to the pressure.

First googled LINK

All sensor catalogue LINK

Title: Sensing the level of a liquid in a tube


答:
If you look in the industry, they usually use capacitive proximity sensors.

This sensors can be adjusted easily to sense behind the glass. In addition I can tell you, that this measurement is highly reliable. Usually they start around 70$, but you find also some cheaper DIY-solutions.

Another possibility is the use floating styrofoam with a magnet on top of the liquid. Just place a reed-relay at the side of your tube and you got the position.

The disadvantages of the listed solutions are that they provide only digital measurements. You get only information like this: The liquid is higher or lower than X cm.

For analog measurements refer to LPs' solution or work with the weight of your device and calculate then the height of your liquid.

EDIT:
concerning the edit of the questions, You should really consider the capacitive proximity sensors, which are usually used for such applications, because you do not need to modify the tube at all.

Title: Sensing the level of a liquid in a tube

Body:
I'm looking to build a sensor which will detect the level of liquid in a tube.

It does not have to be precisely accurate, just detect whether the level is approximately above a certain height.

The liquid level can be seen in the red oval

I thought about monitoring this with a webcam and using opencv to detect the liquid level. but this seemed a bit overkill. Especially if I have to have a dedicated PC to process the images.

Surely there's a simpler solution.

Perhaps a component I can attach to a raspberry PI or arduino board ...

I'm not very familiar with laser sensors so I don't know what is suitable.

As long as it's reliable ...

EDIT

I should add that the tube contains toluene which is flammable, and it is vacuum sealed. So we can't just drill into it. Some kind of optical/laser sensor might be  OK, as long as it can recognise a clear liquid.


问:
Fast C++ library for stereo vision/disparity computation
I am looking for a library for disparity map / stereo vision computation. These are my requirements:

C++

Multi-platform (Linux, Windows, OSX)

(preferrable but not mandatory) not CUDA based

Suited for robotics (e.g. it should work even if the images are not perfectly rectified and the cameras are not perfectly calibrated)

Suitable for tracking purposes (20fps or more)

Performing even with low-res images (e.g. 320x240px)

Open Source

答:
I'll try to answer this question on my own, but feel free to add more information on that.

We tried OpenCV's standard disparity function, but it fell short mainly because of item #4. Further, it is very slow (running at 1fps with images at 640x480px even on powerful machines).

Recently, we are doing some tests with libelas and it seems promising. It is more robust, faster and it generally works better.


答: I just learned about libviso.  I didn't compare to all of your requirements, but it looks pretty good.</p>

Title: Fast C++ library for stereo vision/disparity computation

Body:
I am looking for a library for disparity map / stereo vision computation. These are my requirements:

C++

Multi-platform (Linux, Windows, OSX)

(preferrable but not mandatory) not CUDA based

Suited for robotics (e.g. it should work even if the images are not perfectly rectified and the cameras are not perfectly calibrated)

Suitable for tracking purposes (20fps or more)

Performing even with low-res images (e.g. 320x240px)

Open Source


答: I would suggest a new field named as soft robotics. This brings new horizons to robotics. Take a look http://softroboticstoolkit.com/</p>

Title: Cool robotics projects

Body:
I'm a robotics student but very new to this field.

Can you suggest any websites which provide projects/helpful info that I can learn from?

Thanks


答:
Here's a few ideas:

Insert two bare wires as probes and measure the resistance between them. The resistance should drop dramatically once the liquid touches both sensors.

Insert a sonar into one end that points directly into the tube. This method should give you a simple measurement of how far the surface of the fluid is from the sensor. I'm not sure how well a sonar works inside a tube as there will be echoes and such to consider, but some experimentation might lead to good results.

Seal the tube at one end with a cork and put a barometer on the inside. The rising level of fluid will compress the air and register different "altitudes" on the barometer.

Maybe its possible to use an IR beam through the tube if you can apply a dye to the fluid.

Title: Sensing the level of a liquid in a tube


问:
PID over another module that implements a PID control?
I'm in charge of a module to control the smoothness with which a platform should move; the platform already implements a closed-loop control on its own but this firmware is closed and I do not have access to source code.
It is therefore requested that a closed loop control should implemented on top of that PID, in a superior layer, above a module that already implements a closed loop control, so i have several question:

It's conceptually correct implement a PID control in an upper layer to closed loop control that implements it?

What features may be loose in the lower close loop?

Maybe loop control closed negatively be influenced by the PID that implements the top layer?

Estimate The angular speed, yaw and pitch, based on the position of the motors using Kalman filters can generate values too far from the actual values reported

答:
It is not uncommon to have nested (or hierarchical) control loops in a controller.

Usually the two different loops control two different variables, not the same one. Furthermore, it is assumed that the inner loop is faster then the outer one.
If you write the differential equation of the plant, you can easily understand why:

$$ \dot{x} = f(x, \xi)$$
$$ \dot{\xi} = g(x, \xi, u)$$

You have the control $u$ which (directly) influences only the evolution of $\xi$ but you want to control $x$; you can think of designing a two-loop control system: an outer loop controlling $x$ and a second (inner) loop controlling $\xi$. The assumption  here is that $\xi$ will converge to the desired value faster than $x$.

This should answer your 1,2,3) questions.
About the 4th one, it probably depends on how you implemented the Kalman Filter.


问:
How to test GAZEBO works properly. Save windows don't show any component
How can I test whether my gazebo installation works properly or not? I'm trying to "save myworld" and "save as" options but no window is shown.</p>

答:
"Save World as" is broken on Gazebo 5.1.0 .

You can either install the experimental version of Gazebo 6 using the gazebo6-prerelease package (assuming you are on Ubuntu) or wait for the fix to be released in Gazebo 5.2.0 .

The relevant bug on Gazebo issue tracker is:
https://bitbucket.org/osrf/gazebo/issue/1593/world-save-as-broken-on-gazebo-510 .


答:
Only one; there are many models of quadcopters available that can lift this amount.

The OFM GQuad-8 can lift 6kg, for instance.

Title: How many quadcopters would it take to lift a burrito?

Body:
I am investigating a possible business opportunity in which quadcopters perform high-precision nutritional delivery via a burrito medium. I have never used a burrito, but I have read on the internet that they typically weigh 600-700 grams (1). This is much too heavy for commercially available platforms.

How many quadcopters would it take to lift a single burrito?

(1): https://www.facebook.com/chipotle/posts/390817319252


问:
Guiding a Quadrotor Towards a Target
I am working on a quadrotor.  I know its position -- $a$, where I would like to go -- target position $b$, and from that I calculate a vector $c$ -- a unit vector that will take me to my target:

```<code>c = b - a
c = normalize(c)
</code>```

Since a quadrotor can move in any direction without rotation, what I have tried to do is

rotate $c$ by the robots yaw angle

split it into its $x, y$ components

pass them to the robot as roll and pitch angles.

The problem is that if the yaw is 0° ±5 then this works, but if the yaw is near +90 or -90 it fails and steers to wrong directions. My question is am I missing something obvious here?

答:
Re-implementing your solution, I get this:

Angle Between Vectors

First, you want the angle between points $A$ and $B$ -- not specifically the unit vector.

(via Fx Programming):
$\theta = math.atan2(B_{x}-A_{x}, B_{y}-A_{y})$

Vehicle Yaw Angle

Next (and I suspect this is your problem), you need to subtract the vehicle's yaw angle $\psi$ from your calculated $\theta$.

Heading vs Yaw

If you're using a compass for the "yaw angle" of your vehicle, this could also be your mistake; heading and yaw are not the same.
Compass heading is zero along the positive $y$ axis, increasing as it turns clockwise:

Yaw is zero along the positive $x$ axis, increasing as it turns counterclockwise:

The 90 degree overlap between these measurements, combined with adding (instead of subtracting) the vehicle yaw from the desired yaw, may be why things worked when your target was within ±5° and behaved badly at ±90°.

Conversion to Component X and Y

From there, you say that you are converting this result $(\theta-\psi)$ into its $x$ and $y$ components, passing them to the robot as the roll and pitch angles.  With the above corrections, you should get the desired result at this point.  However, directly mapping these components to tilt angles might be problematic since you are only considering the difference in position, and not the velocity (really, the momentum) of the vehicle.

PID Control

You may be best served by using PID control loops for the roll and pitch of the vehicle.  That is, once you fix your code and are able to hit your target, my guess is that you'll start overshooting it instead -- oscillating back and forth.  A correctly-tuned PID will prevent that from happening while still allowing you to approach the target quickly.

Instead of plugging your $x$ and $y$ into roll and pitch, consider them to be the error values that the roll and pitch PIDs accept as input.

Title: Guiding a Quadrotor Towards a Target

ContentLicense: CC BY-SA 4.0


问:
How would I implement a following drone with a camera using GPS?
As the title states, is there any way to make a following drone that tracks a GPS unit, and follows/orients camera to that? Similar to this</p>

答:
I assume that you will have GPS on your drone in addition to the GPS unit you will want to track.

You will make heavy use of the Haversine formula, which will tell you the bearing between 2 lat/lon (GPS) coordinates.  This will come in handy in the following ways:

Using the current and previous coordinates from the target's GPS, you know what direction the target is moving.

Using the drone's coordinates and target's coordinates, you know what direction to aim the camera.

Once you know where the target is and what your orientation should be to it, you can calculate the drone's desired position based on the desired following distance.


问:
Robotic winch force sensor
I have a requirement for a motor that pulls a piece of rope until the rope is taught. However I'm at a loss as to how to achieve this, I'm sure it must've been done before but I'm not sure how to best describe this in a way that would get me more results. I wondered if there are any sensors or pre-established methods for sensing resistance to motion in electrical motors?</p>

答: If you know how much force should be on the rope, you could simply mount the winch against a spring that takes that same amount of force to compress.  Then, just use a limit switch to detect when the spring has been compressed. </p>

Title: Robotic winch force sensor


问:
Underwater ROV Variable Ballast
How would you guys recommend making a variable ballast system for an underwater robot? I was thinking about this problem earlier and I was trying to figure out if there was a way to make one that didn't require a tank of compressed air. </p>

答:
Variable ballast on ROVs in practice is usually limited to just the really big ones, for several reasons:

In general, you only need to vary your ballast when you're trying to get an exact amount of buoyancy at great depth -- when that amount would be different than at the surface (due to compression of various components)

The pressure housing required adds a lot of size and weight

The power required for the pump or compressor is significant

It requires more maintenance

That's not to say it can't be done on a small scale, for slight adjustments to ballast.  Underwater gliders use variable ballast as "buoyancy engines".

Depending on your specific application, you might get away with one of the following alternatives:

Descending with a dropweight, then shedding it at the desired depth (repeat for rapid ascent)

Having a canister of lead shot, and dropping the balls in a controlled fashion until you have reached the desired buoyancy -- useful if you are going to collect samples

Use more powerful motors and actively compensate for buoyancy

Title: Underwater ROV Variable Ballast


问:
What is load current and load speed? Which battery is best suitable for this motor?
These are the specifications of the motor:

25000RPM no load speed at 12V

No Load Current - 1A, Stall Current - 10A

0.36Kgcm torque

What is the definition of load current and load speed? Which battery would be most suitable to power this motor?

答:
Here's how to read the information you found:

The motor you are describing will draw the least amount of current when there is no load (1A), and the most amount of current when it is stalled (10A).  Think of it this way: when the motor can't turn (being stalled), it's at its maximum load -- you can't make it turn slower than zero$^*$.

The load speed will depend on what the motor is trying to do.  As you noted, if there is no load it will be spinning at 25,000 RPM.  This can go all the way down to zero, depending on circumstances.

Whichever battery you use should be able to supply just over 10A peak current, if you want to get the maximum performance from this motor.

$*$ In practice, you can make a motor run backwards (such as if it was spinning one way and you slammed it into reverse), and this can make it draw more than the stall current.


问:
Assuming I have the angle with respect to two beacons, and know the distance between them, can I localize myself?
Let's assume I have the following situation, and need to find (x,y).

Is it possible? There does not appear to be more than one solution to the system, but my trigonometry is a bit rusty.

I feel like I need one more distance.

答:
Note: this answer is based on the criteria from the original question, before edits were made to it.

If the orange spots are robots and the green spots are beacons, you can see that all three locations satisfy your criteria:

angle between two beacons from robot's point of view and

distance between the two beacons.

I think you can see that there are many such solutions when you only know those two variables.

But add a third beacon, and you might be on to something.

Addendum:

If you know true headings of beacon 1 and beacon 2 and not just the angle between them, then you have a different equation and one that has a single solution.