答:
You're trying to find a formula to convert a given $(r, \theta)$ to left and right thrust percentages, where $r$ represents your throttle percentage.  The naive implementation is to base your function on 100% throttle:

At $0 ^{\circ}$, left and right thrust are equal to $r$

At $\pm45 ^{\circ}$, one side's thrust equals $r$ and the other side's equals 0

At $\pm 90 ^{\circ}$, one side's thrust equals $r$ and the other side's equals $-r$

At $180 ^{\circ}$, left and right thrust are equal to $-r$

This produces a function like the following:

The problem with this implementation is that you are only providing the desired $r$ when $\theta$ is at an exact multiple of $90 ^{\circ}$.  At all other points, you sacrifice total speed for control.  You can see this in the graph: "Absolute Thrust", the amount of thrust being delivered by both motors, is not (and cannot be) constant in this regime.  Simply scaling this function is not optimal.

The maximum absolute thrust that can be sustained over the entire range of $\theta$ occurs when $r=50\%$ -- this is what your function should be based on.

In this implementation, total thrust remains constant between $\pm45 ^{\circ}$, and absolute thrust is constant no matter what direction is chosen -- the motors trade off their thrust to maintain the desired $r$.  Above $r=50\%$, the range of angles where your total thrust can satisfy $r$ begins to shrink -- you begin to sacrifice control for speed.

This produces a python function like the following:

```<code># assumes theta in degrees and r = 0 to 100 %
# returns a tuple of percentages: (left_thrust, right_thrust)
def throttle_angle_to_thrust(r, theta):
    theta = ((theta + 180) % 360) - 180  # normalize value to [-180, 180)
    r = min(max(0, r), 100)              # normalize value to [0, 100]
    v_a = r * (45 - theta % 90) / 45          # falloff of main motor
    v_b = min(100, 2 * r + v_a, 2 * r - v_a)  # compensation of other motor
    if theta < -90: return -v_b, -v_a
    if theta < 0:   return -v_a, v_b
    if theta < 90:  return v_b, v_a
    return v_a, -v_b
</code>```

The result is the following:

Title: How to calculate the right and left speed for a tank-like rover?

Body:
I am trying to control the Rover 5 robot using an Android app with a touch-based joystick control in the app UI. I want to calculate the speed of the left and right motors in the rover when joystick is moved.

From the joystick, I get two values, pan and tilt. I convert them into the polar coordinate system with r and theta. Where r ranges from 0 to 100 and theta from 0 to 360. I want to derive an equation which can convert the (r, theta) to (left_speed, right_speed) for rover. The speed values also are in the [0;100] range.

Now, here is what I have figured out till now. For any value of r,

If theta = 0 then left_speed = r, right_speed = -r (turning right on spot)

If theta = 90 then left_speed = r, right_speed = r (moving forward at speed r)

If theta = 180 then left_speed = -r, right_speed = r (turning left on spot)

If theta = 270 then left_speed = -r, right_speed = -r (moving backwards at speed r)

For other values, I want it moving and turning simultaneously. For example,

If theta = 45 then left_speed = alpha*r, right_speed = beta*r (moving forward while turning right)

So, basically for any (r, theta), I can set speeds as,

(left_speed, right_speed) = (alpha*r, beta*r)

I need to formulate an equation where I can generalize all these cases by finding alpha and beta based on theta.

How can I do this? Is there is any existing work I can refer to?

Body:
You're trying to find a formula to convert a given $(r, \theta)$ to left and right thrust percentages, where $r$ represents your throttle percentage.  The naive implementation is to base your function on 100% throttle:

At $0 ^{\circ}$, left and right thrust are equal to $r$

At $\pm45 ^{\circ}$, one side's thrust equals $r$ and the other side's equals 0

At $\pm 90 ^{\circ}$, one side's thrust equals $r$ and the other side's equals $-r$

At $180 ^{\circ}$, left and right thrust are equal to $-r$

This produces a function like the following:

The problem with this implementation is that you are only providing the desired $r$ when $\theta$ is at an exact multiple of $90 ^{\circ}$.  At all other points, you sacrifice total speed for control.  You can see this in the graph: "Absolute Thrust", the amount of thrust being delivered by both motors, is not (and cannot be) constant in this regime.  Simply scaling this function is not optimal.

The maximum absolute thrust that can be sustained over the entire range of $\theta$ occurs when $r=50\%$ -- this is what your function should be based on.

In this implementation, total thrust remains constant between $\pm45 ^{\circ}$, and absolute thrust is constant no matter what direction is chosen -- the motors trade off their thrust to maintain the desired $r$.  Above $r=50\%$, the range of angles where your total thrust can satisfy $r$ begins to shrink -- you begin to sacrifice control for speed.

This produces a python function like the following:

# assumes theta in degrees and r = 0 to 100 %
# returns a tuple of percentages: (left_thrust, right_thrust)
def throttle_angle_to_thrust(r, theta):
    theta = ((theta + 180) % 360) - 180  # normalize value to [-180, 180)
    r = min(max(0, r), 100)              # normalize value to [0, 100]
    v_a = r * (45 - theta % 90) / 45          # falloff of main motor
    v_b = min(100, 2 * r + v_a, 2 * r - v_a)  # compensation of other motor
    if theta < -90: return -v_b, -v_a
    if theta < 0:   return -v_a, v_b
    if theta < 90:  return v_b, v_a
    return v_a, -v_b

The result is the following:


问:
Should a walking robot necessarily be a better cleaning robot than a wheeled robot?
All cleaning robots I found so far sold in stores, for cleaning an house, are not walking robots but rather short, wheeled robots.

I assume that walking robots could have way more sophisticated maneuvers in cleaning as they could more easily climb stairs, and lean towards, or navigate in or operate tools in narrow caveats.

Should a walking robot necessarily be a better cleaning robot than a wheeled robot?

Are there mathematical/algorithmic explanations to how (or something close)?

If the phrasing of the question is bad, please help me by suggesting an edit or by comments.

答:
“Better” is ambiguous.  A walking robot could certainly get to some places that a wheeled robot could not - steps are a good example.  But it would have challenges getting low enough to go under some objects.

You should consider the entire requirements of a vacuuming robot, though.  Access and navigation are just some of the requirements.  What about battery life?  Wheeled travel is more efficient on smooth surfaces than walking.  What about affordability?  Would you create a walking robot that can travel everywhere a human can, yet can only run for 5 minutes and costs more than a consumer is willing to spend?

NASA has funded the development of a hybrid rolling/walking design that may help merge solutions to some of the competing requirements:  NASA Tech Transfer

I suggest that you consider the problem as a whole rather than focusing only on locomotion.

ContentLicense: CC BY-SA 4.0


答: This is a very subjective issue question. Better meaning what? Better battery life, cleaning, efficiency? Overall I think wheeled is better as the brushed motors for the wheels are easier to produce and way more reliable than a walker bot. Plus with a walker bot, I’m not sure about how you’d get it low enough to suck up any debris. </p>

Body:
All cleaning robots I found so far sold in stores, for cleaning an house, are not walking robots but rather short, wheeled robots.

I assume that walking robots could have way more sophisticated maneuvers in cleaning as they could more easily climb stairs, and lean towards, or navigate in or operate tools in narrow caveats.

Should a walking robot necessarily be a better cleaning robot than a wheeled robot?

Are there mathematical/algorithmic explanations to how (or something close)?

If the phrasing of the question is bad, please help me by suggesting an edit or by comments.


问:
Why to seal a motor shaft, or the whole motor, for underwater ROV?
I just finished a competition for underwater robots. The water is about 40-50cm in depth and 90% of the designs just exposed the thrust motors completely in the water similar to the picture below and nothing happened during the competition. BTW, the water is tap water, not salt water.

I saw many questions and how-to articles about sealing the motor shaft for underwater ROV. I am not sure I understand the reason, especially after I found this reply to Preventing leaks in motor shafts for underwater bots. Is it because of the concern of short circuit or wear and tear if water goes into the bearings? Or will things be very different when the robot has to go deeper?

答:
Brushed motors are functionally waterproof not by design but by principle (brushes sending power to a stator, spins the motor) and will run under water, albeit inefficiently. Most brushed motors have an internal fan for cooling so if the motor does not have that and uses bushings or sealed bearings for holding the rotor, it is at least acceptable for submersion. Most radio control brushed motors are actually recommended to be “broken in” to wear down the carbon enough for good efficiency by being run underwater and oiled/cleaned afterwards, and in most cases, it increases life and power of the motor. </p>

<p>Rust however is still an issue but if you aren’t running it 24/7 and oil it afterwards, it’ll be fine. </p>

Body:
Brushed motors are functionally waterproof not by design but by principle (brushes sending power to a stator, spins the motor) and will run under water, albeit inefficiently. Most brushed motors have an internal fan for cooling so if the motor does not have that and uses bushings or sealed bearings for holding the rotor, it is at least acceptable for submersion. Most radio control brushed motors are actually recommended to be “broken in” to wear down the carbon enough for good efficiency by being run underwater and oiled/cleaned afterwards, and in most cases, it increases life and power of the motor.

Rust however is still an issue but if you aren’t running it 24/7 and oil it afterwards, it’ll be fine.


问:
Going from Spline to Differential Drive Command
I have a differential drive robot that needs to move along a path stored in its memory as a spline. I am currently trying to understand the mathematics of determining how much power to apply to each wheel so that the net movement conforms to the path in memory.

These papers have been helpful, but I am not sure I fully understand what to do:

Auto Guided Vehicle Control

Mobile Robots at Your Fingertip

If I knew some mapping between wheel power differences and rates of rotation, maybe I could take the derivative of the curve at each point and then apply a rotation to the robot to bring my driving vector into alignment with the tangent vector?

答:
If you have the path you want the robot to stay on, it sounds like you need Pure Pursuit.  In this simple algorithm, you steer the robot to some look-ahead point on the path.  The gist of it is illustrated by this image.

The original paper is framed in terms of ackerman steering angle.  But it is easy to adapt to differential drive robots.

You should tune the parameters to the speed of your robot and the types of paths you will be following (i.e. curvy or straight).  Choosing the right parameters can make the path follower seem "under damped" or "over damped".

Original algorithm proposed here:
Implementation of the Pure Pursuit Path Tracking Algorithm. R. Craig Coulter, CMU, 1992.


问:
How to open a sliding window?
I live in an apartment that has sliding windows in it. The apartment is naturally warm because we live above a mechanical room, such that we either opened the windows or ran the air conditioning through the winter. I want to create a device than can open and close the windows in the apartment depending on temperature. The software and electronics are already figured out, I just need to figure out how to move the windows.

This is a sample of the window. It takes about 4 lbs of force to pull it open, and they only open 6 inches(since I'm 16 stories high).

Ultimately, I want to make this cheap enough that I could replicate it on 6 windows.

My first thought was a linear actuator, but most of the ones I have seen are designed for moving 100+lbs and cost several hundred dollars. Pneumatic actuators are cheaper, but I'd have to run a network of air lines and solenoids, and would have a compressor that would randomly kick in. A double winch system would be very complicated to set up and prone to failure. Lastly, I was thinking of a cheap metal gear servo(dealextreme has 15kg/cm servos for under $15.00), but it would be somewhat difficult to use a series of turnbuckles and arms to translate into 6 inches of linear movement.

Any help would be appreciated.

答: If you want to be cheap....you could go to a junk yard and grab a linear actuator used for opening and closing car door windows.  </p>

ContentLicense: CC BY-SA 3.0

Title: How to open a sliding window?


问:
How to simulate water/ pool for underwater vehicle in Gazebo/SimScape?
I have tried SimScape and gazebo but I did not get a solution for simulation of a swimming pool. Can somebody help with the same? Do I have to create the whole swimming pool using simple rectangular shapes and all? How to add water to it?</p>

答: Check UUV Simulator and UWSIM.</p>

Body: Check UUV Simulator and UWSIM.


问:
How to calculate power supply requirements for Closed Loop Stepper Motors?
I have a CNC Router table that has 4 Nema 23 stepper motor (open loop).
I want to upgrade the machine and use 4 Neam 34 Closed Loop Steppers. These are the motors and drivers I'm considering:

Steppers: Nema 34 Closed Loop Stepper

```<code>Motor Type: Bipolar Stepper
Rated Current/phase: 5A
Voltage: 5V
Phase Resistance: 1ohms
</code>```

Drivers: Closed Loop Stepper Driver 0~8.2A 24~80VDC for Nema 34

```<code>Output Peak Current: 0~8.2A
Input Voltage: +24~80VDC (Typical 48VDC)
Logic Signal Current: 7~16mA (Typical 10mA)
Pulse Input Frequency: 0~200kHz
Isolation Resistance: 500MΩ
</code>```

My questions are:

How should I calculate/choose the power supply for these 4 steppers?
I have looked around for this and found many things, like measuring the voltage on the motors while running, some multiply the Rated Current/phase for the number of motors, and so on. I think part of my confusion is that I don't have a lot of experience with electricity (voltage and amps).

These are the ones this company offers.

Is it as easy as selecting one (350W 60V 5.9A) that is close to 48V?

Does it make sense to find an unregulated power supply for my CNC? It looks like none from this website is.

Does it make sense to find a power supply that is more powerful and uses only one for all motors instead of 4 of them?

答:
So there's a couple of things you need to go through when choosing the power supply for this application. Number one you need to differentiate between the driver capabilities and the motors requirements.

Now the motor you have listed is no longer available on the website, but I found several motors on the website that are similar to what you have listed.  The data sheets are a bit sparse, but the current requirements and recommended running voltages for the motor are what you're looking for. The MTBF (Mean time between failures) for the motor I found is measured at 24v(though Nema34 are typically driven at at least 48v) and the current per phase is listed at 6A.

If you have 4 of these motors working at full torque capacity that means you'll need 48v at 24A. though you probably want to give yourself some overhead on current. Most of the time a 20% overhead margin is recommended. That would mean you'd need a 48v ~30A power supply if you were planning on fully loading all 4 motors.

Now, since this is a CNC machine, and it is very unlikely that you'll ever have more than 2 motors working fully at any given time we have a bit of wiggle room. So if we assume the maximum load we're ever likely to see will be the equivalent of 2.5 motors working at full  torque capacity, that means we're down to about 15A, so with a margin of error a 48v 18A power supply should do nicely for your application. The closest thing they have on the website you have listed is a 48v 1000W (21A) supply which would work well. It's always better to overshoot on the capacity of your power supply than to under-spec it.

Now this is another component of this to deal with. You mentioned a 60v power supply. If you are familiar with Ohm's law you might be inclined to think you could get away with a 60v power supply with equivalent wattage. That's not quite the case though, as the way stepper motors and drivers work, they are designed to hold a constant current regardless of input voltage. If you go up in voltage you'll need a higher wattage power supply to still be able to deliver the necessary current.

As far as unregulated, I would definitely not consider an unregulated power supply for any sensitive operations due to the high voltage ripple, and I don't think you'll be able to find one that would deliver the necessary wattage at a reasonable price. Typically they are limited to low current linear supplies. Unregulated supplies that could deliver the necessary current are extremely expensive, and you would still have the issues with the ripple voltage. The higher the load on the supply the larger the ripple in the voltage, so with a potential draw of 15A or more, you'll see tremendous fluctuations in the output voltage.  This would be pretty disastrous on a CNC machine.


问:
Planar Robot Boundary Detection
I am tasked with building a robot that needs to localise and navigate itself on a rectangular surface (like a large desk). The rectangle's shorter sides will be marked with a red tape (or with two different colours if need be), while the longer edges are marked with a black tape. My robot is fitted with a forward facing camera, orientated downward slightly, as well as 6 sonar sensors around it's perimeter to detect any of the edges of the rectangle. There is also an IMU and encoders on each wheel (this is a two wheeled robot, with the third point of contact being a trolley wheel). The size of the rectangle is known and thus a map of it is available.

My questions are thus these:

Using the camera( I have both a wide angle cam or a standard camera at my disposal) how would I be able to find useful information from the edges of the rectangle. Obviously not all the rectangle edges will be in frame of the camera simultaneously, but what ros packages/methods could I use to gather information from them using the different colours of tape.

If/once I have information about the edges, are there any navigation tools that would allow me to do a sweep over the whole mirror (such as a lawnmower over a garden) to navigate the whole surface area.

What is the simplest way to get the sonar's to prevent the robot driving off the edge, given that they are downward facing?

The biggest challenge here seems to be that there is no real absolute reference, as the nature of the project requires the robot to localize itself only from data on the rectangle.

答:
Since the lines are (usually) going to be perpendicular to the normal vector of your image, you can sample columns and use a Butterworth filter to extract the "peak" frequencies (must be configured towards the desired line coloration). Converting to a gray scale first is typically more effective. This will give you the location of the line in your image. To find the exact color, just search the image at that specific location and check the RGB values (using an admissible range).

For dealing with corners, you can apply the filter to both a column and row and check both. If you are using python, you can see the SciPy Butterworth Filter.

Assuming you have a sufficiently accurate controller, you can solve this issue with way-point navigation and short term dead reckoning (which is where IMUs are most effective).

To answer this part (accurately), we need more information about the physical configuration of your sonar sensors w.r.t. the rest of your system.

Title: Planar Robot Boundary Detection


问:
Advantage of Kalman filter in differential drive planar robot
We need to estimate the position and orientation of differential drive robot by using encoders and imu sensor. For this specific case, is there any advantage of using Kalman filter than taking the average of encoder data and imu data. What I mean by taking the average is finding position at each sampling step by using encoders and imu seperately and taking our estimate at that time instant as the weighted average of encoders and imu. For next time step use this estimate as previous position value for both encoders and imu and then again calculate the individual estimates and take again the weighted average as final estimate. And continue this way. </p>

<p>If Kalman filter would do a better job than this simple weighted averaging, could you please explain intuitively why. </p>

答:
It seem that your are missing some intuition about the function of a Kalman filter type filtering method. To a large degree the working principle of the Kalman filter is combining information from different sources in order to create estimates greater than the measurements from either individual sensor.

The advantage of the Kalman filter is that it offers a very mathematically "correct" way of doing so in addition to having the capability to filter away some measurement noise simultaneously, which a pure averaging type approach may not.

This is an extremely brief overview, for more information I have found that this book is a very nice resource. That being said it may not be as mathematically rigorous as some others, e.g. Optimal and Robust Estimation or Introduction to Random Signals and Applied Kalman Filtering or other such textbooks.

TLDR: Yes a Kalman filter would very likely perform better at the cost of effort/complexity. "Explain a Kalman filter" is a very non-trivial task, for which I refer you to some texts.


问:
Does a vacuum pump have to run constantly in a pick & place system?
I'm reading this article about which of vacuum pump or venturi vacuum generator is more efficient for a pick and place system: https://fluidpowerjournal.com/pump-or-venturi/

The example application is as follows:

Here’s a typical vacuum-lifting application: a small end-of-arm tool
  consisting of eight small vacuum cups of Ø40 mm (Ø1.5″). These eight
  cups are picking up a flat plastic sheet, which is, of course, non
  porous. Cycle rate is one sheet pick every 15 seconds, or four sheets
  a minute. The piece is being held for only three seconds during
  transfer. What’s the most efficient? Pump or venturi?

The conclusion appears to be venturi, but I find the argument a bit odd:

The pump will run continuously with the vacuum being turned on and off
  via a vacuum solenoid valve. The venturi will run only when required
  (during the lift part of the cycle), turned on and off using a
  compressed air solenoid valve. The vacuum pump uses 0.25 hp all day
  long during a 24-hour shift. The venturi uses 0.9 hp for every three
  seconds of a 15-second cycle. Therefore, the venturi uses on average
  0.18 hp of compressed air over the same cycle period. Consequently, the venturi is “more efficient” in overall running costs.

Does anyone know why the vacuum pump would need to run constantly for 24hrs whilst the pressure pump would not? Could the vacuum pump not be switched off just like the pressure pump? In fact, can the solenoid valve give a good seal in the venturi case?

答:
The problem with vacuum pick and place systems is the amount of time it takes to create the vacuum, so your design will revolve around your requirements.

Vacuum

If you run the vacuum continuously then, as you approach your target, you only have to wait long enough for the channels on your pick-up head to evacuate.

If you switch off the vacuum pump, air rushes into the tubing, equalising at atmospheric pressure. The next time you want to pick, you need to evacuate all of the tubing between head and pump. This could take a long time, even if you have a vacuum 'reservoir' much larger than the volume of your tubing.

In between these would be a vacuum solenoid close to the pick-up head. Here most of the tubing would stay evacuated, and you would only have to evacuate the pick-up head channels and the short tubing to the solenoid. This does require you to run power and control all the way to the head, though.

The greater the volume of tubing on the open air side of the solenoid, the greater the time would be from switching the solenoid to their being sufficient vacuum.

Venturi

With a venturi generator, you can site it next to the head, keeping the volume to evacuate low, while putting the solenoid at the other end of the tube. High pressure air will rush into that tube much more quickly than the air could be evacuated, so you effectively get the best of both worlds. Fast actuation, but no need to add solenoids and run power and control to the head.

Comparison

Price and the difference in pressure differentials are the big advantages of compressed air. Air compressors can easily and cheaply supply air to a venturi generator, and can cope more easily with large changes in demand.

A typical workshop compressor might store 100l of air at 8 bar and be rated at 410 litres/minute (14.5cfm). This could run venturi generators needing 80 litres/minute with the 5:1 duty cycle suggested in your quote. During that 15 second cycle, pressure would fall from 8 bar to around 7.8 bar until the pump kicks in again. This variation should be negligible in terms of pick-up performance.

We could do something similar with a vacuum vessel, have a higher flow vacuum pump, a vacuum 'storage' vessel, and run it with a 3:12s duty cycle, but there are problems with this. We would need a much higher flow rate (and cost) pump. Vacuum vessels can have at most 1 atmosphere of pressure differential, in practice much less, so a 100l tank could never 'store' more than 100l of vacuum, and a 0.3bar (10"Hg) vacuum vessel would need to be around 2500 litres in size, to have a similar pressure variation over the duty cycle as with a 100l compressed air solution. Flow rate is affected significantly by current pressure in the storage vessel:

Summary

In summary, almost all of the vacuum based pick and place machines I've worked on have used venturi generators. Vacuum pumps always have to be sized according to maximum required vacuum, assuming no storage, whereas compressed air systems can usually be sized based on average use.

If you need constant vacuum, pumps may be better, but if demand varies significantly from second to second, as it probably does in a pick and place machine, venturi may be a better fit.


问:
FastSlam 2.0 Implementation?
I have studied Claus Brenner's lectures on how to implement the FastSLAM 1.0 algorithm, where each particle maintains the robot pose, and maintains EKF's of the landmarks.

However, I'd like to implement FastSlam 2.0. Which I understand uses particle filters completely. Is this the same as FS 1.0, but instead of each particle maintaining an EKF of the landmark, each particle maintains yet another array of particle filters for landmarks?

答:
FastSLAM 2.0 separates the estimation of the state of the vehicle from the state of the map, which in this case, is the set of landmarks one is using to self-localize.

If one were to use a grid based variant of the fast slam one would not need to estimate the state of each landmark via an EKF however, each particle should keep a its own estimate of the map. This is followed by a resampling step

Title: FastSlam 2.0 Implementation?


问:
Bayesian filter for 2-D grid localizaton
I have some data obtained from an experiment in terms of movements and observations with odometry and sensor data. My task is to find the probability mass on each of the grid cells after each set of motion and observation. I'm a bit lost in figuring out how to compute probability mass for each of the grid cell.
My odometry information is in terms of rotation, translation and rotation and my sensor information is in terms of range and bearing angle.
How do I calculate the probability of robot present in each of the grid cell?

I have the formula for belief after motion as summation(P(x|u, x')xBel(x'))
How do I compute the motion model with noise?

答:
1- to calculate the probability of the pose of the robot you can use a particle filter, it is easy and efficient

2- the motion model depends on your vehicle/robot, is it a differential drive, an ackerman etc.


问:
Grid based SLAM using BeagleBone Green Wireless and RPLIDAR
I've written a grid based DFS algorithm with a PID-based steering system to maneuver a 30cm2 square-grid maze all in Python. The robot is a 4 wheel drive with an approximate size of 20 cm. The robot has a BeagleBone Green Wireless controller which is connected by USB to the RPLIDAR A1.

At this current moment, the robot is underutilizing the LIDAR and I want to begin to learn SLAM. However, the environment is highly predictable which I think makes a full SLAM counterintuitive. I would also like the code to be low CPU strain.

I've seen people converting a conventional SLAM into a grid based but only after the calculations are complete. I was wondering if there is a way to do a Grid Based SLAM right from the start (assume its position and map with a grid).

Accuracy isn't hugely important here as long as it understands a tile and the robot is able to avoid walls.

Any advice, tips or suggestion is appreciated. How would you store the map? How would you locate the position of the robot? How would you map the LIDAR's values?

答:
1- A occupancy grid map is simply a 2D array

2- if you have a map and you just want to locate the robot/vehicle you can use a particle filter, it is easy and efficient

3- it seems you want to SLAM, so you can use an algorithm called grid based fastslam 2.0, it uses particle filters and grid maps, you can find on this site some explanations of fastslam

a- in summary, you use a particle filter to localize the robot, this is done by using the motion model and scan matching

b- then you map your lidar scan

c- then you resample your particle

PS: each particle saves a full map with it


问:
Arduino Uno R3 or Roboduino ATMega168 or Arduino Mega 2560 R3 which board is better for small robots
I am new in robotics. May be this question looks like too naive but i want to know which is a better board among Arduino Uno R3 or Roboduino ATMega168 or Arduino Mega 2560 R3 for my purpose mention below -

A simple robot with wheels, can move around.

Can have IR sensors and camera.

Is powerful enough to deal with computer vision computations.

Arduino Mega 2560 R3 looks more powerful than the other too, I just want to know if my purpose can be solved with other two boards too?

Thanks

答:
The Mega is a great board, I use it for my robot. If your robot is small and space is limited, the size of the Mega could be an issue...
Hopefully, SeeedStudio has made and Seeeduino Mega which is almost the size of an Arduino UNO.

For computer vision though, I'm not sure the Mega will be powerfull enough. And if it is, it won't be able to do anything else during the computation (because of the way the Arduino works).

So maybe you should take a look at the Raspberry Pi. It has great camera modules you can use and is powerful enough for some computation. There are shields avalaible to connect and easily use Arduino shields for your motors.

Hope it helps! :)


问:
How to deal with a joint suddenly having to make a large change in angle during linear interpolation?
After having set up the inverse kinematics for each intermediate point on a line that the tcp is supposed to travel, I encountered a problem that stops the tcp when it is supposed to travel along the line. While all other joints do not have to make big changes  in the joint angles between the intermediate points, a joint has to rotate from -1 rad to 1 rad between two intermediate points, which is a very big rotation compared to the other joints. I understand that all joints have to make a different amount of angle change between two intermediate points, but the joint that has to do the large angle change cannot rotate as fast to compensate for this.

Should the other joints wait until the rotation of the joint is finished and then continue with the interpolation? This seems to be the only reasonable solution for me. However, this would mean a short interruption of the movement of the tcp on the line.

Therefore, I am confused by tasks that require the tcp to move at a constant speed on a line

答:
It sounds as if the path the robot is traversing comes close to a singularity.  This could be a wrist or an arm singularity.  For these situations, you only have two options with this type of robot:  either slow the path speed (possibly by setting your interpolation points closer together), or move the path within the robot’s workspace to avoid the singular configuration.  </p>

<p>If you don’t do these, the tcp will deviate from the path (if you don’t wait for the large joint motion to complete), or it will dwell along the path (if you do wait for the large joint motion to complete).  This is what makes singularities so challenging for tasks which require a certain path speed, such as seam welding or grinding.  </p>

Body:
It sounds as if the path the robot is traversing comes close to a singularity.  This could be a wrist or an arm singularity.  For these situations, you only have two options with this type of robot:  either slow the path speed (possibly by setting your interpolation points closer together), or move the path within the robot’s workspace to avoid the singular configuration.

If you don’t do these, the tcp will deviate from the path (if you don’t wait for the large joint motion to complete), or it will dwell along the path (if you do wait for the large joint motion to complete).  This is what makes singularities so challenging for tasks which require a certain path speed, such as seam welding or grinding.


问:
What is the advantage having seven degrees of freedom in a robotic arm?
I understand what six degrees of freedom is, but I encountered the term of seven degrees of freedom at multiple occasions in robotics. What does is the purpose of that extra degree of freedom?</p>

答:
In the introduction to the paper Efficient Method for redundancy resolution of a 7 DOF Manipulator, by Mihai CRENGANIS & Octavian BOLOGA, they say:

A robotic arm with seven degrees of freedom (DOF) has numerous advantages because it gains a vast working space and high mobility and therefore it can be used in the automotive, aerospace industry and medical domains.


答:
I'm not sure you can achieve computer vision on any of those chips.
Way to go is to stream video to distributed PC, make calculations, stream commands to arduino. That could probably work, but there is also a question of how much frames you could grab from camera with Arduino.

Raspberry Pi would give you around 9fps in OpenCV while recognizing faces. Maybe you could achieve around 15-20 top if you just need movement detection...

Title: Arduino Uno R3 or Roboduino ATMega168 or Arduino Mega 2560 R3 which board is better for small robots

Body:
I am new in robotics. May be this question looks like too naive but i want to know which is a better board among Arduino Uno R3 or Roboduino ATMega168 or Arduino Mega 2560 R3 for my purpose mention below -

A simple robot with wheels, can move around.

Can have IR sensors and camera.

Is powerful enough to deal with computer vision computations.

Arduino Mega 2560 R3 looks more powerful than the other too, I just want to know if my purpose can be solved with other two boards too?

Thanks


问:
How to simulate a quadcopter using robotics simulator?
I am building my own autonomous quadcopter. I wish to simulate it using V-REP/Gazebo in order to tune the flight controller. I see that there are inbuilt models but they have properties(physical dimensions and mass among others) very different from the one I am building.

1) Can I modify these models so that it can simulate my drone? Is it enough to change the geometry, mass and inertias to make it work?
2) Do I have to deal with the physics and aerodynamics? Or do these simulators take care of it? If not what is there primary purpose of these simulators?
3) What is the process in general of simulating your hardware(in this case the quadcopter) in these simulators?

答:
I have never used it ,because I have always dealt with custom simulators but I know others have had success with the RotorS simulator.

Answers to your questions:

1) Can I modify these models so that it can simulate my drone? Is it enough to change the geometry, mass and inertias to make it work?

Kind of. You could just take one of their existing models, and change the mass and geometry. However, you would be using their hardware models for the motors which will give you slightly different results.

2) Do I have to deal with the physics and aerodynamics? Or do these
  simulators take care of it? If not what is there primary purpose of
  these simulators?

The simulator will do the basic dynamics, and physics. For aerodynamics they usually do take care of things like rotor drag, and RotorS even has the capability of adding a wind field.

3) What is the process in general of simulating your hardware(in this
  case the quadcopter) in these simulators?

Don't understand exactly what you mean here. You can simulate your hardware in regards to setting accurate values for your motors, and inertial sensors. You can also setup hardware in the loop with the pixhawk if you want to test your system.

To end it I would also say the purpose of these simulators is more to test the validity of your algorithms (mostly control, and some path planning) rather than to tune your flight controller. To tune something you want an accurate physical model, which is hard to come by in simulation. It either requires you generally doing a lot of experiments to get accurate values, or some kind of System ID algorithm.

In your case it sounds like some kind of autotuning algorithm may be better as found on the pixhawk.


答: You need +1 joints than DOF so that the robot has multiple possible robot pose with which end-effector can reach a point in cartesian space. </p>

Title: What is the advantage having seven degrees of freedom in a robotic arm?

Body: I understand what six degrees of freedom is, but I encountered the term of seven degrees of freedom at multiple occasions in robotics. What does is the purpose of that extra degree of freedom?</p>


问:
Can workspace of a manipulator change after considering its dynamics?
As per my knowledge, the workspace of a manipulator can be determined if one knows the forward and inverse kinematics. But is it possible that the workspace of the manipulator can change after considering the effects of dynamics?

In other words, can I determine the workspace of a manipulator only from its kinematic model? Or do I need to consider the dynamic model as well?

答: The workspace of a manipulator is strictly determined by its kinematics.  Since kinematics only consider the geometry of motion, without regard to forces and torques needed to accomplish tasks, you need the dynamics (and controls) to determine what motion profiles are achievable within the workspace.  But those dynamics do nothing to determine the workspace itself. </p>


问:
What rail material is best used for linear bearings?
For the 3d printer RepRap Prusa there are several rails (smooth rods) that guide the printer head on the different axises. The printer head uses several linear bearings to glide along the rails.

There isn't any specification on what kind of material would be best suited for this purpose with the linear bearings. My first assumption would be for stainless steel because it won't corrode (rust) on the surface, but I'm not sure if this is true for all printers (whether they are 3D printers or not) as a different material may allow the linear bearings to glide more easily. Aluminum would have been my second choice but I have the same reservations of which grade would be least resistant.

This resource has some limited information but does not help with which would be best suited for this particular application.

What material is best suited for this purpose?

答: You do not want to use stainless steel with linear bearings because that type of steel is not hard enough and the bearing will wear grooves into the rod. You want high carbon steel with hardness greater than HRC 60.</p>


问:
relationship between geometric twist jacobian and wrench
I read the robot textbook of Peter Corke and Richard M. Murray, in Peter’s, chapter 8 about jacobian, there are two jacobian, one is geometric jacobian $^0J$ from math, other is world coordinate frame jacobian $J$, I konw from $^0J$ to $J$ need transformation matrix.

My question is how to describe joint torque from the formula $\tau = J^T F$? Because there are two kind jacobian. In Peter’s book, use the geometric jacobian, as follows

答:
I'd suggest thinking about the problem this way:

When you construct a Jacobian for an arm, it will typically map your joint velocities to to one of three representations of the end effector velocity:

The "world velocity", which is the derivative of the position coordinates of the end effector.

The "body velocity", which is the world velocity you would get if you put your origin at the current location of the robot (so that it measures how the end effector would perceive its own motion, like a driver thinking in terms of forward-lateral components of motion).

The "spatial velocity", which is the velocity of a frame rigidly attached to the end effector, but currently collocated with and aligned with the origin frame (see my answer here for a description of why the spatial velocity is useful, although unintuitive).

The relationship $\tau=J^{T}F$ works for each of these Jacobians as long as the $F$ forces are described in the same frame as the output velocity:

If your Jacobian outputs the world velocity, then $J^{T}$ must take in a world wrench (force components in the coordinate $x$, $y$, and $z$ directions, and moment components around the coordinate $x$, $y$, and $z$ axes).

If your Jacobian outputs the body velocity, then $J^{T}$ must take in a body wrench (force components in the $x$, $y$, and $z$ directions of the end-effector frame, and moment components around the $x$, $y$, and $z$ axes of the end-effector frame).

If your Jacobian outputs the spatial velocity, then $J^{T}$ must take in a spatial wrench. (For any wrench applied at any location in the space, you can find an equivalent wrench that could be applied at the origin, which has an extra moment component equal to the cross product between the force component and the displacement between the point where the force is applied and the origin. This equivalent wrench is the spatial wrench.)

Two notes:

I'm not familiar with the book you're citing, but it's not clear to me from this passage whether the use of the word "spatial" here is the true "spatial velocity" discussed in Murray's book, or whether (as is sometimes the case) it's being used to mean "through space" in what I would call the world velocity.

I believe that the text you highlighted "can never be singular" should be interpreted as "transposing the Jacobian is always a computable operation, even if the Jacobian is a singular matrix whose inverse cannot be computed".


问:
Arduino and stepper motor
How arduino stepper library handles stepper motor with ULN2003? I mean, for controlling stepper motor one actually needs four pwms. It can be reduced to two by encoding, or maybe even to one by using other techniques. But could you, please, clarify how arduino does it? I could not find the low level code for that from arduino to inspect.</p>

答:
There is generally a stepper example in the arduino Compiler, you can find the code there, or look at the stepper library

However arduinos can‘t control steppers directly, but they send signals to stepper drivers, which then send the correct voltages to the stepper to rotate in a specific direction and rotate at a specific frequency.

Arduinos are basically ‚bit banging‘ namely they send a single high and low signal at a specific frequency and duty cycle, which determines the rotational speed of the motor itself. One line is high/low for direction, another for the signal. The advantage is you can count how many times you bit banged, and have an open loop position control system for easy NC applications

No-one would use the analog pins on an arduino to control stepper motors.

4wire stepper motors have A and B coils that require specific timing to excite (read, step) the motor and a large amperage/voltage requirement. Hence the drivers.

Considering read the wiki about steppers to get a better idea about them.

Title: Arduino and stepper motor


问:
Does increasing robotic arm's speed cost replayability?
i've been researching robotic arms for a personal project. I'm a computer engineering student, made some projects with arduino but my knowledge about robotics is currently limited.

So i was wondering, what was the limitations of the robot arms in the market? I'm planning to build a 3 joint robotic arm, it will be used for light weight job (like dotting paper with pen). Would making this fast(Sorry, i don't really know how i could explain that further) and precise(0.01-0.001 mm) possible?

答:
The robot arm can be made fast by making it light. Less mass to move allows higher acceleration which allows faster starts and stops.

The robot arm can be made precise by increasing stiffness. This is generally done by adding material.

Due to the slender nature and long unsupported nature of robot arms they are prone to movement and flex. Compared to CNC machines they are much less precise because of this.

Most robot arms on the market cannot get anywhere close to 0.01mm precision, let alone hit the same mark again. And this includes the smaller ones similar to what you are trying to build. (UR and Motoman smartseries)

I just checked the specs for a UR 3, repeatability (ability to hit the same mark multiple times) is +- 0.1mm.

If you can build something close to 0.01mm precision on a hobbyist budget I would be impressed.


问:
I wanna make a raspberry pi car using an RC car. I would like to know if the servo multiplexer is necessary?
So I'm working on a project and it involves making a raspberry pi car, be it from scratch or with the help of can rc car. I chose the latter. Now the problem is I don't really have servo multiplexers being sold anywhere in my country, Bangladesh, so I have no idea how to get a hold of them. I read that their main function was to convert radio signals to PWM signals so that it could be sent to either the servo or the servo driver which would than be sent to the servo. But my project really require the radio control portion of the car, as I would like to control it through wifi with the help of my computer.

So I wanna know firstly and clearly, what is the main function of a servo multiplexer?

Secondly, since I'm not planning on using any sort of radio communication with the car and the remote control but only plan on controlling the car using wifi and my computer, will I really need a servo multiplexer?

Thank you

答:
Since you want to control the throttle and steering angle on the car, you will need to be able to send PWM signals to the ESC and servo, respectively.  Given that you are using a raspberry pi (presumably mounted on the car), there are several ways to do this.  The easiest is to use a PCA9685 servo controller and have the RaspberryPi talk to it via I2C serial.  Other options are to send the PWM commands to the ESC and servo directly from the RaspberryPi using the RPi headers.  See here .  Finally, you could also use an arduino in place of the PCA9685; use USB to send commands to the arduino and use the arduino to output the pwm, see here.

The Donkeycar project might be a good place to start.  You can look at that project for how to set up PCA9685. https://www.donkeycar.com/. That project also includes a web server that runs on the car; so you can send the control commands over via a web browser - this could easily be extended to another http client.  You can also control the via bluetooth.  This is a presentation on the anatomy of such a car https://www.youtube.com/watch?v=pq6hiZEdirE


问:
Are there solid state directional sensors available?
I have no problem building little robots which are more or less self driving RC cars.  Now I want them to be aware of and interact with each other.

In simulations they all know the position of all the other robots.  I would like to get something similar working in the real world if possible.

Are there sensors available that will tell me robot A is 0.8 meters away 78 degrees from my right and robot B is 1.2 meters away at 113 degrees from me left?

Direction is more important than distance.

I can sort of get something working with a bluetooth power level sensor on a continuously rotating servo but I'm hoping there are better methods already in use with swarm robotics, although I haven't found any.

Thank you for any insights or leads.

答:
I think you will need a number of sensors to estimate a robot's position/pose and those of the other robots relative to it.

Indoor position systems are like indoor GPS; they can give you very precise positioning of a robot.  You can then have robots share their position (if cooperative). See here.  In any case, this is really good, in conjunction with an IMU and odemetry, for precise localization and navigation.

In a very open space, you could use a scanning 2d lidar like this.  That would be good for detecting an object.   That won't work too well for detecting an object if the space is cluttered, but it could help you navigate the space, avoiding obstacles.

You can use a camera with a 360 degree lens, like kogeto dot, and train a neural network to recognize other robots in the image.  Or to make things simpler, have each robot emit a light, then use computer vision to identify that in the 360.  Identification on the 360 image would give you relative angle as well.  If you had that, you could point a time-of-flight sensor in that direction to estimate the distance.

You could and should use as many of these as possible and combine the sensor data to get a more reliable estimate of the robot's own position/pose and those of the other robots.


问:
How will the currently evaluated computer technology influence robotics and embedded systems in the foreseeable future?
This is my first question on this site, might be a little subjective :)

There is an ongoing process of many cool cyclonic changes of technology in the electronics and software industry.

Concurrency and Parallelism

What will be the implications of GPGPU, Multi-core  and "programming in the large" model in the specific case of embedded software, and how will it influence the styles and conventions in the community?

Single board multicore hardware like soon to be released Parallela can be an example?

Programming language research

The results have been excellent. Functional Programming has supposedly started reaching the masses. It was late night previous weekend when I briefly skimmed through an example of functional reactive programming to solve real time problems. AI people are also suggesting that we should be programming our robots in Declarative Domain Specific languages soon. It would be nice to know the implications on the robotics community.

There has been a tremendous growth of frameworks like ROS and Urbi too!! That should be the region to look upon..

Most of the robotics, embedded and high performance AI codebase directly depends on C/C++ , and though languages like Rust and D are bubbling up, wouldn't it take massive amount of time to adopt the new languages, if ever adaptation begins?

AI

Correct me, but it seems like a lot of time has passed and there are not many major production results from the AI community. I've heard about cognitive architectures of old like ACT-R and 4CAPS. They seem to be in hibernation mode!

There seems to be a lot of work lately on otherwise intelligent systems (solved problems) like Computer vision and Data mining, but these problems cater to supercomputing and industrial crowd more. Could there be any possible shift towards low powered systems soon?

Thanks

答:
There's a lot of advancement on the software side, but there are many reasons why we don't currently see them on robots.

First, notice that there are a huge variety of robots already built or possibly built in the future. So let's look at a couple of them:

Manipulators: A manipulator is just an arm. You define a task for it, it does it. It's dumb, it's big and it's plugged in the wall at some factory. Do you really need AI or parallel processing for a manipulator? Does the programming language even matter? Probably not.

Small mobile robots: a variety of robots are small, or could be small. The biggest issue on those robots is power. To process heavily, you need more power. To provide more power, you need bigger batteries. To carry bigger batteries you need stronger motors. Stronger motors are big and need a bigger support. In short, small robots have to be really energy efficient, that's why they also can't be processing too much. GPGPU's and complicated AI is usually off limits for those robots.

Humanoids: This is probably what you have been thinking when you asked the question. So let's continue this answer assuming you are talking about humanoids, or more generally big mobile robots.

What will be the implications of GPGPU, Multi-core and "programming in the large" model in the specific case of embedded software,

It would be great! Besides the fact that you need proper hardware (actual computers vs. microcontrollers), it would be great. I believe this would specifically be helpful on areas where there is need for processing of huge input data, such as vision or tactile input.

and how will it influence the styles and conventions in the community?

Probably not much. Software is done in modules. Someone writes an odometry module and you use it. If they change the odometry implementation underneath, you won't notice it (much). Using GPGPUs is low-level enough to be part of lower level libraries, and often the actual users (programmers) of the robot would be unaware of it. Multi-core processing is all too easy and I think it's already widely used (you just make threads!)

Functional Programming has supposedly started reaching the masses. It was late night previous weekend when I briefly skimmed through an example of functional reactive programming to solve real time problems. AI people are also suggesting that we should be programming our robots in Declarative Domain Specific languages soon. It would be nice to know the implications on the robotics community.

Basically all non-joke (and even some joke) programming languages we have are turing-complete. This means that they can all get the job done. So choosing a language is really just a matter of convenience. Currently, C is the ubiqutous languange for every architecture. Everything can link to C and C is compiled on the remotest microcontroller on this planet. I don't think C could be put aside.

For higher level programming, I don't see any reason why any language couldn't be used. If the robot is controlled by a computer (vs. a microcontroller), it can probably run anything compiled or interpreted in any language.

Regarding real-time, probably you are misusing the word. If you are actually referring to an actual real-time system, then probably the biggest obstacles are the tools. Believe it or not, there are not many good ones. I program in real-time and trust me, there's something wrong with each of them. Still, you'd probably be forced to write in C or C++ if you want to use any of those tools.

There has been a tremendous growth of frameworks like ROS and Urbi too!! That should be the region to look upon.

I don't know Urbi, but I know ROS. ROS is quite famous, and everything you make, people immediately request a ROS module. It's nice, it works, but it's not perfect. Biggest flaw is that it can't be real-time, but they can't really be blamed. What I mean is, it's not a region to look upon, it's a region where people are already at.

Most of the robotics, embedded and high performance AI codebase directly depends on C/C++, and though languages like Rust and D are bubbling up, wouldn't it take massive amount of time to adopt the new languages, if ever adaptation begins?

It sure will. As for embedded systems, I doubt it would ever change away from C, definitely not to a functional language. C is quite low-level yet very high-level. It's at the exact sweet spot for embedded programming. You can be portable yet have access to all hardware.

Embedded programming is in direct violation of most of what's important in a functional language. The fact that you are working with hardware means that the functions can't be pure (in Haskell, they would be IO). So what would be the benefit of functional programming if most functions are not-pure and their results can't be cached? Besides, it's not even practical to load a whole interpreter of a functional language in a tiny microcontroller and hope to be able to use all sorts of dynamic caching during runtime to compensate for lack of non-functional language structures.

In short for microcontrollers, functional languages simply aren't fit. For "high performance AI codebases", there is again no reason why they can't be used. It's just that people have to pick up one of those languages and start using it. Biggest problem is though that People are lazy and don't like change.

Correct me, but it seems like a lot of time has passed and there are not many major production results from the AI community. I've heard about cognitive architectures of old like ACT-R and 4CAPS. They seem to be in hibernation mode!

They are not in hibernation mode. The nature of the research has changed. Take a look at a very brief history of AI on Wikipedia. Whereas in the 80s you would see for example a lot of algorithms developed on solving NP-complete problems, now you see artifical intelligence for example in Kinect that you usually don't think of as "intelligent".

There is also a lot of way more complicated research going on such as cognitive science and others. My personal feeling is that they are still maturing and not yet at a stage that could be widely used. Either that, or I have just been ignorant about it myself.

There seems to be a lot of work lately on otherwise intelligent systems (solved problems) like Computer vision and Data mining, but these problems cater to supercomputing and industrial crowd more. Could there be any possible shift towards low powered systems soon?

Could there? Yes. Would there? Probably not. Like I said before, heavy processing requires power and power is very precious on a (mobile) robot. There would however definitely be a middle-ground used in robotics. Perhaps not a super complete AI, but a dumbed down, simpler one (but still more intelligent than current) would be placed on robots.


问:
Automatic forward and reverse Brushless Motor
The video Here shows a motor using rotational motion to move a load forward and then reverse back, without manually switching it to reverse.

How can I program my brushless motor to operate like the motor in the video.

Can I achieve it using what I already have?, if yes, how?

If not, what additional parts (Drivers/Controllers/Arduino) do i need?

What additional software do i need?

What I have:

Brushless motor

ESC

DC Motor Speed Controller

ESC Programmer

RC Program Card Electronic Speed Controller Programmer

Brushless DC Motor Controller, DROK 6.5-24V 12V 12A Sensorless Hallless Three-phase Electronic Motor Speed Driver

答:
The DC motor you have is a brushless type typically used to turn a propeller on a drone.  It can go in 'reverse' using an brushless ESC that supports reverse.  I would not think most ESCs used for propellers would not bother doing that.  Rather, look for a brushless ESC for an RC car and specifically look to see if it has reverse.  The brushless ESC can be controlled easily with PWM signals, so an Arduino or and PCA9685 can be used to generate those control signals (or even the pins on a RaspberryPi if that is what you have).

One thing to keep in mind, a simple brushless motor like that is hard to control at low speeds.  To create an actuator like in the video you would need to add a lot of gearing so you can run it at high rpm.  It would be much easier to use a stepper motor.  An actuator like that in the video is less expensive than all of those parts, so think about whether to buy or build.


问:
Drone or UAV Platform for deployment of Deep Learning / Reinforcement Learning
Good day,

It has been a while since I last posted. I would just like to ask if anyone part of a lab or company doing research on aerial robotics has any suggestions of a good platform for deploying computer vision algorithms for aerial robots?

Currently our lab has a set of DJI Matrice drones but are too heavy for our liking. We really wanted to use the Skydio R2 drone for out future research projects but found out later that the SDK does not allow access for implementing our own Deep Learning or Reinforcement Learning networks (only allows the user to code their own preset movements in python). We also took a look at the Parrot AR drones but found that they were discontinued and do not have the computing power that the Skydio has.

I suggested that we stick with the DJI Matrice and just use an Nvidia Jetson for deployment but I am still curious to know if anyone knows of other available platforms. Does anyone know of a more compact platform available for research purposes?

Thank you :)

答:
there seems to be no mature drone platform focused on the NN research

personally I suggest using a drone combines a NUC, TX2 for example

the drone works as a flying platform providing control APIs, and a gimble system if possible

the vision system can be constructed by NUC, you can put your own camera on it and do your NN research

for this design, you need a drone platform that should be friendly to mount customize devices. I suggest Matrices 100 or DJI A3 with your own frame, which have enough space and can privide power to your NUC.


答:
The motor in your list is sensorless meaning that there is no provision internally for commutation feedback.  Such a motor cannot be operated reliably below 10-20% of it's maximum speed and it requires a fairly complex sequence to initiate rotation when stopped.  All of this is because the controller needs to know the rotor's position relative to the stator while running and that is determined by detecting when the voltage from the undriven winding (at the motor rotates the windings are driven in sequence) crosses zero and at low RPM the voltage is too low to sense accurately.

To operate a BLDC motor in servo (position control) or full range reversible variable speed mode some feedback is required.  For servo mode that usually means a rotary encoder and for either you need at least a "hall effect" commutation sensor which has three outputs that indicate which magnetic pole is closest to alignment with the rotating magnet.

Here's a couple links to projects using an Arduino plus some homemade electronics to control a BLDC motor with hall effect feedback:

https://www.vbesmens.de/en/positioning-controller.html
https://simple-circuit.com/arduino-bldc-brushless-dc-motor-control/

Neither has encoder feedback which is necessary if you need to control the motor's position to a small fraction of one rotation, but both designs will allow complete control of the motor's speed and direction from an Arduino.

Title: Automatic forward and reverse Brushless Motor

Body:
The video Here shows a motor using rotational motion to move a load forward and then reverse back, without manually switching it to reverse.

How can I program my brushless motor to operate like the motor in the video.

Can I achieve it using what I already have?, if yes, how?

If not, what additional parts (Drivers/Controllers/Arduino) do i need?

What additional software do i need?

What I have:

Brushless motor

ESC

DC Motor Speed Controller

ESC Programmer

RC Program Card Electronic Speed Controller Programmer

Brushless DC Motor Controller, DROK 6.5-24V 12V 12A Sensorless Hallless Three-phase Electronic Motor Speed Driver


问:
Understanding Impedance Control
I have a question regarding impedance control for a robotic manipulator.

Given that we have a task space trajectory:
$\ddot{x}$, $\dot{x}$ and $x$

And the dynamics model of the robot:

$$\tau = M(q)\ddot{q} + C(q,\dot{q})\dot{q} + G(q) + J^\intercal F_{ext}$$

Control law:

$$u = M(q)a_{qin} + C(q,\dot{q})\dot{q} + G(q)$$

Forward dynamics model (Robot):

$$M^{-1} \{ u - C(q, \dot{q})\dot{q} - G(q) -J^\intercal F_{ext} \} = a_{qin}$$

Where $M(q)$ is the inertia matrix, $C(q,\dot{q})$ is the coriolis matix, $G(q)$ is the gravitational load vector, $J^\intercal F_{ext}$ is the external force exerted onto the links, $\ddot{q}$, $\dot{q}$ and $q$ are the joint space trajectories, $\tau$ is the torque, $u$ is the control signal and finally $a_{qin}$ is the computed joint acceleration for the control law.

$$\ddot{q} = a_{qin}$$

For the above, we have impedance control (Spong M.W, 2006), where:

$$\alpha = \ddot{x}^d + M_d^{-1} (B_d (\dot{x}^d - \dot{x}) + K_d(x^d - x) + F)$$

Where the closed loop form is:

$$M_d \ddot{e} + B_d\dot{e} + K_d e = -F$$

where $e = (x^d - x)$, and $\ddot{x} = \alpha $ (double integrator system)

$$a_{qin} = J^{-1} (\alpha - \dot{J} \dot{q})$$

With $M_d$ being the inertia, $B_d$ the damping and $K_d$ stiffness coefficients for each of the degrees of freedom for the Task-space trajectories $\ddot{x}$, $\dot{x}$ and $x$ and $F$ is sensor force?.

Here is how I see the block diagram of the system (and it might be wrong):

My question:
Where does the force
$$F$$

Come into play? Is it the same as:

$$F_{ext} = F$$

If $F_{ext} = F$, does this mean that the Force from the sensor is:

$$\tau = M(q)\ddot{q} + C(q,\dot{q})\dot{q} + G(q) + J^\intercal F ?$$

These general equations are all fetched from (Spong M.W., 2006) and I am just trying to make sense of them. Consider me an idiot, but I need help :(!

答:
Yes, it is the same, $F$ should be the same as $F_{ext}$. And $F$ comes from a sensor or an estimation, in general from a force sensor.

The diagram seems correct and you may have $F$ and $F_{ext}$ coming from the same source.

The impedance controller is an indirect force control, you directly do not control the force exerted to the environment but rather a behavior to an external force based on the position error of the manipulator (mass spring damper system).

A hybrid force/position control where you have a cascaded force control with an impedance control can directly control the force while having a mas spring damper behavior.

Title: Understanding Impedance Control


问:
Is SLAM done only first time in a given environment
I am training Turtlebot 2 to move around the office. I come from robotics hardware background but relatively new to computer vision and robotic mapping.

Here are my two fundamental questions related to localization and mapping.

The algorithm we are using to mapping is SLAM. This makes sense but my question is in general, if we have performed SLAM, then the map is created and this map can be saved for later. So is it right to say, next time if the bot moves in the same environment, it is not using SLAM but instead only localisation (since the map already exist). Is SLAM in general used only for first time mapping within an environment?

If there is no mapping at all, can bots be trained to move randomly and turn back or around only if there is an obstacle or wall.  This wouldn't require mapping, right? So is it right to say, bots can be moved either by mapping or without mapping, depending on the need.

答:
Is SLAM in general used only for first time mapping within an
  environment?

Mostly, yes however there have been some works where the researchers tried to update the map. You can reuse the map later if the map is static. In most cases, this is not true in real life.

If there is no mapping at all, can bots be trained to move randomly
  and turn back or around only if there is an obstacle or wall. This
  wouldn't require mapping, right? So is it right to say, bots can be
  moved either by mapping or without mapping, depending on the need.

As @nayab has said, you can operate in the environment without a map, however, using a map allows you to localize the robot in the map and plan the trajectory. You can still localize a robot without a map, using a global localization system (GPS/GNSS) or if it were indoor using beacons.

You can plan a trajectory using a topological map, not necessarily a metric map.


答:
SLAM is a recursive algorithm with no base case. I suppose you could have a termination criteria for the algorithm stating that "This Map is Sufficient", and then change your algorithm to localization. If you already have a map of your environment, then no, SLAM is not necessary. So to answer your first question plainly, yes.

The type of agent you are referring to is a simple reflex agent without an internal model (does not track the environment state). This is one of the simplest types of agents and while yes, it can be used, it cannot make any guarantees of successful navigation.

Title: Is SLAM done only first time in a given environment

Body:
I am training Turtlebot 2 to move around the office. I come from robotics hardware background but relatively new to computer vision and robotic mapping.

Here are my two fundamental questions related to localization and mapping.

The algorithm we are using to mapping is SLAM. This makes sense but my question is in general, if we have performed SLAM, then the map is created and this map can be saved for later. So is it right to say, next time if the bot moves in the same environment, it is not using SLAM but instead only localisation (since the map already exist). Is SLAM in general used only for first time mapping within an environment?

If there is no mapping at all, can bots be trained to move randomly and turn back or around only if there is an obstacle or wall.  This wouldn't require mapping, right? So is it right to say, bots can be moved either by mapping or without mapping, depending on the need.


答:
This is a simple problem which can be solved with an Arduino, Brushless ESC with forward and backward capabilities, thats all.

You need to program the Arduino to provide a PWM signal to the ESC, it's not a standard PWM but yet a set of pulses sent within a specific timeframe, you can do this by using the Servo library provided by Arduino.

To learn more on how to get the ESC and Arduino to work together check this How to use ESC with Arduino


问:
Uncertainty in grid based fastslam
Given I am building a grid map, and poses are represented using particles, how can I calculate the uncertainty of a pose In a grid based fastslam 2.0?</p>

答:
This depends on how you want to quantify the uncertainty. For example, you can compute the sample covariance between all state variables i.e.,

$$ q_{jk}  = \frac{1}{N-1} \sum_{i=1}^{N} (x_{ij} - \bar{x}_j) (x_{ik} - \bar{x}_k) $$

where the covariance matrix is $\mathbf{Q}$ with entries $q_{ji}$. This is straightforward; however, different approaches exist. For estimating the uncertainty, you could then compute the trace or determinant of the covariance matrix, but other metrics exist as well.

Title: Uncertainty in grid based fastslam


问:
Newton-Euler Inverse Dynamics by Screw
I paste this algorithm from textbook Modern Robotics P294 in chapter 8:

This is coordinate invariance of Newton-Euler equations. In the textbook, they use the frame is centers of mass so the inertial matrix is simple and beautiful, but the result torque $\tau$ is applied in the centers of mass and NOT in the joint frame. so, when we use this frame, \tau maybe need some transformation from centers of mass to the joint frame?

答:
maybe need some transformation from centers of mass to the joint frame?

Isn't that what $A_i$ is? I don't have the book with me, but from your excerpt:

Let $A_i$ be the screw axis of joint $i$ defined in $\{i\}$

where it says at the top,

frames $\{1\}$ to $\{N\}$ [are attached] to the centers of mass of links $\{1\}$ to $\{N\}$

Title: Newton-Euler Inverse Dynamics by Screw


问:
How to determine actuator and process for PID, and how to intepret the output
Imagine there is a web service (let's say Twitter) that handles tons of requests from around the world. I want to figure out how to let the web service pick a certain amount of (let's say 1 billion) requests within a full month, smoothly. By "smoothly" it means I prefer not to have a solution that picks the very first 1 billion requests of the month then becomes idle. The distribution of the picked requests should roughly match the distribution of real traffic. However, the traffic to Twitter is always fluctuating and hard to predict beforehand (e.g., in the case of Superbowl) so I would like to apply a PID controller as below:

Setpoint: number of requests I gonna pick for the next time interval

Input: number of requests I actually pick for the next time interval

Setpoint can be set as (1 billion monthly goal - how many have I picked so far in the month) / number of time intervals left. Input is obviously simply an observation value.

Here come the parts I am confused: what should be the choice of actuator and process, and how to interpret the PID formula output? According to these videos on PID controller (1, 2):

In the case where you want to control a quadcopter s.t. it hovers on a certain height, propellers are the actuators and the drone is the process that is lifted by propellers. If the output is x, you set the RPM to x.

In the case where you want to control a bot s.t. it stops in a spot 50m away, robot feet are the actuators and the robot is the process that is driven by its feet. If the output is x, you set its speed (m/s) to x.

With a similar thought, in the system I describe, I want to consider a simple filter that picks any incoming request by a rate r as the actuator, and the process is the web service itself. But there can be of course many other options to pick the actuator and the process function.

Am I correct that: PID itself does not care about the actuator and the process. It is nothing more than a formula that takes in a set of parameters and observation values, then give you the "output". It is your call to pick an (actuator, process) combination and interpret the output accordingly, either RPM / speed(m/s) / filter rate r.

答:
Am I correct that: PID itself does not care about the actuator and the process.

Yes.  But keep in mind that a PID controller works well for processes that have a certain kind of dynamics, namely that they have some constant or slowly moving offset which driven by some random process with a finite variance (or are driven by something that can be reasonably modeled as such).

You may find that your network processes don't fit that "finite variance" criteria.  In particular, your Super Bowl example -- if you didn't predict it by knowing when the Super Bowl is showing -- would have a very long-tailed distribution.

To use your Super Bowl example, you'd start by over-collecting (because you didn't know the event was coming), then you'd lack space for the Super Bowl, then you'd under-collect for a while.

Given that events are, essentially, totally unknown, it may be better to modify the algorithm that you initially describe -- pick the first billion samples, but time-stamp them.  Then, as more traffic comes in, discard existing samples so that the daily (or hourly) distribution of samples is driven to be a scaled version of the actual traffic, or whatever distribution you think is best.


答:
I think you're way overthinking this.

If you want to evenly handle N events in a month, then you convert a month to whatever time granularity you like (T) and then handle (N/T) events per T.

For example, if you want to handle 300 events in a 30 day window, and you want it smoothed to the day, then you handle (300/30) = 10 events per day.

If you have a billion events you want to handle in a 30 day window, and you want it smoothed to the millisecond, then you convert a month to milliseconds:

$$
T = (30 \mbox{days} * 24\mbox{hr/day} * 3600\mbox{s/hr} * 1000\mbox{ms/s}) \\
T = 2,592,000,000 \\
$$

Then you handle (N/T) events per T, or (1,000,000,000 / 2,592,000,000) events per millisecond. This works out to 0.3858 events per millisecond.

You can invert that number (1/result) or (T/N) to get T's per event, or in this example milliseconds per event - (2,592,000,000 / 1,000,000,000) = 2.592 milliseconds per event.

So, to "smoothly" handle a billion events per month, set a timer for 2.592 milliseconds, then handle that event. You can add the sample delay to your next timer, such that if you actually wind up waiting 3 ms for the next message to come in, then you've waited "too long" by (3 - 2.592) = 0.408 ms, so you can adjust your next timer by the same to get "back on track" - the next timer becomes (2.592 - 0.408) ms = 2.184.

If perfectly sampled, you'd get two new samples at (2.592 + 2.592) = 5.184 ms, and with the delay-forwarding above you still get two new samples, even if the first one is delayed, in (3 + 2.184) = 5.184 ms.

Title: How to determine actuator and process for PID, and how to intepret the output

Body:
Imagine there is a web service (let's say Twitter) that handles tons of requests from around the world. I want to figure out how to let the web service pick a certain amount of (let's say 1 billion) requests within a full month, smoothly. By "smoothly" it means I prefer not to have a solution that picks the very first 1 billion requests of the month then becomes idle. The distribution of the picked requests should roughly match the distribution of real traffic. However, the traffic to Twitter is always fluctuating and hard to predict beforehand (e.g., in the case of Superbowl) so I would like to apply a PID controller as below:

Setpoint: number of requests I gonna pick for the next time interval

Input: number of requests I actually pick for the next time interval

Setpoint can be set as (1 billion monthly goal - how many have I picked so far in the month) / number of time intervals left. Input is obviously simply an observation value.

Here come the parts I am confused: what should be the choice of actuator and process, and how to interpret the PID formula output? According to these videos on PID controller (1, 2):

In the case where you want to control a quadcopter s.t. it hovers on a certain height, propellers are the actuators and the drone is the process that is lifted by propellers. If the output is x, you set the RPM to x.

In the case where you want to control a bot s.t. it stops in a spot 50m away, robot feet are the actuators and the robot is the process that is driven by its feet. If the output is x, you set its speed (m/s) to x.

With a similar thought, in the system I describe, I want to consider a simple filter that picks any incoming request by a rate r as the actuator, and the process is the web service itself. But there can be of course many other options to pick the actuator and the process function.

Am I correct that: PID itself does not care about the actuator and the process. It is nothing more than a formula that takes in a set of parameters and observation values, then give you the "output". It is your call to pick an (actuator, process) combination and interpret the output accordingly, either RPM / speed(m/s) / filter rate r.


问:
Controlling a robot arm to follow an SE(3) trajectory
I have a 7-DOF robot arm, and I want it to follow a trajectory. This trajectory is defined as a dense sequence of SE(3) waypoints, which were collected by moving the robot arm manually (i.e. by providing a demonstration of a task).

So at each time step, I have a translation error and a rotation error (the error is the distance between the robot's current pose, and the nearest-neighbour demonstration pose). These then need to be converted into a translational velocity and rotational velocity.

But if I just divide each by the time step, (i.e. velocity = distance / time), then this would cause the robot to have a very high velocity when it is further away from the demonstration trajectory. However, I want the robot to move smoothly, with a smooth (ideally constant) translation and rotation velocity. How can I do this?

Thanks!

答:
The Orocos-KDL library might have what you're looking for.

You can first construct a spline-path using Path__RoundedComposite. Each way point is defined with a desired position and orientation. Once the path has been defined, add velocity information using the VelocityProfile class. For a smooth motion, you've 2 options: spline and trapezoidal. If sudden start and stop is acceptable, you could go with rectangular too.

Here's an example from their official repository.

Once you've the trajectory down, extract inverse position and velocity kinematics using KDL's inverse kinematics solvers (assuming you've defined your robot as a KDL chain).

The math underlying all this (for eg. adding timing law to a Cartesian path, rotation interpolation) is pretty interesting, but it might take some time to code all that yourself ... that'd be a great learning experience nonetheless.


问:
Roboticize an old netbook?
I have an old beat-up netbook that is currently collecting dust. I've also only taken stuff apart, without having to worry about putting it back together, so please bear with my possibly stupid questions.

a) I imagine it's possible to wire this baby up to servos, breadboards, and all that good stuff. Am I correct?

b) I'd like to start with some simple Raspberry Pi-like projects (think automating my irrigation system, feeding the dog from work, etc). Obviously barring the energy expenditure, wouldn't a netbook be more apt than a Raspberry Pi for handling this type of thing?

c) I have basic Python experience, but I wouldn't mind picking up more as I go. Would that be sufficient?

Cheers!

答:
Of course this can be done, however the important bit isn't really the netbook here. The important bit is the type of interface you decide to use and the command language you code in to control that interface.

Your netbook probably has USB and possibly serial - but you need to have a way to connect these to relays and voltage control devices.

X10 or NexTag produce a range of USB compatible interfaces, and provide a controller language. They provide a very simple, beginner's route to home automation and control.

For more fun, you could build your own serial interface board - which converts the signals from the 9 serial pins to useful output, but this is more of an electronics project - not for the faint hearted :-)

Title: Roboticize an old netbook?


问:
How do I get the matrix for the mass?
Hi im currently studying for an introduction on robotics test and i have this task to calculate the kinetic and potential energy of the robot.
The robot is an open chain and has one rotating joint as base then an arm as translatoric joinz and one rotating joint again.
Each of those joints has a mass m. </p>

<p>m1,m2 and m3. And i need some matrix to express the masses of these joints so that i can calculate the energies. </p>

答: Maybe you can use CAD software such as soildworks to read the inertial matrix after set link materials.But software also use the basic formula calculate matrix if you know the properties of link.</p>

Title: How do I get the matrix for the mass?


答:
If you have the Jacobians from joint velocities to link body velocities (you can calculate these by taking each link $i$ as if it were the end effector and calculating its body Jacobian $J^{b}_{i}$), then you can get the mass matrix for each link with respect to the joint angles as the transpose of the link's Jacobian multiplied by the link's mass and inertia matrix $mu_{i}$ multiplied by the link's Jacobian,

$$M_{i} =  (J^{b}_{i})^{T} \mu_{i} J^{b}_{i},$$

and the total mass matrix with respect to the joint velocities as the sum of the individual links' mass matrices,

$$M = \sum_{i} (J^{b}_{i})^{T} \mu_{i} J^{b}_{i}.$$

Assuming that we put the link body frames at their centers of mass, the link mass matrices have the form

$$ \mu_{i} = \begin{bmatrix} m_{i} & & \\ & m_{i} & \\ && I_{i} \end{bmatrix}$$

for planar systems (where $m_{i}$ is the mass of the link and $I_{i}$ is its moment of inertia), or

$$ \mu_{i} = \begin{bmatrix} m_{i} & & &&& \\ & m_{i} & &&& \\ &&m_{i} &&& \\ &&& \phantom{-}I_{xx,i} & -I_{xy,i} & -I_{xz,i}\\&&& -I_{yx,i} & \phantom{-}I_{yy,i} & -I_{yz,i} \\&&& -I_{zx,i} & -I_{zy,i} & \phantom{-}I_{zz,i} \end{bmatrix}$$

for systems moving in three-dimensional space. If the link body frames are aligned with the principle axes (longest and shortest mass distributions) of the links, then the off-diagonal $I$ terms in the local expression of the three-dimensional moment of inertia become zero,

$$ \mu_{i} = \begin{bmatrix} m_{i} & & &&& \\ & m_{i} & &&& \\ &&m_{i} &&& \\ &&& I_{xx,i} &  & \\&&&  & I_{yy,i} &  \\&&& & & I_{zz,i} \end{bmatrix}.$$

Title: How do I get the matrix for the mass?

Body:
Hi im currently studying for an introduction on robotics test and i have this task to calculate the kinetic and potential energy of the robot.
The robot is an open chain and has one rotating joint as base then an arm as translatoric joinz and one rotating joint again.
Each of those joints has a mass m. </p>

<p>m1,m2 and m3. And i need some matrix to express the masses of these joints so that i can calculate the energies. </p>


问:
Asynchronous axes movement
if we have a robot with 5 DoF and we want to plan its movement. The inverse kinematic solver will do this job without a doubt. However, it is usually assumed that axes can be moved in a synchronized way. More precisely, if the solution of my IK solver is q_dot = [0.01,0,0.01,0.01,0.01], the robot will try to move 4 axes at the same time, however, what if the power of the robot is just sufficient to move only 2 axes at the same time. The actual motion will be probably different than one expected.

Questions:

Using the nullspace technique, one can pre-define the sequence of axes so that axes are moved in this pre-defined hierarchy. However, I am afraid that this approach will limit the flexibility of the robot too much. Does anyone know a better solution or reference about it?

答:
You could use joint constraints with timers or guard conditions applied to them.

Basically, the constraint of the axes that you don't want to move, you can set to zero degree allowed angles change. Then change this constraint to something non-zero, when certain condition is met.
This condition can be your timer, or the fact that other axes have finished their move, or reached certain angle. In turn this other turning axes constraints can be set to zero angle at the same time. This way you can have only a set of axes rotating (or translating if that is what you need) at the same time.

Now, joint constraints can be very tedious. I am not sure how well you can apply them to conventional IK solutions, but they certainly lot easier to use with iterative solvers.
My practical suggestion would be to use FABRIK solver, with conic joint constraint projected on a 2D plane.

You can find more information here: http://www.andreasaristidou.com/FABRIK.html
If high precision is not the main target, this solution is pretty good.
My personal experience is, that this solver is very fast and gives a natural motion. Also, conic constraints can be applied relatively easily.

Hope this helps you progressing on your project.

Title: Asynchronous axes movement


问:
How to find inverse kinematic equations for a quadruped robot to make it walk?
I have made a model of quadruped robot (sprawling/spider type and not dog type) in V-rep and now I want to make it walk by using creep gait. (i.e moving 1 leg at a time)

As I understand, I have to solve inverse kinematics equations for each leg to move it from one position to another.
How can I find out the inverse kinematics of my quadruped robot?

Is it possible to make the V-rep model of quadruped robot walk without knowing the inverse kinematics equations?
Please help!

答:
I think Felipe's answer is very useful. In addition to it I would suggest iterative IK solvers.

In the recent months I've got involved in using FABRIK solver. It is very simple to understand and implement. Also it does not require extensive trigonometrical knowledge.
As a result you can get a very natural leg movement and the algorithm is very fast.

See the link for more info:
http://www.andreasaristidou.com/publications/papers/FABRIK.pdf


问:
Velocity description in Screw Motion Theory
As described in the book Modern Robotics by Frank C. Park the velocity of a reference frame can be described as :

$$V_s = J_s(\theta)\dot{\theta}$$
$$V_b = J_b(\theta)\dot{\theta}$$

However in the definition of the spatial velocities $V_s$ and $V_b$ we have that:

$$ V_s = [\omega_s, v_s]^T  \in \mathcal{R}^6$$
$$ V_b = [\omega_b, v_b]^T  \in \mathcal{R}^6$$

I get the idea that $\omega_s$ and $\omega_b$ are the angular velocities as seen from each reference frame, however I quite dont get what does $v_s$ and $v_b$ are making reference to.

答:
The body velocity $V_{b}$ is the velocity of the frame with respect to the world, as seen from the frame's perspective. Its rotational component $\omega_{b}$ contains the rotation rates around the world-fixed axes instantaneously pointing in the frame's forward, lateral, and dorsal directions (local $x$, $y$, and $z$), and its translational component $v_{b}$ contains the frame's translational velocities along these axes.

The spatial velocity $V_{s}$ is the velocity of the frame with respect to the world, as seen from the perspective of a second frame rigidly attached to the first frame, but currently located at and aligned with the frame at the origin. Its rotational component $\omega_{s}$ contains the rotation rates of this second frame around the world axes, and its translational component $v_{s}$ contains the translational velocity of this second frame along the world axes.

For an explanation of why the spatial velocity is useful, see my answer to this question.


问:
Absolute 2D pose from previous pose and measurement
I have a pose $\boldsymbol{x}_0 = (x, y, \theta)$ in an absolute frame, right-handed and centered in (0, 0, 0). I obtain a measurement $\boldsymbol{m} = (\Delta x, \Delta y, \Delta \theta)$ in the previous pose coordinate system.

What is the new pose $\boldsymbol{x}_1$ in the absolute frame?
If the previous pose had a covariance $\Sigma_{x_0}$, and the measurement has a covariance $\Sigma_{m}$, what is the covariance of the new pose $\Sigma_{x_1}$?

答:
For your first question, it's just a a change in coordinate frames, you have the absolute coordinate frame and a coordinate frame "local" which is centered in x0 and the pose is in the local coordinate frame.

The equation would look like that:

$ \bigg( \begin{matrix} x'\\ y' \\ \theta' \end{matrix}\bigg) = \bigg( \begin{matrix} cos(\theta) & -sin(\theta) & x0 \\ sin(\theta) & cos(\theta) & y0 \\ 0 & 0 & 1 \end{matrix}\bigg)  \bigg( \begin{matrix} x \\ y \\ \theta \end{matrix}\bigg)$

For the second question I think it's ok to also take into account the covariance matrices in the previous eq.
$ \bigg( \begin{matrix} x'\\ y' \\ \theta' \end{matrix}\bigg) = \bigg( \begin{matrix} cos(\theta) & -sin(\theta) & x0 \\ sin(\theta) & cos(\theta) & y0 \\ 0 & 0 & 1 \end{matrix}\bigg) Q_{m}  \bigg( \begin{matrix} x \\ y \\ \theta \end{matrix}\bigg)Q_{x1}$


问:
ROS packages for *pre-planned* path navigation rather than path generation? (Turtlebot3/ROS)
I am working on a project in which users will create paths fully constrained in terms of position (using a separate piece of software), and a robot will periodically follow those paths. We are using a Turtlebot3 for this project, which comes with lots of support for path planning. However, because we already know exactly what paths we want the robot to follow, this functionality (and related ROS packages) is not very useful for us. I am wondering if there are already reliable ROS packages for following pre-defined paths, rather than path generation.
Our paths will include:
-Straight lines
-Rotations around a point
-Circles
-Circular arcs

We can define the paths in terms of coordinates or geometric qualities (radius, distance, angle).

Turtlebot comes with a node for navigating to a given coordinate, which I’ve adapted to go to a series of coordinates, and is very useful for straight lines and rotations. However, it is not good for following circles, as its algorithm sends the robot to the specified coordinate then rotates to the specified angle. (turtlebot3_pointop_key in https://wiki.ros.org/turtlebot3_example)

I know it would not be very hard to create this functionality on my own (I’ve already written a few basic algorithms for circle and arc navigation) but I would prefer to use a package if one already exists. Or if someone knows a reliable way to add circle functionality to the pointop_key node. Also note that we would prefer to work in Python if possible.
Thank you!

答:
Have a look at asr_ftc_local_planner.

I have no experience with asr_ftc_local_planner, so here is a paragraph from its description:

"This package provides an implementation of the "Follow the Carrot" algorithm to local robot navigation on a flat plane. Given a global plan to follow and a costmap, the local planner produces velocity commands to send to a mobile base. The parameters for this planner are also dynamically reconfigurable. This package implements the asr_nav_core interface for a local planner."


问:
Is it possible to run multiple loops at the same time? (Arduino)
I've got a code where I have a motor running back and forth and buttons connected to a scanner, when I press the buttons it causes the motor to stop  and over rides it. I would like them to run parallel to each other so the codes don't interrupt each other.

Here is my code

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

// Define some steppers and the pins they will use

AccelStepper stepper1(AccelStepper::FULL2WIRE, 2, 3);

const int buttonPin = 4;
const int button2Pin = 14;
const int pulseopto1 = 9;
const int startScan = 11;

int buttonState = 0;
long previousMillis = 0;
long interval = 5;

void setup()
{
    pinMode(buttonPin, INPUT);
    pinMode(button2Pin, INPUT);
    pinMode(pulseopto1, OUTPUT);
    pinMode(startScan, OUTPUT);
    stepper1.setMaxSpeed(40000.0);
    stepper1.setAcceleration(100000.0);
    stepper1.moveTo(25000);
}

void loop()
{
    buttonState = digitalRead(buttonPin);

    if (buttonState == LOW)
    {
        digitalWrite(startScan, HIGH);
    }
    else (buttonState == HIGH);
    {
        digitalWrite(startScan, LOW);
    }

    {
        buttonState = digitalRead(button2Pin);

        if (buttonState == LOW)
        {
            // turn LED on:
            digitalWrite(pulseopto1, HIGH);
            delay(5);
            digitalWrite(pulseopto1, LOW);
            delay(5);
        }
        else
        {
            // turn LED off:
            digitalWrite(pulseopto1, LOW);
        }
    }

    // Change direction at the limits
    if (stepper1.distanceToGo() == 0)
    {
        stepper1.moveTo(-stepper1.currentPosition());
    }

    stepper1.run();
}
</code>```

答:
What do you mean by override? Does the motor stop or does it start turning in the wrong direction?

There is something weird going on with the brackets in the loop() function

```<code>if (buttonState == LOW)
{
    digitalWrite(startScan, HIGH);
}
else (buttonState == HIGH);  //This shouldn't be here. Just use else
{
    digitalWrite(startScan, LOW);
}
</code>```

I'm not sure, but I don't think you need to call stepper1.run() in the loop function. Try placing it at the end of the setup() function instead.

Body:
What do you mean by override? Does the motor stop or does it start turning in the wrong direction?

There is something weird going on with the brackets in the loop() function

if (buttonState == LOW)
{
    digitalWrite(startScan, HIGH);
}
else (buttonState == HIGH);  //This shouldn't be here. Just use else
{
    digitalWrite(startScan, LOW);
}

I'm not sure, but I don't think you need to call stepper1.run() in the loop function. Try placing it at the end of the setup() function instead.


问:
Bump and turn toys: how do they work?
I remember that when I was a kid, in the 1980s, I had some toys made in Taiwan that basically worked like this: they moved forward uniterruptily until they bumped into an obstacle; then they moved back a few centimeters and then keep moving forward with an angle in relation to the original trajectory of 15-30º clockwise; unless they bumped something while turning back, so a forward movement was triggered, which made then move in a smaller angle.

With this routine, they could basically move everywhere in the house. I don't know very well their mechanism, all they had in common was was a wheel (or wheels?) under a metallic circle under the toy; or maybe an arc of circle where a wheel could change its direction by changing its position on the arc. My memory is fuzzy

Do you people have any idea of what was the mechanism of these toys? I am pretty sure they were quite simple as I don't remember seeing anything complicated inside them. Also, I am not a specialist in robotics, and I couldn't find anything about this type of thing by searching on google.

答:
There's two parts.

The wheel you're remembering is a castor wheel that's designed to stick at straight forward when the car is going forward, and will turn to about 20 degrees when the car goes backwards.  There used to be some really cheap remote-control cars that just had a button that did that (so, no response to hitting a wall).

If you took that mechanism and combined it with a front bumper connected to a microswitch, then the bumper could actuate a timer that would reverse the car for some set amount of time, then go forward.  I suspect that's what these cars you remember did.

Title: Bump and turn toys: how do they work?