答:
The thrust to weight ratio of your quadcopter should be at least 2 to for a decently manoeuvrable quadcopter.

For example, if your quadcopter has mass m, then your motors need to provide a total thrust of m*g to hover. Look for motors that can provide a thrust of mg/4 each (assuming 4 rotors) at 50% throttle.

Most motor manufacturers today actually provide performance statistics of their motors with various prop sizes so finding the right motors should not be too difficult.

Title: Simple relation between lifting weight and power of the motor in quad-rotors?

Body:
I like to know are there simple equations to find how much motor power is needed to lifting 1 KG with a quad rotor?
Also if we use gas powered engine, how can we find a relation between lifting weigh and fuel consumption?</p>


问:
Stream Real-time Video with Environmental Data Overlaid
I want to embed environmental data collected from sensors into a live video stream from a camera. Has anyone done this or know how I would go about doing something like this? Is there a library available for the arduino or RPi?</p>

答:
There are no ready-made open-source solutions that incorporate both streaming video & sensor data from an Arduino that I am aware of; however, it wouldn't be too hard to build your own.  You would need a webcam + software for live streaming, then you'd need to interface your Rpi with the Arduino in order to access sensors that are connected to the Arduino via Python (or other language).  The easiest way of doing that is through the i2c bus, which will leave both USB ports on the Pi free, so you can connect a webcam, and even a USB wifi stick.

mjpg-streamer - if your webcam supports MJPEG, it is the best and least computationally expensive way of streaming live video from your Raspberry Pi.

RPi + Arduino via i2c - Tutorial for connecting the Rpi to the Arudino via i2c (uses Python SMBus library).  You will need to modify the Arduino code to send the sensor data you need based upon the byte value sent from the Pi.

You would then edit the php page hosted by the mjpg daemon to add your sensor data that you would collect via Python and the SMBus library.

You can launch mjpg-streamer using the following:

```<code>./mjpg_streamer -i "./input_uvc.so" -o "./output_http.so -w ./www"
</code>```

or for webcams w/o MJPEG support:

```<code>./mjpg_streamer -i "./input_uvc.so" -o "./output_http.so -y -w ./www"
</code>```

You can then view the livestream at localhost:8080

ContentLicense: CC BY-SA 3.0

Body:
There are no ready-made open-source solutions that incorporate both streaming video & sensor data from an Arduino that I am aware of; however, it wouldn't be too hard to build your own.  You would need a webcam + software for live streaming, then you'd need to interface your Rpi with the Arduino in order to access sensors that are connected to the Arduino via Python (or other language).  The easiest way of doing that is through the i2c bus, which will leave both USB ports on the Pi free, so you can connect a webcam, and even a USB wifi stick.

mjpg-streamer - if your webcam supports MJPEG, it is the best and least computationally expensive way of streaming live video from your Raspberry Pi.

RPi + Arduino via i2c - Tutorial for connecting the Rpi to the Arudino via i2c (uses Python SMBus library).  You will need to modify the Arduino code to send the sensor data you need based upon the byte value sent from the Pi.

You would then edit the php page hosted by the mjpg daemon to add your sensor data that you would collect via Python and the SMBus library.

You can launch mjpg-streamer using the following:

./mjpg_streamer -i "./input_uvc.so" -o "./output_http.so -w ./www"

or for webcams w/o MJPEG support:

./mjpg_streamer -i "./input_uvc.so" -o "./output_http.so -y -w ./www"

You can then view the livestream at localhost:8080


问:
explanation of kalman filter
I have gone through my lecture notes but I can't seem to figure out the five different steps of a Kalman filter and how these steps are  Divided into prediction and correction and how the state and the uncertainty evolves with each step. I would appreciate it if someone could explain it to me please </p>

答: Here is a video by Professor Michel Van Biezen that I found very useful while reading up on Kalman filter. It also includes an example problem along with the steps needed very clearly defined.</p>

Title: explanation of kalman filter


问:
$p(m|x_t, u_t, x_{t-1})$ What does Thrun mean with the "map probability"?
Different question from the last one since I still struggle with the concept.

In his book "Probabilistic Robotics", Thrun has the following equation: (Context here) (5.49)

$p(x_t|u_t,x_{t-1},m) = \eta p(m|x_t,u_t,x_{t-1})p(x_t|u_t,x_{t-1})   $

I can't really wrap my head around any probability that involves $p(m)$ or  $p(m|...)$. What is the probability of a map? Isn't it always 1, because i have just one map? How do I have to imagine $p(m|x_t,u_t,x_{t-1}$)? In his book, he kind of just handwaves it...

答:
How do I have to imagine $p(m|x_t,u_t,x_{t-1}$)? In his book, he kind
  of just handwaves it...

In SLAM, you need to build two entities, the robot's state (i.e. position and direction) and the map. In deterministic approaches, the probability of both robot's state and the map is one, meaning you know these entities with an absolute true (i.e. zero uncertainty). In probabilistic approaches, you can't know the robot's state and the map with an absolute true that is because sensors have noise, therefore, the probability principle is the right choice to handle this kind of problems. Now what is this probability $p(m|x_t,u_t,x_{t-1}$)? This is a conditional probability, the inputs are the previous state of the robot, the current state of the robot, and the current control input that drives the robot whereas the output is the probability of the map. Remember the probability here reflects the certainty of the knowledge about the map. For example, if the probability is 0.9, it means we are 90% sure about the location of the map and 10% is the uncertainty.


问:
What's the diffrence between $H_2$ and $H_\infty$ control?
There a two controllers named $H_2$ and $H_\infty$.
Can someone explain if:

They have have guaranteed stability margins?

Do they have a Kalman filter?

Are they for both SISO and MIMO systems?

Can I use them with LQG?

Which one is best?

If you know how to create a basic $H_2$ and $H_\infty$. Can you please show me step by step?

答:
The H2 control problem is to find a proper, real rational controller K that stabilizes G internally and minimizes the H2 norm of the transfer matrix Tzw from w to z, see the figure below

It is well-known that a system with LQR controller has at least 60o phase margin and 6 dB gain margin. However, it is not clear whether these stability margins will be preserved if the states are not available and the output feedback H2 (or LQG)controller has to be used.

for more information on stability margins of the H2 control, see the book, Essentials of Robust Control / chapter 13 / page 265 / section 13.6.

on the other hand, Optimal H-infinity Control: Find all admissible controllers K(s) such that infinity norm of Tzw is minimized. additionally,
Suboptimal H-infinity Control: Given gamma > 0, find all admissible controllers
K(s), if there are any, such that infinity norm of Tzw < gamma.
.

ContentLicense: CC BY-SA 4.0


问:
Why do my ESCs stop working?
I'm new to robotics and this is my first time building a quadcopter.  I'm unable to work out why I keep losing ESCs.

Most recently in testing, I've managed to calibrate all 4 ESCs and accurately control the speed of all 4 motors.  But after neatly securing them to the frame, 1 motor didn't work.  I recalibrated the ESCs again and, when running them again, the motor still didn't work.  However, the other 3 motors continued to run at first, but also suddenly just stopped altogether.

Research suggested that ESCs have a cut-off voltage, indicating that my battery might be too flat, so I immediately looked to recharging it. To my surprise, the (still very new) battery appeared to have bulged out, indicating that it had been damaged.

Further research suggested that the size of the battery I was using is insufficient for the amount of current drawn by the motors.  So, without any PWM applied, I reconnected a new fully charged battery in the hope of listening for any beeps to diagnose, and one ESC immediately coughed up a huge puff of smoke.

Before all of this happened, I only managed to get 2 of the ESCs to run their motors.  Despite several attempts at tweaking PWM signals and calibrating them, I ended up replacing the other 2.

Unless there's some obvious reason for my ESCs to keep dying on me, I can only assume that these specific ESCs are badly made and I should ask for my money back.

These are the components I'm using:

Raspberry Pi 2 Model B

Adafruit 16-Channel 12-bit PWM/Servo Driver - I2C interface - PCA9685

RCTimer Mini ESC 40A OPTO BLHeli Firmware (Oneshot125, Support 2-6S)

RCTimer 2208-8 2600kV Outrunner Brushless Motor

Gens ace 2200mAh 11.1V 25C 3S1P Lipo Battery Pack

The Raspberry Pi is powered through its micro USB interface by a 5V Step-Up Voltage Regulator connected to a 5000mAh 3.7V LiPo battery.  The PWM Controller is powered to its Vcc pin by the GPIO1 (3.3V) pin from the Raspberry Pi, that also happens to power other sensors.

At the time (when all 4 motors worked), I was able to accurately control them at either 50Hz or 400Hz with 1-2 millisecond duty cycles.

答: I think it sounds like your motor mounting bolts are too long pressing against or dangerously near the motor windings </p>

Title: Why do my ESCs stop working?


问:
Wearable Accelerometor
I've worked with wiimote accelerometer, but I think now I want to move past that. Mostly because I want to have a wider range of available gestures and I think that using only one accelerometer has too many limitations for what I want to do. I'm looking for something compatible with arduino or RPi. Does anyone have recommendations on how I should do this?</p>

答: What you want is a three-axis (or sometimes triple-axis, three-axes) accelerometer, which will allow you to detect the magnitude and direction of the acceleration. If you want to detect the acceleration of one part relative to another part, then you need an accelerometer for each part. I2C is a reasonably standard sensor protocol. I2C accelerometers are available off-the-shelf, and Arduino has libraries for I2C communication.</p>

Title: Wearable Accelerometor


问:
How to eliminate motion blur with realtime performance
I have a robotic system to develop, in first phase of the project I need to track an object. So I placed a geometrical marker on the object to estimate it's pose (rotation, translation). It all works fine until the target object moves a little faster and motion blur is introduced to the input images from camera.

So I have two options:

Either deconvolve the images to remove blur before object tracking

OR use a camera with very high frames per second

The problem is first solution is too slow for a real-time system and second option is too expensive.

Please tell me if there is a more efficient technique than older ones (Weiner, Lucy-Richardson, Blind Deconvolution) to remove motion blur. I believe there must be something, because mobile robot need real-time calculations from their camera inputs and motion blur is a common problem when robot or the target object is moving.

I'm using Python 2.7 with Opencv 3 and ROS Kinetic.

Otherwise let me know how many fps are sufficient to observe a human who can walk, run, fall from a distance of 10-20 ft. I can't go and buy a 400-1000 fps camera just to check the output.

Below are the images of some sample markers.

Actual Markers:

Blurred Image when Moving

答: You don't need more frames per second, you need a shorter exposure time. </p>


问:
Extended Kalman Filter for IMU
I am trying to use a multilayer perceptron to make a flight controller for a ROV. I have a MPU-9250 IMU and I need to remove the noise from the sensor before I can train my MLP. The IMU has a accelerometer, gyro and a magnetometer. I know my state vector is supposed to be

```<code>[acc_x, Acc_y, Acc_z, gyro_x, gyro_y, gyro_z, mag_x, magy, mag_z]
</code>```

I am not sure about the rest. Since I want the clean Acc, gyro and mag's x, y and z values can I just use an identity matrix for everything in EKF?

I want to pass the IMU data to the MLP after cleaning it and try to predict the control signal for all my thrusters. For my dataset I recoded the IMU information from a ROV2 and I also recorded the pwm signals for each thruster. If it does work I won't be able to control things like PID values of the thrusters but for now I don't really care about it.

答:
There are a couple of potential traps with the scenario you seem to be outlining. Many of them have already been addressed in literature on inertial navigation. You can find many good references on inertial navigation and dead reckoning using IMUs, and you may want to look into that, depending on your goals.

What you are asking for is a method to clean up your raw IMU data using an EKF. This is a bit of a strange request, because the EKF is generally designed for dynamic systems. In our context, it's sufficient to say that dynamic systems are driven by some known process in between measurements; for instance, if you were estimating position and velocity, there is a known relationship (derivative) that describes how the velocity affects position in between measurements from, e.g., a GPS receiver. You have not mentioned any other measurements, like GPS, that you want to use in the filter. If you don't have any other measurements available, then an EKF is not going to buy you anything in practice, and is probably much more challenging to set up.

If all you want is filtered accelerometer, gyroscope, and magnetometer data, then I would suggest designing a low-pass filter to smooth those data instead. You would also want to make sure to calibrate the bias of the accelerometer and gyros by reading the first N measurements, and then subtracting the average of those values from all subsequent measurements. Depending on your application and the motion of your vehicle, you might have usable data for as many as several minutes. I'm making some fairly wild guesses about your IMU bias drift rates, since I'm not familiar with the MPU-9250. In general, I would not trust a MEMS IMU output for too long, since there will always be bias drift. There are ways to address this limitation: you could augment the IMU with additional sensors, or you could re-calibrate periodically by stopping the vehicle and taking measurements. Unfortunately, the latter approach is only really very realistic if you have a ground vehicle moving over fairly level terrain.

It's not clear if your application is for a flying vehicle or for an underwater one, nor is it clear what your desired inputs and outputs for an ANN-based controller are. For instance, if all you are giving the controller is IMU data, what will be its objectives? It sounds like what you may want to do is perform inertial navigation. Assuming you have an underwater vehicle, you will mostly likely want to perform dead reckoning. Essentially, dead reckoning integrates the accelerometer histories twice to estimate the position of the vehicle, and the gyro histories once to estimate its orientation. If you have estimates of the position, then you could give your controller simple commands, such as "go to position X = 5 m" and then have the controller try to do that. (You can do the same thing with accelerations, of course, but I'm not sure what the point would be, since the vehicle won't be capable of even basic autonomy.)

Title: Extended Kalman Filter for IMU


问:
Do Polycarbonates (lexan) block wifi
I am trying to figure out if WiFi from TP-Link N450 Wireless WiFi Router could reliably get through lexan. I need the wifi to be able to have a constant, reliable signal.</p>

答: LEXAN  has low absorption and reflection to WiFi as long as not touching say a dielectric antenna where it might shift tuning but unlikely in your situation.</p>

Title: Do Polycarbonates (lexan) block wifi


问:
ROS + SLAM + kinect. which platform to use?
I am doing a project where I've robot which will be using kinect + ROS for Simultaneous Localization and Mapping. Which board should I use? I've heard that Raspberry pi , beaglebone are not sufficient. </p>

答:
There are several platforms possible, depending on your experience level and needs.

If you are comfortable working with the Raspberry Pi or the Beagle Bone... the next step up might be the Jetson TX1 or TX2 from Nvidia.  Please note that the default install of OpenCV4Tegra does not include the slam modules, so you will have to install OpenCV from source if you plan on using that library for SLAM/SIFT.  ROS can be installed on the Jetson following this guide.

Qualcomm also makes the snapdragon line or processors and there are many other chips out there, too.

Please review the guidelines for your question since it seems highly opinion based.  Consider rephrasing/asking a more specific, technical question.


问:
How to find a smartphone with a quadcopter?
I think there are some quad-copter at the market those can find you from your smart phone. I don't know how accurate it is and how does it works? Is there a solution that I can build an android/ios application that quad-copter can find exactly the smart phone which has this app installed?</p>

答:
You can make an app that send the location of your phone, then you can use sensor fusion using Wi-Fi and IMU to enhance the precision.
But to locate people, like spying you only need Kali Linux, a few exploitables, you don`t need a drone.

I understood you want to build a drone that follows you. There are some you can buy, but DIY is more fun.

This can be modified to do what you want using ROS.

https://github.com/trancept/ROS-Autonomous-Quadcopter-Flight


答: I have done something similar using the Robot Operating System (ROS). It makes streaming data really easy, although it might be more than you're asking for, and I'm not sure how much support for RPi there is. Basically, after installing ROS, you would just need to download  the mjpeg_server (http://ros.org/wiki/mjpeg_server) package for streaming video and rosbridge (http://www.ros.org/wiki/rosbridge_suite) for streaming other types of data. ROS probably already has support for your webcam, but you'd probably have to write ROS nodes to collect other sensor data and publish them to topics. With rosbridge, you can easily expose those topics to the web on websockets.</p>

Title: Stream Real-time Video with Environmental Data Overlaid

Body: I want to embed environmental data collected from sensors into a live video stream from a camera. Has anyone done this or know how I would go about doing something like this? Is there a library available for the arduino or RPi?</p>


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

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

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

Thanks for your help.

答: ST Robotics have an infra-red sensor system that will stop the robot if you get into the workspace. https://www.youtube.com/watch?v=WqJK1xXTWJQ. You still cant actually share the workspace but can work next to it. ~~ David Sands</p>

Title: Sensors in Collaborative Robots


答:
Nvidia Jetson TX2, I have one and it is pretty fast. There are so many boards, I prefer ARM for prototyping, but you can use notebooks, Intel IoT boards, Mbed like Nucleo, small motherboards. It is huge the number of possibilities.

Kinetic does not need much processing for create a point cloud so you don`t need nothing fancy.

Title: ROS + SLAM + kinect. which platform to use?

Body: I am doing a project where I've robot which will be using kinect + ROS for Simultaneous Localization and Mapping. Which board should I use? I've heard that Raspberry pi , beaglebone are not sufficient. </p>


问:
When is the case to use hard real time?
If I use an industrial robot with its hardware controller, should I install linux hard real-time like xenomai to use this kind of hardware controller?

If not, when is the case to use xenomai?

答:
In general, hard real-time OSes are used when there is a (usually periodic) task that is terminally critical, i.e. a process that needs to be run every few milliseconds, for example, and which, when queued, must be completed within a given time window to avoid a system failure. Note that "system failure" in this case doesn't have to mean that it will fry your CPU or break your robot, but instead that the resulting behaviour is considered a breach of the system's critical specifications, such as user safety or the like.

You may want to check out the criteria for different categories of real-time computing on Wikipedia

Title: When is the case to use hard real time?


问:
Type of power connector on the new Kawasaki controller
The current Kawasaki robot controllers are equipped with a power connector different than the one on prior controllers (see pictures below). I need to order this type of plug and can not find out the type of the connector or any information about it.

Does anyone recognise this connector and could provide it's type or any information that could lead to the type?

答:
The connector has "TE" and "DYNA CLAMP" emobssed on it. TE would be TE Connectivity, so I went to their site and searched Dyna Clamp. Got some results, went to Digi-key and did some checking, and it looks like the connector you have is (drum roll)

A TE Connectivity AMP Connector, p/n 1-917807-2.

The link above will take you to the Digi-key page for the part that you have. If you scroll down the page a little you will see a section of "mating connectors," of which there appear to be four:

A panel mount plug, for installation in a piece of sheet stock, p/n 1-917809-2,

A through hole, right angle plug, for installation in a circuit board, p/n 1-1123309-2,

A through hole, right angle plug, for installation in a circuit board, p/n 1-1318983-6 (the connector here is rotated 90 degrees, so it lays "side down.")

And finally, the one you may be after:

A free-hanging (in-line) plug, p/n 1-917808-2.

I personally think Digi-key charges an arm and a leg for shipping, so be sure to order all the parts you need at once. Don't forget the connection tabs, which are the actual little metal blades that make up the connections - these are not generally sold with the connectors. There's a crimping tool that you should probably get if you're going to be making up a bunch of these connectors, but you could probably get by with pliers if you're only doing a couple. I'd definitely buy a lot more of the little blades than you think you'll need and practice before you do it for real.

There's also a removal tool that I'd suggest getting, again if you're planning on making up a lot of these. I don't think I've used these connectors specifically before, but I think you can generally release the TE connector pins if you have a pick or very small screwdriver.


问:
normalized point coordinates in undistortPoints function
In undistortPoints function from OpenCV, the documentations says that

http://docs.opencv.org/2.4/modules/imgproc/doc/geometric_transformations.html#undistortpoints

where undistort() is an approximate iterative algorithm that estimates the normalized original point coordinates out of the normalized distorted point coordinates (“normalized” means that the coordinates do not depend on the camera matrix).

It seems that the normalized point coordinates is obtained by adding 1 to the third coordinate. What does normalized point coordinates means? How can it be used for?

In the above, there are two lines

x" = (u - cx)/fx

y" = (v - cy)/fy

Is there one term for the coordinates(x'', y'')?

答:
http://docs.opencv.org/2.4/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html, this link maybe helpful. Here is my answer based on that.

1.What does normalized point coordinates means?

In the pinhole camera model
$$
\begin{bmatrix}
x \\ y \\ z
\end{bmatrix}
= R
\begin{bmatrix}
X \\ Y \\ Z
\end{bmatrix}
+ t
$$
$$x'= x/z$$
$$y'= y/z$$
$$u = f_x * x' + c_x$$
$$v = f_y * x' + c_y$$

so (x', y', 1) is the normalized point, it means two things:

normalized point does not depends on the camera matrix

normalized point does not depends on the scale factor

In fact, (x, y, z) are the coordinates of a 3D point in the camera coordinate space

2. How can it be used for?

Before explaining how i use it, i'd like to give you the pinhole camera model with distortion consideration, so the equation above is extended as:

In my application, i use it to do back projection of 2D image point to 3D model point:

use undistortPoints function to get undistorted normalized point (x', y');

solve the pinhole camera model equation to get 3D model point.
$$
z\begin{bmatrix}
x' \\ y' \\ 1
\end{bmatrix}
= R
\begin{bmatrix}
X \\ Y \\ Z
\end{bmatrix}
+ t
$$
where $Z$ is known.

3. Is there one term for the coordinates(x'', y'')?

i'm not sure about that~


问:
What is the difference between speed encoders and esc
I understand that motors come with recommended speed controllers, be it encoders or esc. But what is the difference between the two?</p>

答:
If you are talking about an encoder that would be used on a motor, an encoder is the device that encodes the position of the motor into a particular format, so used to determine the exact physical position of the motor at any one time, where as an ESC or Electronic Speed Controller is used to actually drive the motor to a different speed.

Generally speaking, the ESC would be used to make the motor turn and the encoder would be used to tell you what position the motor is in. Some ESC's have a sort of inbuilt encoder that detects what phase angle the motor is in so it can control the motor effectively, this is usually used on brushless DC motors.

Hope this helps.


答:
ESC can use back EMF or encoder to know the speed of motor, they can balance current to keep torque or speed constant.
I you are going to use a BLDC motor I suggest using VESC, is a very good esc, opensource and lots of people use it.</p>

Title: What is the difference between speed encoders and esc

Body: I understand that motors come with recommended speed controllers, be it encoders or esc. But what is the difference between the two?</p>


问:
Single camera vision and mapping system
Some time ago I saw a demo of a small 'toy tank' with a single camera mounted on it. This tank was able to drive around the floor and detect objects and then move/steer to avoid them.
The interesting part was that it used a single camera vision system and as far as I remember was taking advantage of the floor being flat. and then using the rate a feature was moving in the scene relative to the motors and directions of travel to evaluate and hence map the scene.

Can anyone send me pointers what to search for to get some more information on this, or some pointers to codebases that can do this.

The reason I ask is that this was a single camera system from a number of years ago (5+) and therefore (from what I remember) was a relatively low compute load.
I was intending to try this out on a Raspberry PI to build a car/tank that maps a room or set of rooms.

答:
It could have been using Parellel Tracking and Mapping PTAM. PTAM is an implementation of the Simultaneous Localization and Mapping (SLAM) problem that uses a single camera to build a 3D map of the world and localize by tracking visual features.

My team once experimented with using the PTAM package in ROS.

We were running Ubuntu on an Intel Atom, and as I recall it didn't grain too much of the processor. We didn't end up using though, mainly because we couldn't get it to find enough features in the environment where our robot would be running.

Title: Single camera vision and mapping system


答:
hard RTOS is up to few microseconds to nanoseconds, soft RTOS is between miliseconds to microseconds.

It depends how fast you are getting data from the sensors and how fast you need the controller to react. Most cases ubuntu works fine and you can use ROS. In cases of hard RTOS I prefer micro kernels like QNX.

If really want to get the best out of your industrial robot just go for a micro-kernel like QNX, there are ways to install modified versions of ROS then you can work over built controllers by the community. There are lots of good things already developed that will spare a good time.

Title: When is the case to use hard real time?

Body:
If I use an industrial robot with its hardware controller, should I install linux hard real-time like xenomai to use this kind of hardware controller?

If not, when is the case to use xenomai?


问:
Process noise and Measurement noise in Kalman filter
I am doing the robot localisation project. Now I stuck on the effect of measurement and process noise in Kalman filtering. Could you please explain what impacts they have while estimating the position of the robot?! I mean how the error ellipsoid(which shows the pose uncertainty) changes with respect to changes in process and measurement noise?!

To estimate the pose of the robot, the two sources of information (dead-reckoning estimation and sensor measurements) are combined with Kalman filter.

Cheers,
nekromant

答:
Basically, the relative magnitude between process and measurement noise determines how much to trust a new sensor measurement. In one extreme, if the process noise is zero the kalman filter will effectively ignore new sensor measurements because you've told it the process model is perfect (i.e. zero noise).

At the other extreme, if you set the process noise very large and the sensor noise very small it is like resetting the state to match the sensor reading. If your time updates happen at the same time as sensor updates, then this is effectively the same as just using the sensor without a filter. If your time updates happen faster than sensor readings, then you'll see the state drift according to your model during time updates and then do a sharp reset when the sensor reading arrives.

In practice you likely have a noisy sensor and probably don't want to follow it exactly so you need to keep the sensor noise magnitude sufficiently large. If the system is drifting too much because of inaccuracies in the process model you add more process noise until you hopefully reach a happy medium.


问:
Cannot see ground plane patterns with LiDAR
I mounted VLP-16 on the roof of my car while driving, I was expecting the lidar to detect the lanes on the ground since the white lines should have higher reflectivity.

But in fact I cannot see any patterns on the ground.   This is  my rviz screenshot, I can get some higher intensity value on vertical objects, but cannot detect the lanes on the ground.

Is this normal? Do I need to calibrate my lidar for lane detection?

答:
VLP - 16, isn't capable of detecting lanes / strips on road, this lidar is not that sensitive, as per my research**

You are more likely to get interest into image processing or look how a line follower robot works.


问:
Robot Veering to the Left
I'm currently programming in RobotC, for a Vex 2.0 Cortex. I'm using encoders to make my robot go straight.

This is my code:

```<code>#pragma config(I2C_Usage, I2C1, i2cSensors)
#pragma config(Sensor, dgtl2,  ,               sensorDigitalIn)
#pragma config(Sensor, dgtl7,  ,               sensorDigitalOut)
#pragma config(Sensor, I2C_1,  ,               sensorQuadEncoderOnI2CPort,    , AutoAssign )
#pragma config(Sensor, I2C_2,  ,               sensorQuadEncoderOnI2CPort,    , AutoAssign )
#pragma config(Motor,  port1,           RM,            tmotorVex393_HBridge, openLoop, reversed, encoderPort, I2C_2)
#pragma config(Motor,  port10,          LM,            tmotorVex393_HBridge, openLoop, encoderPort, I2C_1)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

/* Port 1 is right motor*/

//all functions expect no reverse motors (in port menu)
//**GLOBAL VARIABLES**
int buttonSTATE = 0;

//**MOVE FUNCTIONS**
void goforwards(int time)
{
    int Tcount = 0;
    int speed1 = 30;
    int speed2 = 30;
    int difference = 5;

    motor[LM] = speed1;
    motor[RM] = speed2;
    while (Tcount < time)
    {
        nMotorEncoder[RM] = 0;
        nMotorEncoder[LM] = 0;

        while(nMotorEncoder[RM]<3000)
        {
            int REncoder = -nMotorEncoder[RM];
            int LEncoder = -nMotorEncoder[LM];

            if (LEncoder > REncoder)
            {
                motor[LM] = speed1 - difference;
                motor[RM] = speed2 + difference;
            }
            if (LEncoder < REncoder)
            {
                motor[LM] = speed1 + difference;
                motor[RM] = speed2 - difference;
            }
            wait1Msec(100);
        }
        Tcount ++;
    }
}

//**CONTROL STRUCTURE:**
task main()
{

    goforwards(1);
}
</code>```

When I execute the code, the Robot's encoder values are very close, but the robot quickly starts to veer to the left. What are possible causes of this? Is it something in the code?

答:
You can troubleshoot, send some value which lock at certain speed to left motor and read the speed,
Send same vlaues to right motor and again read the speed again.
Compare results,Watch for current draw in both the cases.

Try switching the channel of motors on bridge.

If the values are same and you get different speed, then there should be problem in hardware.

Title: Robot Veering to the Left


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

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

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

答:
As you are using the Arduino, you should leverage the most from the community libraries. My advice would be to use the PID library.

There is a detailed explanation about how the library works in that page. It is a link to the creators's blog. Also with explanations about how to tune up the Kp, Ki and Kd.

I have a similar project and it turned out to be too imprecise for us to use only a magnetometer. The worst scenario for a robot is to be next to a source of interference ( like a TV or a big metallic structure ) and then move several meters based on the decision taken when turning.

To solve these issues, we used a gyroscope ( L3G4200D in our case ). This is the code that we ended up using:

```<code>  unsigned long amount_off_target ;
  L3G4200D gyroscope;
  while (!gyroscope.begin(L3G4200D_SCALE_250DPS, L3G4200D_DATARATE_400HZ_50))  // Set scale 250 dps and 400HZ Output data rate (cut-off 50)
  {
    Serial.println("Could not find a valid L3G4200D sensor, check wiring!");
    return;
  }
  gyroscope.calibrate(100);

  // here it goes some code referred to our encoders

  double Setpoint = 0, Input = 0, Output = 0;
  const double scale_factor = 7000000.0f;
  PID myPID(&Input, &Output, &Setpoint, 9.5 / scale_factor, 4 / scale_factor, 3.5 / scale_factor, DIRECT);

  myPID.SetMode(AUTOMATIC);

  myPID.SetOutputLimits(-50, 50);   // these parameters are related to your particular motor PWM values
  int min_power = MN_POWER+35;

  long z_total = 0;
  Input = 0;
  const long target_z = long(float(degs) * (90000000.0f / 90.0f));
  unsigned long last_off_target = millis();
  unsigned long last_read_sensor = micros();
  const unsigned long started_turn = millis();

  Setpoint = target_z;
  // Grace period to start moving
  long last_not_moving = millis() + 50;

  int direction;

  while ((millis() - last_off_target) < 100L && (millis() - started_turn) < 2000L)
  {
   // more code about our encoders goes here
    const long now_millis = millis();
    const long bump_min_speed_frequency = 10;

    amount_off_target = abs(z_total - target_z);
    if (amount_off_target > 2506516L) {   // here you decide that you are on target
      last_off_target = millis();
    }

    const unsigned long read_sensor_time = micros();
    Vector norm = gyroscope.readNormalize();
    const long time_since_read = (read_sensor_time - last_read_sensor);
    last_read_sensor = read_sensor_time;

    long yaw = (long)norm.ZAxis;
    z_total += yaw * time_since_read;

    Input = double(z_total);
    myPID.Compute();

    if (Output > 0) {
      direction = 1;
    }
    else {
      direction = -1;
    }

    int mtr_pwr = min_power + abs(Output);

      motorRight( mtr_pwr, -direction);
      motorLeft( mtr_pwr, direction);

  }
</code>```

I hope that this works as a general principle of implementation. The main code structure can be easily understood if you look at this PDF explaining it.

The code was tuned up by a real rockstar coder that worked with our team and it works surprisingly well in many diverse surfaces. You might notice that it overshoots a bit when it's on glass and undershoots when it's on a thick rug.

Title: PID control of tank-like robot and IMU

Body:
As you are using the Arduino, you should leverage the most from the community libraries. My advice would be to use the PID library.

There is a detailed explanation about how the library works in that page. It is a link to the creators's blog. Also with explanations about how to tune up the Kp, Ki and Kd.

I have a similar project and it turned out to be too imprecise for us to use only a magnetometer. The worst scenario for a robot is to be next to a source of interference ( like a TV or a big metallic structure ) and then move several meters based on the decision taken when turning.

To solve these issues, we used a gyroscope ( L3G4200D in our case ). This is the code that we ended up using:

  unsigned long amount_off_target ;
  L3G4200D gyroscope;
  while (!gyroscope.begin(L3G4200D_SCALE_250DPS, L3G4200D_DATARATE_400HZ_50))  // Set scale 250 dps and 400HZ Output data rate (cut-off 50)
  {
    Serial.println("Could not find a valid L3G4200D sensor, check wiring!");
    return;
  }
  gyroscope.calibrate(100);

  // here it goes some code referred to our encoders

  double Setpoint = 0, Input = 0, Output = 0;
  const double scale_factor = 7000000.0f;
  PID myPID(&Input, &Output, &Setpoint, 9.5 / scale_factor, 4 / scale_factor, 3.5 / scale_factor, DIRECT);

  myPID.SetMode(AUTOMATIC);

  myPID.SetOutputLimits(-50, 50);   // these parameters are related to your particular motor PWM values
  int min_power = MN_POWER+35;

  long z_total = 0;
  Input = 0;
  const long target_z = long(float(degs) * (90000000.0f / 90.0f));
  unsigned long last_off_target = millis();
  unsigned long last_read_sensor = micros();
  const unsigned long started_turn = millis();

  Setpoint = target_z;
  // Grace period to start moving
  long last_not_moving = millis() + 50;

  int direction;

  while ((millis() - last_off_target) < 100L && (millis() - started_turn) < 2000L)
  {
   // more code about our encoders goes here
    const long now_millis = millis();
    const long bump_min_speed_frequency = 10;

    amount_off_target = abs(z_total - target_z);
    if (amount_off_target > 2506516L) {   // here you decide that you are on target
      last_off_target = millis();
    }

    const unsigned long read_sensor_time = micros();
    Vector norm = gyroscope.readNormalize();
    const long time_since_read = (read_sensor_time - last_read_sensor);
    last_read_sensor = read_sensor_time;

    long yaw = (long)norm.ZAxis;
    z_total += yaw * time_since_read;

    Input = double(z_total);
    myPID.Compute();

    if (Output > 0) {
      direction = 1;
    }
    else {
      direction = -1;
    }

    int mtr_pwr = min_power + abs(Output);

      motorRight( mtr_pwr, -direction);
      motorLeft( mtr_pwr, direction);

  }

I hope that this works as a general principle of implementation. The main code structure can be easily understood if you look at this PDF explaining it.

The code was tuned up by a real rockstar coder that worked with our team and it works surprisingly well in many diverse surfaces. You might notice that it overshoots a bit when it's on glass and undershoots when it's on a thick rug.


答: You should find it useful to read this https://www.researchgate.net/project/A-Preview-of-Introduction-to-Fundamental-Principles-of-Dynamic-Real-Time-Systems. "Hard" real-time is a special case of the general case of "real-time." You can easily find that there are as many ad hoc "definitions" of all real-time terms as there are sources for those "definitions." That is a major disruption to both commerce and R&D in the real-time field. Such a thing is unimaginable in any other engineering or science field.</p>

Title: When is the case to use hard real time?


问:
Association of multiple measurements to multiple objects
I have a matrix of M measurements and N objects. Each cell contains a cost of assignment a particular measurement to the object. I want to assign them optimally. As the condition, only one measurement can go to one object, and one measurement can go to only one object. I want to set some cost threshold, in effect there may be some measurement or object, which is not assigned at all.
How can I do it?
I was recently thinking of the auction algorithm, which however will never leave any unassigned measurement or object. If that is false, correct me please. Or help with some alternative solution. Thanks for your time!</p>

答:
The Hungarian Algorithm should be suitable for this case. You have already generated the cost matrix that describes the cost of each measurement to each object. The algorithm determines the assignments that yield the minimum total cost. It can handle cases with more measurements that objects (false positives) and more objects than measurements (when an object isn't detected). (These cases have non-square cost matrices.)

This will assign all measurements if the number of objects if M measurements <= N objects. However, you can then go back and look at the individual costs of the assignments and apply a threshold to weed out matches with low scores.

There are many libraries in various programming languages for this algorithm. One I've used and is well documented is the munkres python library.


问:
Are robot's codes usually compiled or interpreted?
I would bet that usually these are compiled for better performance, and of lawful reasons (make it harder for any user to save code without decompiling), though I'm not sure.

In any case, I believe performance is the major consideration (I'm very new to programming and cannot tell how data processing of robots is different, say, than that of high-end PC games or heavy PC software and if performance considerations will be usually similar or how different).

Are robot's codes usually installed when compiled from source code in an external computer or as pure source codes interpreted by some engine installed on the robots operating system?

(please example on JavaScript and Raspberry pi if possible at the moment).

答:
Robots tend to be portable devices powered by batteries.  Portable battery operated devices tend to use embedded processors with limited power and memory. Compiled code has several advantages over interpreted code in such applications:

Compiled code usually takes up less space.  So you can have more code
in the same amount of space.

Compiled code usually execute faster.  So batteries last longer.

An interpreter does not need to be installed into the robot's limited
memory.  This frees up more space for code or data storage.

As compiled code usually requires less resources on the mobile
platform, the mobile platform can be made with less expensive
parts.

That said, it is not necessarily true that compiling code obfuscates it.  If enough effort is invested, nearly any compiled code can be understood.  It then becomes a matter of which is more efficient.  Replicating the features or backward engineering the compiled code.

Why most people tend to use interpretive languages such a Python on a Raspberry Pi is confusing.  (The Raspberry Pi is fast becoming a complete computer.)  This is likely because interpretive languages tend to be less confusing to use.  Where compiling code adds steps to the development process, interpretive code is simply run after specifying the interpreter.


问:
Communicate with Roomba 871
I have a Roomba 871 and I am trying to communicate with it through the sci port.
I am using RealmTerm for testing, I am trying it with the How to Program Roomba - RealTerm Terminal guide.

If I try it with a baud rate of 57600 the only thing I am able to is to get the Roomba to perform an spot cleaning. To get to that the only thing I have to do is to send it an value of 130-139, 230-239, 330-33... But I have to send it as ASCII not as Numbers, like mentioned in the description above.

If I try it with a baud rate of 115200 the only thing I am able to do is to switch it off. But then it is switched off until I lift the Roomba up. Pushing the Power button does noting in that case. To switch it off I send the numbers like in the description above: 140 0 1 62 32  but send as numbers!

So this is quite strange and I really don't know what to do, so please help.

答:
The right baud rate is 115200. If you did not changed it.

You need to send decimalcodes:

128 to start the interface.

135 to start or stop cleaning.

Try 128 135 at first.

Please refer to iRobot® Create® 2 Open Interface (OI) Specification

Here you find HTerm with roomba commands: https://static.vvcc.de/roomba/hterm_roomba.zip. Maybe it helps you. Just drag and drop roomba.cfg to HTerm.exe. No installation needed.

Title: Communicate with Roomba 871


问:
Software for robot parts interaction modeling
I'm robotic engineer, using OpenSCAD to model robotic components (gears, pulleys, parts, etc). But I need an application to model the physics and interaction of the components (for i.e. how will robot move if I rotate a given gear).

So, is there any software I can use for modelling interactions in Linux? Google SketchUp is good, but I can't use it in Linux.

答: Have you considered modeling the robot in a simulator? V-REP is new and quite good, having lots of examples robots from other famous projects. Gazebo is another popular one that is usually used with ROS (although V-REP also has ROS support). Both run on linux and are open-source.</p>


问:
Is there a better type of sensor to measure the distance instead of Ultrasonic sensors
We know that the Ultrasonic sensors can't accurately measure the distance to an object that

is more than 3 meters away (the distance may vary on brands)

has it's reflective surface at a shallow angle (the angle may vary on brands)

is too small to reflect enough sound

Also the environmental influences such as air tempereture, air pressure, air currents, humidity, mist and types of gas cause inaccurate measurements. Which sensor should i use to get the best measurements ?

答: Yes, there are IR sensors as well, which provide ranges up to 3-4 meters Pololu Range Finder. Also, we can find Laser range finders that measure up to 30m distance. But these Laser range finders are expensive in compared to ultrasonic sensors and mostly used for mapping purposes.</p>


问:
Can someone explain what is going on in this calibration video?
I am trying to understand this IMU calibration video.

https://www.youtube.com/watch?v=xF7sLU0fX7k&feature=em-comments

In the video the operator gets accelerometer data when pointing each axis in the gravity direction. He then has an algorithm at minute 6:34.

I don't know where this algorithm comes from.

My understanding of how you get an accelerometer bias is you add the output when an axis is pointing in the gravity direction to the output when that axis is pointing antiparallel to gravity and then you divide by 2. Where is he getting this algorithm?

答:
Let b, the bias error of a sensor.

If you take two measurements of a known value (gravitational acceleration in this case), in opposite directions, say m1 and m2, without any bias towards any direction the following is true:

1) m1 + m2 = 0.

However, if there's a directional bias error, the sensor readings become:

2) (m1 + b) + (m2 + b) = 2b.

Hope this gives some explanation.


问:
How can I draw with a 3 DOF RRR arm ,I have done the Forward and Inverse KInematics
Heres the Matlab code, I start with x and y and when I pass it through IK and Fk I get back the correct x and y thus I am confident that IK and Fk are correct.

```<code>x = 10; y = 10; z = 0;
a2 = 7.5; a3 = 9;
r = sqrt(z^2 + y^2);

th1 = atan2(y,x);
th3 = acos((r^2 + x^2 - (a2^2 + a3^2))/(2*a2*a3));
th2 = atan2(x,z) - atan2(a3*sin(th3), (a2 + a3*cos(th3)));
T0 = compute_dh_matrix(0,0,0,0);
T01 = T0*compute_dh_matrix(0, -pi/2, 0, th1);
T02 = T01 *compute_dh_matrix(7.5, 0, 0, th2-pi/2);
T03 = T02 *compute_dh_matrix(9, 0,0 , th3);
T03(1:3,4)

%ans =
%
%    10.0
%    10.0
%       0
</code>```

I have tower pro micro servos SG90 for base, shoulder and elbow joints.I am giving power using a mobile charger which outputs 5V and 2A.Now I want to try drawing some simple shapes with this robot I tried giving it the sequence of x and y locations with z=0, but the results seem not good.Do I need another DOF on the end effector?Is there any way to map x-y to the theat_start - theta_end for every angle?This is the diagram of the robot,
 I have a small change as my zero position is upright not with a bend like below but the rotation and angles are the same..

Now I am trying to draw in X, Y plane as Z is zero all the time.a2 and a3 are the link lengths.I don't know how to control the speed of the servos I just hacked the sweep code from Arduino.I just want to draw some basic shapes or a line, I tried giving (9,9), (10,10) and (11,11) thinking it will draw a line.

These images show my setup in detail.I haven't taken all the offsets yet.I was getting close but not exact x and y that I entered into the IK->FK functions so I thought I could just work with less accuracy to get results quick.If you can help with IKfor offsets it would be great too.

I really hope this is a problem that you guys consider as per the rules and as I have done work on FK and IK I hope this question makes sense.Thank you.

答: If you consider your robot's pose in the plane of the upper arm and forearm, you'll see that you have a 2dof planar mechanism which gets rotated by the waist joint.   With only 2 dof in that plane, you can specify the x and y coordinates where you want to draw, but you cannot independently change the angle of the tool tip - it will be whatever it needs to be to reach those coordinates.  Your only options are to draw with a pen or brush that has a very large drawing tip (and hopefully circular or spherical), or to add a single wrist motor with which you can change the angle of the pen.   You'll have to solve for 4 dof inverse kinematics in this case.


问:
Pushing Buttons Remotely over Ethernet
So I want to program something that will simply push a button, but controllable over ethernet.  I'm new to robotics so I don't know where to start.  What's the best way to control an actuator over a network connection?</p>

答:
Are you talking about something similar to this setup? If so, the code in this thread could be helpful, as well as the video found here.

What I focused on was first getting Arduino to work as a Web-server (a bit like this), then including hyperlinks in the Arduino-generated page that would then allow me to control the actuator.

Title: Pushing Buttons Remotely over Ethernet


问:
Disturbance rejection of PID controller with low sampling rate
I have a closed-loop system with the following discrete-time plant:

$P(z) = \frac{0.1262}{z^2-0.3303z+0.07517}$

With a fixed (and horrendously low) sampling time of 0.05 seconds. The plant has a time constant of approximately 0.03 seconds - this was calculated using MATLABs System Identification Toolbox.

I am trying to design a PI/PID controller that will attenuate load disturbances (injected after the plant) with frequencies < 1 Hz without amplifying higher frequencies. No matter how much I play with the gain and phase margins, I cannot seem to achieve this.

Seen below, is a picture showing a nasty bump between 1 and 6 Hz (circled in red) that I cannot seem to remove and retaining disturbance rejection at low frequencies.

I believe that this is an impossible task to accomplish with such a low sampling rate. If so, are there any other control typologies I can take a look at? In the past, I designed a Smith predictor, and yes it improved disturbance rejection but not by very much - I am still getting amplification at higher frequencies.

Thank you,

答:
Because the plant has a delay of two samples it will never be possible to cancel the disturbances completely, because then you would have to predict the disturbance those two samples ahead of time. Also a Smith predictor is therefore only useful for obtaining a desirable complementary sensitivity transfer function.

I also believe your are limited by the waterbed effect. According to this attenuating below 1 Hz and not amplify above that would be impossible. I gave it a try myself and was able to limit the peek of the sensitivity function to 4.06 dB while still satisfying the attenuating below 1 Hz. However lowering it to attenuating below 0.6 Hz gave me a peek of only 1.54 dB. Namely the waterbed effect roughly says that if you want to lower the magnitude of the sensitivity in a certain frequency range, then it has to go up somewhere else.


问:
Which is the best visual fiducial marker (2D barcode)?
Which is the best visual fiducial marker (2D barcode) for detection and robust and accurate pose estimation? </p>

<p>Im not looking for a fiducial marker which can store lot of information. The main goal is just to get the pose of the marker with respect to the camera as accurate as possible. </p>

答:
AprilTag is the state-of-the-art solution for pose estimation. The library itself already has pre-built functions to compute the marker position, given its size. The pose is estimated by homography decomposition and it's quite good if you don't go too far (2 or 3 meters for a 20cm marker). There is the C implementation made by the authors at University of Michigan (now AprilTag 2, look here) or you can go with the MIT C++ implementation of the original algorithm, here.

There are many kind of fiducial markers anyway, and it is very difficult to tell which should be the best for you. For a recent project in which I had to estimate the marker poses from a monocular camera mounted on a quadcopter I made a modified version of the AprilTag adding circles around the marker to improve pose stability. Also, I preferred to compute the pose using the Perspective-N-Point method, by using the solvePnP function included in OpenCV.

I see now this nice novelty, STag: you could also give it a try... seems promising, never used though, is really new (July 2017)


问:
How to calculate my power supply voltage and current?
My stepper motor specifications:

Phase = 2

step angle = 200 step/rev

voltage = 12 V

current = 0.33A/phase

resistance = 34ohm/phase

Inductance = 46omh/phase

holding torque = 23N.cm min

detent torque = 4.6N.cm min

I am making a CNC machine so I need the power supply to power 3 of my stepper motor with these ratings. Can someone calculate the power supply voltage and the current I should get to power my CNC stepper motors?

答:
The given current per phase is an approximate value which you could have calculated by Ohm's Law - it is just the voltage (12V) divided by the resistance per phase (34 ohms):

12 / 34 = 0.353A

This is the maximum current that the motor windings can handle without overheating (which is why they're rounded it down to 0.33A/phase).

How much current the stepper motor will actually draw depends on how you intend to use it. However, stepper motors draw the most current when they are standing still. This means that Ohm's law (above) can to used to calculate the current requirements of the driver.

You have 2 phases, and a current per phase of 0.33A, so your total current shouldn't exceed 0.66A per motor.

If you're using 3 motors, and a 12V power supply, your total current should not exceed 0.66A per motor x 3 motors = 1.98A.


问:
Mathematical prerequisites for beginning graduate student in robotics
A beginning graduate student in robotics asked me the areas of mathematics that he should brush up on (prerequisites) to begin a masters research program in robotics. What are some good materials/books that are indispensable for a research student? Which ones should we suggest in order that the student develops a solid foundation in robotics?</p>

答:
A good approach would just be to research robotics programs and see what books they have for different classes that could help build a foundation.  Personally I've used this book for a robotics/mechatronics class but it was for undergrad

http://www.amazon.com/Introduction-Mechatronics-Measurement-Systems-Alciatore/dp/0071254072

If you want to build more than a foundation, it would be wise to look up top schools in robotics and find out what books they use.  Most would be in syllabus that can be found by searching the school, class title and maybe a current professors name.


答: One approach would be to use and Arduino with an ethernet shield. There are plenty of examples online for both of these devices. From there you would just need to create a GUI and the build your robot to push the button.</p>

Title: Pushing Buttons Remotely over Ethernet

Body: So I want to program something that will simply push a button, but controllable over ethernet.  I'm new to robotics so I don't know where to start.  What's the best way to control an actuator over a network connection?</p>


问:
How to get longest flight time on octocopter that has decent payload already on it?
I want to design an octocopter that will respond to incidences of crime and terrorist attacks. Survey and gather intel and come back to HQ. I have used a 16000mAh 6S lipo battery with no lead, but only can  flight 20mins.
I want this Octocopter to carry radioactive/chemical testing equipment and have a flight time of 45 mins
How likely am i to achieve 45min flight times?
There must be a way of optimizing flight time. I know i can double the amount of batteries but this may make the craft unstable I may need to scale up on motor size to make payload less of an issue..
The larger the craft the more dangerous and costly the craft. So i'm really interested in optimizing it the best i can.
I know there are hydrogen fuel cells, maybe some other sort of alternative battery.
Please help thanks</p>

答: Hello I have experience in building rigs for all sorts of uses. If you are from any rescue service I suggest you contact someone proffesionally. Hydrogen fuel cells I think are overkill. Try 20000mah batteryes and make a hexacopter or quadcopter with more powerfull motors to compensate wattage. I am guessing your best bet in flight time is about 30-40 mins since the record is just bellow an hour. I guess you are informed on long range systems and athaurized to fly in urban areas. You should set a budget since this builds get extreemly expensive. Good flight times are achived trying. And about the chemical stuff I don´t think you can fly that over an urban area</p>


问:
Why do we need ROS?
I'm a beginner in robotics and I'm planning to do a basic navigation problem for differential drive robot. I know the concept involved and can code it in the arduino but I came to know about ROS and other robotic toolbox.

How is it useful if I wanted to improve myself in the concepts from scratch?

答:
I think it is safe to say that ROS adds a lot of value to many robotics applications, but it definitely isn't appropriate for every robotics application

In fact, the ROS website has a series of pages that address that very point. These pages explain

the major broad advantages of using ROS,

the core components that go to make up ROS, and also

describe how ROS integrates with other libraries used in
robotics.

The single major disadvantage with ROS is actually the time that it takes to learn ROS. It is not an easy learning-curve for people new to robotics, and it can take a long time before you are able to enjoy the benefits.

That said, there are now rather more "accessible" texts on ROS available on the market. For example, A Gentle Introduction to ROS and ROS Robotics By Example. These can make that learning-curve a little less daunting.

In your specific case, where you are looking at coding for a basic navigation problem for a differential drive robot using an Arduino, it is unlikely that ROS would be appropriate. It isn't possible to run ROS on an Arduino (although it is perfectly possible to run ROS on a Raspberry Pi).

Title: Why do we need ROS?


问:
Permission to fly UAVs
Okay, this might sound like a stupid question but, is there some sort of a permission in the US I might require to fly a quadcopter or a UAV for that matter? I couldn't find much help anywhere else.  </p>

答:
You can fly anything you want in class G airspace. Generally speaking, if you're far from any airport or military training area, you are probably walking around in  class G. To be sure, though, you should consult a current FAA sectional chart for your area.

Class G is considered "uncontrolled" by the FAA. Note however that there are other regulations and agencies that restrict flight activities there. Sadly there is no "easy" answer in U.S. airspace.

In most cases, except for special situations like in the mountains, Class G extends up to 1200 ft above the ground (AGL).

I'm quite familiar with airspace rules because of my previous job (UAV operator).  I guarantee you can fly anything you want, but see for yourself: http://en.wikipedia.org/wiki/Airspace_class_(United_States)#Class_G

Title: Permission to fly UAVs


问:
Calculated yaw angle is not poper (EKF)
I used EKF to observe the quaternion and extract the roll, pitch  and yaw angles. The used sensors are Gyro sensor and acceleration sensor.

The roll and pitch angle looks like proper but the yaw angle is not proper.

In this case , I can't get the correct yaw angle? If I add a magnetic sensor and estimate the state using EKF, could I  get the proper yaw angle?

答:
Yes, you need to add another sensor such as magnometer. The accelerometer tells you which direction is 'down'. Whether you are facing north, east, south, or west 'down' is still the same so the accelerometer alone can't tell you that information but a magnometer can.

One thing to be careful of is the magnometer will also provide some information about roll/pitch but usually you don't want this. You can either use the magnometer values outside the EKF to estimate yaw, which is fine if you are close to zero roll/pitch, or you can make sure the magnometer weights are smaller than the accelerometer weights.

Title: Calculated yaw angle is not poper (EKF)


问:
Is there a formal name for translating poses into robot states?
I've been working on a module that takes in planar poses $\begin{bmatrix} x_{t_{k}} &   y_{t_{k}} & \theta_{t_{k}}\end{bmatrix}^{T}$ and spits out expected robot states $\begin{bmatrix} x_{t_{k}} &   y_{t_{k}} & \theta_{t_{k}} & \dot{x}_{t_{k}} &   \dot{y}_{t_{k}} & \dot{\theta}_{t_{k}} \end{bmatrix}^{T}$. Essentially, I'm giving the velocity I expect the robot to reach at each pose.

I've been looking for the proper terminology for a module like this, both so I can write more readable code and so that I can do a better literature search. What would this kind of thing be called?

Thanks!

答:
It is a little tough to tell what you are asking because of the limited information.  It would be helpful if you would show how these vectors fit in your control scheme.  However, I'll start an answer and maybe we can arrive at the one you need.

If you are strictly talking about the positions and velocities without regard for how to control them to achieve those poses, then you are just describing differential, or velocity, kinematics.  The arrangement into new pose vectors isn't meaningful in this case.

If you are trying to do this to achieve positional via points which are arrived at with a certain velocity, you may benefit from studying velocity control.  Off the top of my head I believe Hollerbach had some seminal work in this, but I could be mistaken.

If you are actually concerned with the robot's position and velocities as states to feed into a controller, then you should study state space control.  @Chuck has answered some questions with excellent descriptions of state space, and there are numerous other public sources available.

EDIT BASED ON OP's COMMENT

Thanks for describing the scheme.  It would be best to put that into your question since comments can disappear eventually.

You are describing an aspect of robotic controls that is generally called path planning, trajectory generation, or sometimes trajectory planning.  Purists will differentiate between path planning and trajectory planning in that path planning refers to the geometry of the path (in operational and/or configuration space) only, whereas trajectory planning includes a time element.  So your approach is really about trajectory planning, although the literature doesn't always separate the two like that.

The literature in this field includes planning for robotic manipulators, redundant robots, and mobile robots.  Often the path planning problem includes avoiding obstacles or optimizing some run-time criterion.  However, there are also many earlier papers which describe the planning aspect of manipulators without regard to obstacles.  Frequently those papers describe time-optimal methods for achieving target trajectories.

You may want to start your research looking for work by Bruno Siciliano.


答:
It depends on how you compute those velocity coordinates.

For example, if you compute the velocity based on the information about previous (and probably future) poses, it is called interpolation. Literature in this area focuses mainly on polynomial or spline interpolation. But if you do the search, the papers likely appear under the term trajectory generation.

If there are also sensor data and other stuff coming in real-time that you take into account, you might want to search on-line trajectory generation.

If you codes are for mobile robots, you might also want to study nonholonomic constraints as well. (The constraints basically say that an ordinary car cannot move sideways, etc.) So that you can generate achievable velocity.

Title: Is there a formal name for translating poses into robot states?

Body:
I've been working on a module that takes in planar poses $\begin{bmatrix} x_{t_{k}} &   y_{t_{k}} & \theta_{t_{k}}\end{bmatrix}^{T}$ and spits out expected robot states $\begin{bmatrix} x_{t_{k}} &   y_{t_{k}} & \theta_{t_{k}} & \dot{x}_{t_{k}} &   \dot{y}_{t_{k}} & \dot{\theta}_{t_{k}} \end{bmatrix}^{T}$. Essentially, I'm giving the velocity I expect the robot to reach at each pose.

I've been looking for the proper terminology for a module like this, both so I can write more readable code and so that I can do a better literature search. What would this kind of thing be called?

Thanks!


问:
ROS for an autonomous boat
As part of an internship I was asked to design and develop the core control system for an autonomous small-scale (2m length) solar vessel to be able to sail around the Baltic Sea.

The boat should be able to sail following predefined waypoints but, thanks to AIS, Camera (collision avoidance) and a path planning algorithm, redefine its route according to the obstacles sensed. For the hardware part it runs a Raspberry Pi with the high level navigation system and an Arduino to control propeller and actuators as well as provide basic navigation functions in case of Raspberry failure.

Now, before digging into coding I checked for existing solutions and found out the ROS (Robot OS) middleware, which comes with interesting abstractions for the multi-threading and multi-processing, message exchange locally and among diverse hardware architectures (Raspberry and Arduino in this case). However, I am concerned ROS would add considerable load on the Raspberry processor and increase power consumption and it would prevent fine-grained control over hardware, probably system instability too on the long run. The control software has to access sleep functions on sensors and on the Pi itself, in case of power shortages, to dynamically suspend and restart processes and it needs to run 24/7 for months without human interaction.

Is ROS suited for these tasks or should I think about creating a custom software from scratch? Thanks

答:
ROS will work fine for this task. It will add some additional overhead for your Raspberry Pi but it is fairly small provided you only install the Robotic or Base configuration instead of the Full configuration and are using a headless (no GUI) Raspberry Pi install. My company uses ROS on self-driving cars and ROS has, so far, never been the cause of a fault - it has always been hardware- or coding-related. Here is your trade-off:

ROS Pros:

Fairly complete, stable messaging framework.

Allows inter-process message passing without network overhead (see nodelets).

Large library of pre-defined message types and utilities (like tf which does coordinate transforms with very little effort).

Community support for portions of your framework that you wouldn't otherwise have.

ROS Cons:

Some overhead associated with running roscore and the message serialization/deserialization process.

Without implementing the features on your own, there is very little in the way of Quality of Service regarding message transport (this is coming in ROS 2.0).

Only supports Python and C++. This is not a problem for some people but could be a drawback for others.

Title: ROS for an autonomous boat


问:
finding the frequency of CAN send and CAN receive messages using CAN in Ubuntu
Can anyone please share me the command how can i find the frequency of CAN send and CAN receive messages. I'm sending CAN messages using a serial port and receiving it with a peak CAN usb. There is no error no drop messages between both receving and sending sides but i don't know the command to get the frequency. I'm using only simple candump and can send commands in Ubuntu. I know the bps but i want to know the frequency of sending and receiving sides. Thank you</p>

答:
You can pipe the output to wc with the -l flag for line counting:

```<code>candump can0 | wc -l
</code>```

Body:
You can pipe the output to wc with the -l flag for line counting:

candump can0 | wc -l


答:
First, let's consider what actuator you need to physically push a button. One straight forward solution is to use a RC-Servo motor. An RC-Servo motor is a high torque (DC motor with gearbox) actuator which can be instructed to rotate at a specific angle. It is controlled through a PWM signal. So you need to figure out the duty cycle of the PWM signal to do the desired movement and push the button you want.

Secondly we need a controller that:

is able to generate a PWM signal

communicate through the Internet

First thing that comes to my mind is to use a Raspberry Pi. Of course it is a huge overkill to use it just for pushing a button but in the process you will learn a lot of interesting things about setting up Raspberry Pi. You can setup a minimal web-server using python in less that 5 minutes.
Arduino with an Ethernet shield as DaemonMaker suggested is also a great setup.

Title: Pushing Buttons Remotely over Ethernet


答:
For an autonomous boat, you might want to look into MOOS-IVP: http://oceanai.mit.edu/moos-ivp/pmwiki/pmwiki.php?n=Main.HomePageFull.  It is similar to ROS in many respects, but geared towards autonomous boats instead of land vehicles.  However, both middlewares are sufficiently abstract that they can handle land or sea vehicles just fine.

However I can't speak to it's ease of integration w.r.t. ROS, or its ability to run on small processors like the RasPi.  But see comments below.

Title: ROS for an autonomous boat

Body:
As part of an internship I was asked to design and develop the core control system for an autonomous small-scale (2m length) solar vessel to be able to sail around the Baltic Sea.

The boat should be able to sail following predefined waypoints but, thanks to AIS, Camera (collision avoidance) and a path planning algorithm, redefine its route according to the obstacles sensed. For the hardware part it runs a Raspberry Pi with the high level navigation system and an Arduino to control propeller and actuators as well as provide basic navigation functions in case of Raspberry failure.

Now, before digging into coding I checked for existing solutions and found out the ROS (Robot OS) middleware, which comes with interesting abstractions for the multi-threading and multi-processing, message exchange locally and among diverse hardware architectures (Raspberry and Arduino in this case). However, I am concerned ROS would add considerable load on the Raspberry processor and increase power consumption and it would prevent fine-grained control over hardware, probably system instability too on the long run. The control software has to access sleep functions on sensors and on the Pi itself, in case of power shortages, to dynamically suspend and restart processes and it needs to run 24/7 for months without human interaction.

Is ROS suited for these tasks or should I think about creating a custom software from scratch? Thanks


答:
What you are looking to produce is certainly achievable using the ROS middleware. As Joshua has already pointed out, there will be some additional overhead but this should be relatively small.

It is probably worth carrying out a literature search to investigate how other Autonomous Surface Vehicles (ASVs) have incorporated ROS into their software architecture. Published papers on ASVs like the Squirtle should provide you with a useful overview of the pros and cons of incorporating ROS into your design.

As regards the "harsh" environment of the Baltic, I'm aware of a number of ASVs that have been deployed there, for example Roboat, (although I'm not sure whether Roboat actually incorporated ROS). Again, a search of the literature should help you quantify the potential issues and help you decide whether ROS is appropriate.

Title: ROS for an autonomous boat


问:
Inconsistent robot behavior
I am working on a robot project in which I use an arduino mega as the main processing unit, L298N h bridge module as the motor driver and motors like  these in a differential drive configuration. I have a problem dealing with this robot which is simply that the open loop behavior is not consistent. For example, if I give the left and right motors the same PWM input, making sure that both motors have the same effective input (measured by a voltmeter), sometimes the robot goes straight ahead, and sometimes veers to the right.

This is a problem for me because I am trying to build a model for the robot's behavior (knowing the trajectory given the motor input voltages) and at some point I have to estimate the robot parameters (motor constants, robot inertia and other properties) using the parameter estimation toolbox in simulink. Having inconsistent behavior like this causes the estimated parameters to be strange and unrealistic.

Has anybody faced such a problem? what may be the potential causes? non reliable hardware? battery problems? terrain problems (or interaction with the ground)?

Thanks in advance.

答:
You should use feedback. Motor parameters such as internal resistance, torque constant, effective flux per pole would have slight variations even in two identical motors which would result in two slightly different rates of rotation, hence your robot turning. You are also assuming there is uniform grip so equal traction for both wheels, which would not be the case.

Use PID to control your motors and you should be fine. This paper  should be helpful for your particular problem.

Title: Inconsistent robot behavior


问:
Rate random walk from datasheet MPU6050
i have been trying to extract rate random walk paramater from the data sheet but couldnt find any clue ...
is there any way to do  that or what ? how should it be calculated  ?
thanks !</p>

答:
As far as I am aware, figures for random noise coefficients like the Rate Random Walk, or Drifting balance, are not usually included in accelerometer or gyro datasheets (not just the MPU-6050).

Values are normally obtained by creating an Allan Deviation plot as described in this Application Note from Freescale Semiconductor.

I did a brief online search, and I found a paper describing the process for calculating and plotting the Allan deviation function to obtain the Rate Random Walk for an IMU-based attitude sensor using the MPU-6050, which might contain the information you are looking for.

Title: Rate random walk from datasheet MPU6050


问:
Fire Fighting robot searching for fire in arena algorithm
i am working on a firefighting robot and i am struggling to find a way to search all rooms in an arena like this

i thought of using the Wall follower rule but it will miss a room , if i am understanding it correctly.

答:
According to the given map, the robot is the circle and the goals are the crosses. To move to every room a path must be generated first. The path, the robot will travel, is a subgraph of a navmesh. A navmesh consists of possible waypoints which can be visited without bouncing to an obstacle. The most dominant algorithm for finding a navmesh and a path for the robot is the Rapidly-exploring random tree algorithm. A simple version can be found on the homepage of Steve LaValle RRT python. For implmenting a more sophisticated pathplanner which copes with the obstacles the paradigma of objectorientied programming is a good practice. The idea is to use one or more classes for building the obstacle detection, find the shortest path, extend the RRT tree and perhaps visualize the graph in the map.

As inspiration please visit the UML Chart on page 42, Morten Strandberg: Robot Path Planning:
An Object-Oriented Approach, 2004 Thats not a class diagram for a firefighting robot, but gives an impression that building a path planner is done with different classes, which are combined together to a more complex system.


答:
Wall following is a good local strategy, but as you point out it might miss a room because it does not consider the global map. Your problem could be cast as a simultaneous localization and mapping problem (SLAM), where the robot builds a map while it travels around. This way, it can track where it has/has not been and find rooms it missed earlier.

In 2D, you would represent the map using an occupancy grid, which assigns values (occupied, unknown, free) to small squares of space. There many algorithms for handling how to use sensor data to estimate which cells are free/occupied - let's ignore that for now.

Assuming you have perfect knowledge of where you are and what you are seeing, then your grid cells will be in one of three states: occupied, unknown and free. A simple but effective strategy for exploring a room is called next-best view planning, where the robot travels to the location where it thinks it will see the most. This depends on a sensor model (e.g. "can see 5 cells away in all directions but not through walls"), and a model of the room (e.g. "assume straight walls continue going straight"). This planner is greedy, so you will want to enforce some common sense rules to keep it from going to the other side of the room unless there's nothing left where it is.

This is a fundamental problem for roboticists, and there are quite a few packages out there for solving the exploration problem. This ROS package looks like a good starting place (or this one).

Title: Fire Fighting robot searching for fire in arena algorithm

Body:
i am working on a firefighting robot and i am struggling to find a way to search all rooms in an arena like this

i thought of using the Wall follower rule but it will miss a room , if i am understanding it correctly.


问:
cable-controlled flexion and extension
I'm new, please be gentle :-)

I'd like to control the position of a single-axis joint using one cable for flexion and another for extension.

In many of the anthropomorphic designs I've seen each of these cables are controlled by a separate servos, and I'm wondering why.

I'd think the simplest approach would be to use a single servo, and wrap each cable around its spool in opposite directions. Is there a problem with this approach?

(if not, I assume the dual servo design is to control not only the position of the joint, but its stiffness/rigidity?)

答:
Generally speaking, you can't push with a rope.

Tie a rope to a doorknob. From across the room, you can pull the door open, but you cannot push the door closed; the rope just goes slack.

Ropes are only useful when they're in tension.

:edit:

Re-read your question and realize I didn't answer it all all.

Suppose you have a hinge joint. Use the door example again. The cable actuators attach to either side of the door.

As the door rotates, each side scribes an arc, but because the door has a thickness, and because the hinge is on one side of the door, those arcs with have different arc lengths.

Kind of hard to describe without a picture (on mobile), but side one scribes $r\theta$, where $r$ is the distance between hinge center and the hinge side of the door, and the other side scribes $(r+d)\theta$, where $d$ is the thickness of the door. $\theta$ is how far open the door is.

Hopefully you can see that, if you wrapped a string from one side around a drum and back, the drum would have to "take up" a quantity of rope $r\theta$ while it tries to "pay out" a quantity $(r+d)\theta$, or vice-versa. This is not possible with a regular drum.

Welcome to the frustrating world of web tension control.

Title: cable-controlled flexion and extension


问:
Is a Raspberry Pi processor powerful enough for a mobile chatbot?
In general, is a Raspberry Pi processor powerful enough for a mobile chatbot? I want to make a small mobile robot that is like a chatbot. Is a Raspberry Pi processor powerful enough for any type of AI robotics?
As far as a mobile robot, I want to make a wheeled robot about one foot in every dimension. The chatbot abilities will be from ProgramPY-SH, a new chatbot program that uses Xaiml databases. The chatbot works by looking through a database for a match of the user's input (vocal or text-based). It then acts according to the instructions given by the XML-like database.</p>

答: Despite its price, the Raspberry Pi is a rather powerful platform that can run most Linux desktop applications but the most CPU/memory hungry. For example, Quake 3 has been shown to run in 1080p on it.</p>


问:
Hand Eye Calibration
I'm trying to use a dual quaternion Hand Eye Calibration Algorithm Header and Implementation, and I'm getting values that are way off. I'm using a robot arm and an optical tracker, aka camera, plus a fiducial attached to the end effector. In my case the camera is not on the hand, but instead sitting off to the side looking at the arm.

The transforms I have are:

Robot Base -> End Effector

Optical Tracker Base -> Fiducial

The transform I need is:

Fiducial -> End Effector

I'm moving the arm to a series of 36 points on a path (blue line), and near each point I'm taking a position (xyz) and orientation (angle axis with theta magnitude) of Camera->Fiducial and Base->EndEffector, and putting them in the vectors required by the HandEyeCalibration Algorithm. I also make sure to vary the orientation by about +-30 degrees or so in roll pitch yaw.

I then run estimateHandEyeScrew, and I get the following results, and as you can see the position is off by an order of magnitude.

[-0.0583, 0.0387, -0.0373] Real
[-0.185, -0.404, -0.59] Estimated with HandEyeCalib

Here is the full transforms and debug output:

```<code># INFO: Before refinement: H_12 =
-0.443021 -0.223478  -0.86821  0.321341
 0.856051 -0.393099 -0.335633  0.470857
-0.266286 -0.891925   0.36546   2.07762
        0         0         0         1
Ceres Solver Report: Iterations: 140, Initial cost: 2.128370e+03, Final cost: 6.715033e+00, Termination: FUNCTION_TOLERANCE.
# INFO: After refinement: H_12 =
  0.896005   0.154992  -0.416117  -0.185496
 -0.436281    0.13281  -0.889955  -0.404254
-0.0826716   0.978948   0.186618  -0.590227
         0          0          0          1

expected RobotTipToFiducial (simulation only):   0.168   -0.861    0.481  -0.0583
expected RobotTipToFiducial (simulation only):   0.461   -0.362    -0.81   0.0387
expected RobotTipToFiducial (simulation only):   0.871    0.358    0.336  -0.0373
expected RobotTipToFiducial (simulation only):       0        0        0        1

estimated RobotTipToFiducial:   0.896    0.155   -0.416   -0.185
estimated RobotTipToFiducial:  -0.436    0.133    -0.89   -0.404
estimated RobotTipToFiducial: -0.0827    0.979    0.187    -0.59
estimated RobotTipToFiducial:       0        0        0        1
</code>```

Am I perhaps using it in the wrong way? Is there any advice you can give?

答:
I agree with Ben, your situation is eye-to-hand(camera outside robot) and AX=XB,the X is pose between camera and the robot base(but you get the fucucial with the end-effector).
And in eye-in-hand(camera bind to robot tip) the X is the pose between camera and the robot's end-effector. There is another Matlab code (Dual Quaternions)in http://math.loyola.edu/~mili/Calibration/index.html</p>

Title: Hand Eye Calibration


问:
What does SE mean in robotics literature?
I've come across the abbreviation SE several times recently. I know it has to do with the pose of the robot, and the degrees of freedom. Most recently I found it on page 8 of this paper: </p>

<p>D. Kragic and H. I. Christensen, “Survey on visual servoing for manipulation,” Royal Institute of Technology (KTH), Stockholm, Sweden, Tech. Rep. ISRN KTH/NA/P-02/01-SE, CVAP259, 2002. </p>

答:
In that context, SE means "Special Euclidean" group, e.g. SE(3)* which is shorthand for "the special Euclidean group of rigid body displacements in three-dimensions".

*Planning Algorithms, Steven M LaValle 2012-04-20


答: It is a mathematical concept call the "Special Euclidean" group. Roughly, it is a combination of a rotation and translation. You'll also frequently see SO3, which is the special orthogonal group which means rotations.</p>

Title: What does SE mean in robotics literature?

Body:
I've come across the abbreviation SE several times recently. I know it has to do with the pose of the robot, and the degrees of freedom. Most recently I found it on page 8 of this paper: </p>

<p>D. Kragic and H. I. Christensen, “Survey on visual servoing for manipulation,” Royal Institute of Technology (KTH), Stockholm, Sweden, Tech. Rep. ISRN KTH/NA/P-02/01-SE, CVAP259, 2002. </p>


问:
Raspberry Pi and Buzzers: Simple solution
I have a Raspberry Pi 1 Model A and am interested in attaching a buzzer to its GPIO pins so that the software (running on the pi) can turn the buzzer on/off by sending signals to the GPIO pins.

I'm new to electronics so I'm looking for the simplest setup possible. I watched this Youtube video where the author just plops a buzzer down into a breadboard and uses jumper wires to connect the breadboard/buzzer to the pi's GPIO pins. I'd like a similar (simple!) setup.

I'm wondering what the make/model/specs are for that buzzer so that I can buy the same one and attach it to my pi/breadboard the exact same way (or if there's a simpler way out there, I'm open to that as well!). Any ideas what the voltage/amperage ratings would need to be so as to be compatible with the pi (without the need for additional things like circuit drivers, resistors, transistors, etc.)? Remember, I'm a total newb here and simpler == better!

Thanks in advance!

答:
For a beginner, it is always best to follow / copy an existing example.  Fortunately, a tutorial about connecting a sound device to a Raspberry Pi and parts are available here. Also, there is a Raspberry Pi Stackexchange web site (should you have more Raspberry Pi questions).

Any device connected to an embedded processor must operate at the voltages the embedded processor is operating at and must not draw more current than the embedded processor can supply safely.  The voltage and current ratings of the Raspberry Pi's GPIO pins are discussed here.

The above tutorial is more complex than a simple buzzer.  As it appears to be able to play music.  But the tutorial is complete and physically it does not appear any more complex than the circuit in the youtube video linked to in the question.  Rather, the complexity is in the software which likely can just be downloaded and used.


问:
Doppler effect in long distance communication using 868MHz band for telemetry signals
I am working on a project which involves multiple quadcopters working about 5 km away from the ground control station. The communication is planned to be done using RFD868+ modules on each of the drones from jdrones. When these quadcopters are in motion, will there be packet loss in the telemetry commands sent to the individual quadcopters due to the doppler effect? I believe there should not be any issue as the velocity of the quadcopters is miniscule when compared to the speed of light. Am i right ?

Also when multiple quadcopters are trying to communicate using this system, is there any alternative to CSMA CD ? (It is in a mesh topology)

答:
You are totally right, the speed of the drones is ridiculous when compared to the speed of light, thus the relativistic doppler effect is totally neglegible. Nevertheless, you may encounter communication problems due to the distance at which they are operating, which causes signal degradation, and due to interference, which may be relevant with the high amplification that you are gonna need in order to receive at that distance.

About the other question I don't know, but that might be material for another post, since it's just vaguely related with the title.


问:
TWIP robot - DC gearmotor speed/Encoders
I'm working on a self-balancing TWIP (Two-Wheel Inverted-Pendulum) robot project which will be using two brushed DC gearmotors with encoders.  As there were no speed constraints for the robot (and given a wheel radius of 0.03m) I chose a top speed of 1 m/s for the robot, giving a rated speed requirement of 318.28RPM for the gearmotor.

From what I understand, a high enough RPM is required to prevent the motor speed from saturating while the robot is balancing, as this can prevent the robot from maintaining balance i.e. the wheels can’t keep up with the body of the robot, and it falls over.

But, an encoder allows for direct measurement and control of the motor's speed, which can prevent it saturating i.e. it can prevent the motor from approaching speeds it can’t handle.

So, will the RPM I’ve calculated be fast enough for the robot or, since I’m using motors with encoders, can any motor speed be used?

答:
:EDIT:

Let me put some numbers on this.

Let's say you want to get from any angle to vertical in half a second. Say for now (more on this unrealistic scenario later) that you want to get from "laying down" (90 degrees from vertical) to upright in half a second. This is just for the purposes of coming up with a spec.

The position equation:

$$
\theta = \theta_0 + \dot{\theta}_0 t + \frac{1}{2}\ddot{\theta}t^2 \\
$$

(It's equally valid for linear or angular positions/speeds). You would think that you need to accelerate from 90 to 0 degrees, but then you'd hit 0 with some velocity. In reality, you're looking to get to 45 degrees in a quarter second, then spend the other quarter second decelerating. So, if you want a quarter second to go from $\theta = 90^{\circ}$ to $\theta = 45^{\circ}$, then:

$$
45^{\circ} = 90^{\circ} + (0^{\circ}/s)t + \frac{1}{2}\ddot{\theta}(0.25 \mbox{s})^2 \\
$$
$$
\frac{-45^{\circ}}{(0.25\mbox{s})^2} = \ddot{\theta} \\
$$
$$
\ddot{\theta} = 720 ^{\circ}/\mbox{s}^2 \\
$$

This is the acceleration you need beyond gravity to get the performance you want. You could accelerate slower if you want to - again, it's up to you to specify.

Check the top speed. At that acceleration, 720 degrees per second for a quarter second, you go from $\dot{\theta} = 0$ to $\dot{\theta} = (720^{\circ}/\mbox{s})(0.25\mbox{s})$, or $\dot{\theta} = 180^{\circ}/\mbox{s}$.

Now let's lower the speed requirement. Say instead of having the pendulum "pop" up from laying down in half a second, you're okay with it taking two seconds. Do the same steps as above, but now when it accelerates for half the time, it's accelerating for 1 second. It again decelerates for 1 second.

$$
45^{\circ} = 90^{\circ} + (0^{\circ}/s)t + \frac{1}{2}\ddot{\theta}(1 \mbox{s})^2 \\
$$
$$
\frac{-45^{\circ}}{(1\mbox{s})^2} = \ddot{\theta} \\
$$
$$
\ddot{\theta} = 45 ^\circ/\mbox{s}^2 \\
$$

Now you run at that acceleration for a full second, and get $\dot{\theta} = 45^{\circ}/\mbox{s}$.

Seems reasonable so far, but you have to torque the pendulum by accelerating the base. Find the projection of the arm to the +y-axis, using the angle the arm makes with the vertical ($\theta$), to see how the base acceleration impacts the and then see that the base generates an angular acceleration at $\ddot{\theta} = \frac{1}{\ell} \cos(\theta) \ddot{x}$.

Now, at 90 degrees, $\cos(\theta) = 0$, so the angular acceleration you get is zero for any $\ddot{x}$. No amount of base acceleration will get the pendulum upright.

Say though that you want to start at 89 degrees instead. Now $\cos(89^{\circ}) = 0.0175$, so

$$
\ddot{x} = \frac{\ell}{0.0175} \ddot{\theta} \\
$$

Or
$$
\ddot{x} = (53.3)(\ell)(\ddot{\theta}) \\
$$

So if $\ell$, the distance from the cart to the center of mass were 1 meter, then the cart has to accelerate 53 times the angular acceleration number. 720 degrees per second squared is 12.5 rad/s2, so you need your cart to accelerate about $(1\mbox{m})(53*12.5 \mbox{rad/s}^2) = 662.5 \mbox{m/s}^2$. At a gravitational constant of $9.81 \mbox{m/s}^2$, you're looking at a linear acceleration of about 67g.

For the slower case, 45 deg/s2 = 0.7854 rad/2, so now the cart would need to accelerate at $(1\mbox{m})(53*0.7854 \mbox{rad/s}^2) = 41.6 \mbox{m/s}^2$, or about 4.25g.

The faster case is accelerating at 67g for a quarter second, so $x_f = x_0 + v_0t + 1/2 at^2$, or $x_f = (0.5)(67\mbox{g})(9.81\mbox{m/s}^2/\mbox{g})(0.25\mbox{s}^2) = 20.54m$, versus the slower acceleration's case of $x_f = (4.25)(9.81)(1^2) = 20.84m$.

For top speeds, $(67)(9.81)(0.25) = 164 \mbox{m/s}$, versus the slower acceleration's $(4.25)(9.81)(1) = 41.7\mbox{m/s}$.

So my gut reaction earlier, that the slower acceleration would result in a higher top speed, was wrong. It can result in a longer distance traveled, but it looks like the top speed is lower.

But, I hope you can see that "popping up" from laying down is not realistic. You'd be better off to have some kind of spring-loaded trigger that pushed up instead of accelerating the base.

This still doesn't take into account the mass or moment of inertia; it's just looking at the base acceleration's relationship to a massless rod.


问:
Why is a computer vision system similar to the human vision
Does computer vision intentionally mimic the vision of a human or is it just coincidental that a good computer vision system (with convolutional neural networks for example) reassembles some properties of the human vision apparatus?</p>

答:
I would argue that the similarities are largely superficial. More "classical" machine vision approaches focused on finding features a human can identify such as lines, texture and blobs of color.

Neural networks were originally designed based on what was known of neurons at the time, for example the activation functions are loosely based on how signals in the brain propagate. However, it is important not to take this analogy too far - there are many ways and nuances to how the brain operates and we are a long long way from being able to fully describe the brain.

While it's easy to anthropomorphize CNNs by saying things like "this layer pulls out background" or "this layer looks for edges", they are really just a bunch of stacked filters which are trained for a specific set of data. Ian Goodfellow has done some good work showing how these networks can be fooled by adding imperceptible (to a human) amounts of noise.