问:
Debuging ROS on a Jetson Xavier
I have configured ROS melodic based on the RACECARJ and MIT-Racecar Github repos. Everything runs perfectly on my desktop Linux 18.04 machine.

The script should be able to install the same also on my Nvdia Jetson Xavier with Jetpack 4.2. Everything runs without and error. My nodes (basically the motor controller and the PS3 controller) get detected. However, the car is not moving at all.

I have just started to work with ROS and have no clue how I have to debug this. Should I use Wireshark to compare which packages are received on the 11311 port on my desktop machine as well as on the Xavier? I'd like to see which messages the ROS is sending. I doubt it sends any at all.

I have read about using qtr to debug some stuff graphically. Sadly this didn't work so far. Despite installing ros-melodic-desktop-full with this script. qtr is unrecognized. I was already able to verify that each devices works on its own. I can send commands to the motorcontoller with python and I am able to read the joystick with jstest /dev/input/js0. Unplugging one of them when the ros-script is running gets immediately detected.

答:
First thing's first

It is not qtr, it is rqt. I think you mean rqt_graph. Basically, it shows all of the ROS nodes, topics, and publishing and subscribing going on. If you type rqt and then press TAB, you can see all the options. I suggest you google rqt more.

Command line

Well, the first step is to make sure that all the ROS nodes are running.

```<code>rosnode list
</code>```

Then I would look at the topics

```<code>rostopic list
</code>```

You can then listen on the ROS topics using this command

```<code>rostopic echo /the_topic
</code>```

You are looking for any missing or incorrect or unconnected ROS topics that need to be connected. That should get you going to start. I would make more recommendations, but this question is a bit broad for any more specific details.

(If this answer helped you, a check mark is appreciated :)

Title: Debuging ROS on a Jetson Xavier

Body:
First thing's first

It is not qtr, it is rqt. I think you mean rqt_graph. Basically, it shows all of the ROS nodes, topics, and publishing and subscribing going on. If you type rqt and then press TAB, you can see all the options. I suggest you google rqt more.

Command line

Well, the first step is to make sure that all the ROS nodes are running.

rosnode list

Then I would look at the topics

rostopic list

You can then listen on the ROS topics using this command

rostopic echo /the_topic

You are looking for any missing or incorrect or unconnected ROS topics that need to be connected. That should get you going to start. I would make more recommendations, but this question is a bit broad for any more specific details.

(If this answer helped you, a check mark is appreciated :)


问:
Path Planning algorithm
The broad question is this; given an occupancy grid and the robots current pose (x,y,theta,theta'(first derivative)) how should I plan motion for my robot with the following constraints:

shortest path between 2 points

maintain a minimum distance to obstacles

prefer to stay away from walls - use the center of open spaces

prefer straight lines

limit turn radius (> X cm)

limit maximum change in turn radius (steering angle must be continuous)

limit maximum acceleration

Here is how my current implementation works...

A* for the entire map (only once for a given target location)

the following then loops 5 times a second

Run A* on the local area (1 x 1 meter) overlaying the latest lidar scan and depth camera point cloud data for transient obstacles

given the robots current location (x,y - taken from particle filter), use the A* plan to determine 2 waypoints at 30cm intervals from the current location.

Use gradient descent to plan a path from the current pose (x,y,theta,theta') through the way points (with a bunch of constraints).

Use the first step of the plan from gradient descent for the next action the robot takes.

The problem with this is the gradient descent step, I haven't yet implemented all of the constraints in my cost function and already for certain pose/waypoint combinations it can't solve.

I can get a solve using simulated annealing but this is 100 times slower and can't possibly run 5 times a second.

I've considered using A* taking into consideration the full pose (x,y,theta,theta') which would take it to 4 dimensions and considering the current 2 dimensional A* is just barely fast enough, that doesn't seem like a solution.

so the actual question(s)...

is there something other than GD(gradient descent)/SA(simulated annealing) that I should be using?

have I gone about it all wrong - what is the right way?

答:
shortest path between 2 points

This spec goes into the cost function design.

maintain a minimum distance to obstacles

Given 2D occupancy grid, threshold probability values to get occupied/free cell representation of the environment. Then, expand each obstacle cell by given minimum distance value. Once done, this spec goes into the cost function design.

prefer to stay away from walls - use the center of open spaces

Implement a distance to wall function that computes the minimum distance to the nearest wall for a given (x,y) cell. This distance to wall function can be pre-computed via dynamic programming before invoking the path planner. Once done, this spec goes into the cost function design.

prefer straight lines

This spec goes into the cost function design.

limit turn radius (> X cm) limit

This spec goes into the motion model design.

maximum change in turn radius (steering angle must be continuous)

This spec goes into the motion model design.

limit maximum acceleration

This spec goes into the motion model design. Do you mean linear or angular acceleration?

A vehicle motion model can be chosen as follows:

dx_dt = v*cos(\theta);

dy_dt = v*sin(\theta);

d\theta_dt = v*\kappa;

d\kappa_dt = \alpha;

dv_dt = a;

State X := (x, y, \theta, \kappa, v)

(x,y)  : position [m], x_min <= x <= x_max, y_min <= y <= y_max

\theta : heading [rad], -pi <= \theta <= pi

\kappa : curvature [m^-1], \kappa_min <= \kappa <= \kappa_max

v : linear speed in [m/s], v_min <= v <= v_max

Control U := (\alpha, a)

\alpha : curvature rate [(m*s)^-1], \alpha_min <= \alpha <= \alpha_max

a : linear acceleration [m/s^2], a_min <= a <= a_max

You can implement a graph search algorithm on discretized 5D (x, y, \theta, \kappa, v) state space and 2D control space (\alpha, a).

Your cost function can have the following inputs:

current state: x_cur, y_cur, \theta_cur, v_cur, \kappa_cur

next state: x_next, y_next, \theta_next, v_next, \kappa_next

current control action: \alpha_cur, a_cur

spec 1 (minimizing path length):
  cost_1 := norm (x_next - x_cur, y_next - y_cur);

spec 2 (maintaining a minimum distance to obstacles):
  cost_2 := 'inf' (x_cur, y_cur) on an obstacle in the expanded environment, 0 otherwise;

spec 3 (distance to nearest wall):
  cost_3 := dist2wall(x_cur, y_cur);

spec 4 (preferring straight lines):
   cost_4 = abs(\kappa_cur);

You need to blend these cost terms in your cost function by using some coefficients.

In summary, in order to solve your motion planning problem in a principled way with some optimality guarantees, the steps of your algorithm should be

Expand the obstacles by the minimum distance value

Compute dist2wall values for 2D environment

Run the graph search algorithm on discretized 5D state, 2D control space

The bad news is that searching on 5D space is not practical!

A good roboticist should use a multi-step approach for practical applications. That is, we can first solve the motion planning model using a low-order motion model with state X = (x,y,\theta) and control U =(\kappa) to ensure minimum turn radius constraint (bounded curvature).

dx_ds = cos(\theta);

dy_ds = sin(\theta);

d\theta_ds = \kappa;

State X := (x, y, \theta)

Control U := (\kappa)

Here the derivatives are defined wrt the arclength parameter s not time! Using this low order motion model requires searching only in 3D state space which can be done quickly a graph search algorithm. Once the graph search algorithm computes a geometric path by using the low order motion model, we can smooth out curvature and speed profile by considering curvature rate and acceleration constraints.

The catch is that we cannot guarantee feasibility guarantee anymore. Bad news from a theoretical point! That is, the motion planning problem has a solution per se; and we can compute the optimal solution if we search in 5D state space. However, in the 2-step approach, the initial geometric path may be too close to obstacles; and it cannot be smoothed out to generate a path wrt the given curvature rate and acceleration constraint. To remedy this drawback, in practice, we usually relax the path length cost term little bit, so that the initial path can be computed far from obstacles. Then, the post smoothing method usually works well once the initial path has enough clearance from obstacles.

Another practical advice, for the search algorithm, keep it simple, stupid (KISS)! Try the Dijkstra algorithm first, if it can get the job done, implement the Dijkstra algorithm. Always keep track the invariant properties of the search algorithm implementation for detecting bugs. When implementing a path planner, most of the time is spent on the cost function design, developing a good low-order motion model, and field tests. Just don't waste your time in implementing a complicated search algorithm from papers. A good path planner is the one that you can easily interpret its output by using your intuition.

ContentLicense: CC BY-SA 4.0

Title: Path Planning algorithm


问:
Jumping motion in point to point movement
I have one question about point to point movement.

Let's say the end-effector is placed at $(0,0,0)$ and the goal position is at $(10,0,10)$. The corresponding joint angle value changes $d\theta$ can be computed using an inverse kinematic solver as follows:

$d\theta=J^{-1}*(10,0,10)$

In this case, the computed joint angle value changes will make the robot jump from $(0,0,0)$ to $(10,0,10)$. I tried to prevent this jumping motion by dividing the goal position into $(1,0,1)$ so that the robot can slowly move towards the goal. Will there be other effective methods?

答:
Do you require the end-effector to hit all the via points $(1,0,1),(2,0,2),...(9,0,9)$? Or do you simply want a lower speed as your end-effector swings towards its destination (with no regard for the path traced out by the end-effector)? If it's the latter, you could set an upper limit to the velocity in your motion planner.

If you want to hit all the via points and have a smooth continuous motion, make sure the velocities obtained from the polynomial trajectories at those points are non-zero.


问:
Picking up a cheap timer
I am currently working on ATmega328 timers. But it has maximum timer of only 16 bit. Even with a prescalar of 1024 and 16MHz clock, I can only produce a time interval of about 4 seconds. Although I can code ATmega 328 to get higher time intervals by some methods but I wish to have a 32 bit timer.
Is there any microcontroller from ATMEL(I find them easy to use) which has this capability at the same or lower price?

And what are some other timer options available for longer time durations(days or hours) ?

Thanks!

答:
the following example of AVR assembly should cause you LED to blink on and off every 12 hours @ 16 MHz. Physical pin 11 for the ATMEGA328P is where the blinking occurs. You can change this by altering the location of the bit on the 7th to last line. For 8MHz clocks, divide YH and YL by 2.</p>

```<code>jmp init

.org 0x001A
call timerHandle
reti

.org 0x0034
init:
ldi r16,0b11111111
out DDRD,r16
;load the swap value (0x283C or 10300 timer overflows)
ldi YH,0x28
ldi YL,0x3C
;Enable interrupts for the timer.
ldi r16,0b00000001
out TIMSK1,r16
;set the prescaler to 1024
ldi r16,0b00000101
out TCCR1B,r16

;loops, making sure that interrupts are enabled.
loop:
sei
rjmp loop

timerHandle:
;add 1 to the word.
adiw ZH:ZL,1
;Compare the 16-bit registers, Executing Bottom Match if they're equal.
CP ZH,YH
BREQ topMatch
ret
topMatch:
cp ZL,YL
BREQ bottomMatch
ret
bottomMatch:
;Flip PIND7
in r17,PIND
ldi r16, 0b10000000
eor r17,r16
out PIND,r17
;Reset the counter.
clr ZH
clr ZL
ret
</code>```

Title: Picking up a cheap timer

Body:
the following example of AVR assembly should cause you LED to blink on and off every 12 hours @ 16 MHz. Physical pin 11 for the ATMEGA328P is where the blinking occurs. You can change this by altering the location of the bit on the 7th to last line. For 8MHz clocks, divide YH and YL by 2.

jmp init

.org 0x001A
call timerHandle
reti

.org 0x0034
init:
ldi r16,0b11111111
out DDRD,r16
;load the swap value (0x283C or 10300 timer overflows)
ldi YH,0x28
ldi YL,0x3C
;Enable interrupts for the timer.
ldi r16,0b00000001
out TIMSK1,r16
;set the prescaler to 1024
ldi r16,0b00000101
out TCCR1B,r16

;loops, making sure that interrupts are enabled.
loop:
sei
rjmp loop

timerHandle:
;add 1 to the word.
adiw ZH:ZL,1
;Compare the 16-bit registers, Executing Bottom Match if they're equal.
CP ZH,YH
BREQ topMatch
ret
topMatch:
cp ZL,YL
BREQ bottomMatch
ret
bottomMatch:
;Flip PIND7
in r17,PIND
ldi r16, 0b10000000
eor r17,r16
out PIND,r17
;Reset the counter.
clr ZH
clr ZL
ret


问:
Navigation - GPS + IMU; how to make it more accurate?
Currently, I am trying to navigate a small robot car to point A from my current position. The car has a GPS sensor and a BNO055 IMU(Gyro + Mag + Acc). I know the GPS co-ordinates of point A. Using the GPS co-ordinates of my car, I can calculate the bearing angle and the distance. From the fusion mode in the BNO055, I get the tilt compensated heading again(It gives me heading, roll & pitch). Based on the heading angle and the bearing angle, my car makes its turns. However, here is what I want to build on this:

The GPS readings sometimes are a bit far from my actual position. How to get rid of these outliers? I've read of the use of EKF. But they seem to be all mathematical formulas and it's tough to keep up with them!

For when the GPS signal is lost, I've read about Dead Reckoning methods being used. I'm not sure how to implement those. Can someone shed some light on that?

Can I calculate the speed with just the GPS and an IMU?
Any help is appreciated, thanks!

答:
You should use a Kalman Filter. Here are two nice tutorials that explain how Kalman Filter algorithm works and the working principle of IMU/GPS sensors.

short: https://www.navlab.net/Publications/Introduction_to_Inertial_Navigation.pdf

extended: https://www.navlab.net/Publications/Introduction_to_Inertial_Navigation_and_Kalman_Filtering.pdf

vectors, coordinate systems: https://www.navlab.net/nvector/

In summary, the Kalman Filter works in two steps:

1) prediction:
   - uses IMU measurements
   - propagates the belief (mean, covariance) based on the motion model

2) update step
   - uses GPS measurements
   - fuses the predicted belief and measurements to get a better estimate

The Kalman Filter algorithm implementation is very straightforward. There are hundreds of papers about how to code the filtering algorithm. The challenging parts are

modeling the sensors (error characteristics)

for IMU, you need to come up with drift, bias, random noise terms

for GPS, you need to come up with confidence intervals for global coordinate measurements (https://www.mathworks.com/help/fusion/gs/model-imu-gps-and-insgps.html)

understanding when the estimates are not consistent

modeling the motion of your vehicle (motion model)

modeling the relation between measurements and the state of the system (measurement model)


问:
IMU based joint angle measurement
Let us assume we have a two 2-DoF robot. Both axes rotate around x.
And the goal is to measure the joint angle values with the roll value from IMUs attached on each link.

However, the problem is that the roll value of the second IMU also increases whenever the first axis rotates.

Am I missing here something?

Above you can see the two links. The yellow points are the center of gravity points where the mpu-6050 is placed on. So whenever the first axis rotates, the second roll is changing...I am not using any fancy algorithm to measure the roll, just the standard MPU6050_DMP6.

答: "roll value of the second IMU also increases whenever the first axis rotates" — yep, that's how it always is. For the second joint, obtain the difference in the roll angles from both the IMUs. You're looking for the roll angle of IMU2 relative to roll angle of IMU1.

Title: IMU based joint angle measurement


问:
Installing MORSE simulator on Ubuntu 12.04
I've been having trouble installing MORSE.
I am trying to install it on Ubuntu 12.04 and on a VirtualBox with Ubuntu 13.04 (I don't need it on a VirtualBox, I'm just trying to make something work).
On Ubuntu 12.04 I get the following errors at the cmake stage:

```<code>$ cmake -DCMAKE_INSTALL_PREFIX=/home/oferb/opt/morse_build ..
-- will install python files in /home/oferb/opt/morse_build/lib/python3/dist-packages
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
PYTHON_INCLUDE_DIR (ADVANCED)
   used as include directory in directory /home/oferb/mnt/svr_home/opt/morse
   used as include directory in directory /home/oferb/mnt/svr_home/opt/morse/src
   used as include directory in directory /home/oferb/mnt/svr_home/opt/morse/src/morse
   used as include directory in directory /home/oferb/mnt/svr_home/opt/morse/src/morse/builder
   used as include directory in directory /home/oferb/mnt/svr_home/opt/morse/src/morse/modifiers
   used as include directory in directory /home/oferb/mnt/svr_home/opt/morse/src/morse/sensors
   used as include directory in directory /home/oferb/mnt/svr_home/opt/morse/src/morse/multinode
   used as include directory in directory /home/oferb/mnt/svr_home/opt/morse/src/morse/middleware
   used as include directory in directory /home/oferb/mnt/svr_home/opt/morse/bindings
   used as include directory in directory /home/oferb/mnt/svr_home/opt/morse/testing
   used as include directory in directory /home/oferb/mnt/svr_home/opt/morse/testing/base
   used as include directory in directory /home/oferb/mnt/svr_home/opt/morse/testing/failures
   used as include directory in directory /home/oferb/mnt/svr_home/opt/morse/testing/robots/human
   used as include directory in directory /home/oferb/mnt/svr_home/opt/morse/testing/robots/segway
   used as include directory in directory /home/oferb/mnt/svr_home/opt/morse/testing/robots/pr2
   used as include directory in directory /home/oferb/mnt/svr_home/opt/morse/testing/robots/pionner3dx
</code>```

On a fresh VMBox with Ubuntu 13.04, after 'morse check' succeeds, I try "morse create mysim" and get:

```<code>adminuser@adminuser-VirtualBox:~$ morse create mysim
usage: morse [-h] [-b BASE] [--name NAME] [-c] [--reverse-color] [-g GEOM]
         [-v]
         {check,edit,run} [scene] ...
morse: error: argument mode: invalid choice: 'create' (choose from 'check', 'edit', 'run')
</code>```

Any suggestions?

UPDATE:

I've managed to install MORSE on Ubuntu 12.04. Make sure your Blender was compiled with the same version of python (i.e python 3.2.2) that MORSE was compiled in. I used this Blender:
http://download.blender.org/release/Blender2.62

答:
Tips for MORSE on Ubuntu 12.04:

If you're having trouble compiling MORSE, perhaps these can help:

Install python3-dev or python-dev or both (not sure which was needed)

Check which version python3 directs to. If it's the wrong one, you can specify the python version explicitly in cmake. The cmake I used is: "cmake -DCMAKE_INSTALL_PREFIX=/home/oferb/opt/morse -DPYTHON_EXECUTABLE=/usr/local/bin/python3.3 .."

If you've already managed to compile MORSE, then make sure your Blender was compiled with the same version of python (i.e python 3.2.2) that MORSE was compiled in. I used this Blender: http://download.blender.org/release/Blender2.62.

Tips for MORSE on Ubuntu 13.04:

Note that "sudo apt-get install morse-simulator" gives you morse 1.0, but according to morse support, "morse create", which shows up in the tutorials, is something new in morse-1.1. You might want to search for an older tutorial, or install a more recent version of MORSE.

ContentLicense: CC BY-SA 3.0


问:
Why is the Kalman filter a filter and not a control system?
Why is the Kalman filter a filter and not a control system? The Kalman filter is a recursive filter which can be used to estimate the internal state of a linear dynamic system with noise in the signal(s). Isn't that the same as a traditional feedforward/feedback control structure (figure below)?

The feedforward controller modification uses anticipated results in the form of a mathematical model, predicting. Then the feedback controller would update the state and give feedback, updating.

答:
A Kalman Filter (estimator is actually more apt than filter) simply estimates states, that's all it does. It, by itself, cannot drive a plant towards a desired output. The estimated states are used to determine how far off the plant is from the desired state. Controls are implemented after KF has already been used to obtain the current state.

Referring to the block diagram, the KF block will be placed in the feedback path from the output $y$. Assuming the plant's output is observed by at least one sensor, the KF uses the plant's own model (prediction update) along with the sensor readings (measurement update) to estimate the current state of the plant. All sensors are noisy and the plant's model will not be perfect, so how good the estimates are will be determined by how well sensor noise and the plant has been modeled.

The state estimate produced by the KF is compared with the setpoint $r$ to obtain the error. Up until this point, no control action has taken place, the plant's current state has merely been observed. The control kicks in after you've determined the error. So the Kalman Filter is not really a control system.


问:
Controlling Actuated Robot Hand in Underactuated Manner
We have an allegro hand in our robot, and it is in actuated behavior. In other words, each joint is controlled one or more than one actuator, that is motor. There are 3 actuators for each finger, since each finger has 3 joints. Since there are 4 fingers in allegro hand, it has totally 12 actuators.

However, we want to control the hand in under-actuated manner. Namely, movement of each finger must be controlled by only one actuator, not three actuators. To accomplish this, we think that we can parametrize other 2 actuators of a finger based on first actuator of the finger:

f$_1(\theta) = \theta \rightarrow joint \,\, 1$

f$_2(\theta) = 0.43\theta \rightarrow joint \,\, 2$

f$_3(\theta) = 0.25\theta \rightarrow joint \,\, 3$

The angle $\theta$ is total rotation of first joint. Rotation of second and third joint will be parameterized based on rotation of first joint. I aim to generate such a under-actuated system.

How can I do that ?

How can I determine these 3 functions and their coefficients like 0.43 and 0.25 ?

答:
I don’t think underactuated is the proper term.  You are trying to control multiple actuators with a single DOF.   That is redundancy resolution.   I have used the Simplex Method to compute stable grasps for redundant finger devices - that method resolved the redundancy in a least-norm sense.

There are hundreds of research papers, going back to at least the 1980s (probably earlier) that discuss relative finger joint angles for different grasp types.  For example, many papers describe human-preferred joint ratios for hands accomplishing “cylindrical grasps” of various sized cylinders.  Others provide the same information for fingertip grasps, in which the normal vector from the surface of the fingertip is normal to the surface of the object.

You can search for keywords such as “grasp joint angle ratio finger” to find specific papers that postulate these ratios.


问:
Control VS artificial intelligence?
I have heard of both the terms AI (artificial intelligence) based robots and control based robots.

Although they are both different fields, what is the difference between AI and control in regards to application (since both are doing same task of automation)?

答:
In robotics, it all boils down to making the hardware(in essence, the actuator) perform the desired action. The basics of control systems tell us that the transfer function decides the relationship between the output and the input given the plant, i.e. system reacts to the latter.

While purely control-based robots use the system model to define their input-output relations, AI-based robots may or may not use the system model and rather manipulate the robot based on the experience they have with the system while training or possibly enhance it in real-time as well. Eventually, both of them can do the same task.

The difference in terms of applicability is the deterministic behavior of pure conventional control techniques. AI robots have a certain element of stochastic behavior given that they have learned things and learnings can be poor based on a lot of intrinsic and extrinsic factors. AI methods are converging towards high probabilistic success, but not quite there for critical applications.

Also, AI has scope for more inclusiveness of other perception and hardware layers than conventional control that needs everything to be hand-crafted.

Title: Control VS artificial intelligence?


问:
Does the Create 2 have the roomba room mapping software?
My understanding is that the Roomba has a sophisticated room mapping capability. Does the create 2 include that capability and is it usable by the hobbyist?</p>

答:
No, Create2 does not have room mapping capabilities.  The Create2 is based on the Roomba 600 series chassis.  Only the Roomba s series, i series, and 900 series robots have mapping capabilities.

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


问:
Simple explanation of PID control
I tried reading and searching different books and links for understanding PID control but not much progress

Can some one please give me simple explanation of PID control?or atleast links where easy content is available which is simple to understand

答:
Before we can introduce PID control, a more easier to implement controller has to be mentioned first, which is bang-bang control. It contains of an if-then-statement.

Such a controller, is able to move the robot on a line. The disadvantage is, that the robot's actions are not smooth, but the device will steer a bit chaotic. The more elegant approach is pid control, which isn't only steers left vs. right, but measures the amount. The deviation of the angle is set into relationship to the steering command. For example, if the angle error is only -2 degree, then the steering is small. This results into a more affordable trajectory.

```<code>def bangbang(current,goal):
  if current==goal: steer=0
  elif current<goal: steer=1
  elif current>goal: steer=-1
  return steer
def pid(current,goal):
  error=goal-current
  steer=0.5*error
  return steer

# main
goal=0
print("currentangle,goalangle,bangbang,pid")
for i in range(-5,6):
  a=bangbang(i,goal)
  b=pid(i,goal)
  print(i,goal,a,b)

""" output:
currentangle,goalangle,bangbang,pid
-5 0  1  2.5
-4 0  1  2.0
-3 0  1  1.5
-2 0  1  1.0
-1 0  1  0.5
 0 0  0  0.0
 1 0 -1 -0.5
 2 0 -1 -1.0
 3 0 -1 -1.5
 4 0 -1 -2.0
 5 0 -1 -2.5
"""
</code>```

Title: Simple explanation of PID control

Body:
Before we can introduce PID control, a more easier to implement controller has to be mentioned first, which is bang-bang control. It contains of an if-then-statement.

Such a controller, is able to move the robot on a line. The disadvantage is, that the robot's actions are not smooth, but the device will steer a bit chaotic. The more elegant approach is pid control, which isn't only steers left vs. right, but measures the amount. The deviation of the angle is set into relationship to the steering command. For example, if the angle error is only -2 degree, then the steering is small. This results into a more affordable trajectory.

def bangbang(current,goal):
  if current==goal: steer=0
  elif current<goal: steer=1
  elif current>goal: steer=-1
  return steer
def pid(current,goal):
  error=goal-current
  steer=0.5*error
  return steer

# main
goal=0
print("currentangle,goalangle,bangbang,pid")
for i in range(-5,6):
  a=bangbang(i,goal)
  b=pid(i,goal)
  print(i,goal,a,b)

""" output:
currentangle,goalangle,bangbang,pid
-5 0  1  2.5
-4 0  1  2.0
-3 0  1  1.5
-2 0  1  1.0
-1 0  1  0.5
 0 0  0  0.0
 1 0 -1 -0.5
 2 0 -1 -1.0
 3 0 -1 -1.5
 4 0 -1 -2.0
 5 0 -1 -2.5
"""


答:
The farther away the actuator is from the goal, the harder the actuator tries to reach the goal. That is the (P)roprtional part of PID.

The longer amount of time the actuator is blocked from the goal, usually by larger than expected friction rather than actual object blocking the path, the harder the actuator tries to reach the goal. That is the (I)ntegral part of PID.

The faster the actuator is moving towards the goal, the more likely it is that it will overshoot and go too far, so the faster it goes toward the goal, the more it resists and tries to slow down. That is the (D)erivative part of PID.

Title: Simple explanation of PID control

Body:
I tried reading and searching different books and links for understanding PID control but not much progress

Can some one please give me simple explanation of PID control?or atleast links where easy content is available which is simple to understand


问:
How to configure a DC power distribution bus
If you have a distributed system of DC motors, sensors and microcontrollers, is power usually distributed over a single high volt bus, using DC converters where needed?  Or is it typical to implement separate power buses for each device class?

Maximum cable length from battery to device is about 1 meter, 12 V, 5 V and 3.3 V will be needed depending on the device.

What's used in practice, like in industrial equipment or large robot arms?

答:
Electrical cables and connectors are a very common failure point in distributed electro-mechanical systems. So minimizing the number of wires and connectors is often a priority. In which case a single high voltage line distributes power to all the nodes and each one converts it down to the voltages it needs locally. Switched DC-DC converters are so common and cheap now that the cost reasons for having separate central supplies for each voltage level are no longer valid.

However, motors add noise to the power supply system and, depending on machine design, can also add a large amount of power draw (voltage*amperage) to the power supply. You will need to address these issues if you use a single bus. Motor capacitors and regenerative voltage shunt circuits are your friend for this. Also a clean wiring design that minimizes RF and inductive noise.


问:
Is a thrift store a good place to get a servo motor?
I'm trying to learn about a very basic motor, the servo motor.  Can these be found a thrift stores like Goodwill in old toys?  Are these "robotic" quality?  What toys or other kinds of things would I scavenge?  All I want to do is get a motor.  After that I want an Arduino and make it "work."  Nothing complex.</p>

答:
While some people scavenge even for cheap parts, I do not do that, simply because it will cost you more than just ordering the exact thing you need and knowing it is working. Don't forget that you probably have some specific requirements, i.e. the servo must be of some size, have some torque and so on...

Majority of toys (if not all of them) you will find at Goodwill will have just a basic DC motor with minimal feedback and won't probably as a 3-pin plug&play servo. These are not even required to be the same in identical toys, simply because manufacturer will use the one that is cheaper. This means the properties of the motors may be different and to tune your control loop to get two motors running at the same speed will cost you the same as just buying a working part with known characteristics.

EDIT: Since it seems like you are contradicting yourself in the question I would like to make it clear that a servo motor is not the easiest to use, since besides power it also needs a signal that determines where it will turn. A typical servo motor you will find looks something like this.

On the other hand, the easiest motor to use is just a plain DC motor. They look something like this, although there are many models of them that may even look different. To turn this motor you just need to supply power to it. The polarity of the wires determines the direction in which it will turn and the voltage determines the speed.


问:
How to get the accurancy of the position system?
I want to build a system for positioning objects. It should be driven by a DC motor and a sensor should control the rotation angle.

For the positioning I want to design (calculation) the accuracy. How it can be done and what parameter should be consider?

What minimal angle or number of rotations can be done with a DC motor?

I want to rotate the DC motor with a minimal angle of 400°. Can it be done or have DC motors minimal rotation angle to make start and stop motion? I do not know what which characteristics should be accounted for.

答:
The amount of rotation that the motor is capable of depends on the physical design of the motor. Usually the motor is combined with a transmission (eg gears) of some kind which also influence how far the combination (called an Actuator) can move.

Many motors, and many actuators, can rotate infinitely, without limit.

The minimal angle that one can reliably get an actuator to do is also dependent on the physical design. Again, there is not really a limit to how small one can go, but other physics start to become problems.

The calculations depend on the physical structure chosen.

To get better help, edit your question above to tell us:

The mass and volume of the objects to be positioned.

The desired precision and maximum in positioning (linear or angular)

The amount of money you can spend to create the solution.

This should be enough info for people to suggest an approach.


答:
You can see how PID works for controlling the motion of a car in this video:

https://www.youtube.com/watch?v=4Y7zG48uHRo

In simple words, PID control law computes the error function (e(t) = r(t) - y(t)) where r(t), y(t) are the reference signal and output signal of the system being controlled. At any given time, 3 terms are computed, namely the current, history and future value of error function.

Current: P term penalizes the current error value: Kp*e(t)

History: I term penalizes the integral of the error values: Ki*sum (e(t))

Future: D term penalizes the derivative of the current error value: Kd*d e(t)/dt

Control law is given as u(t) = Kpe(t) + Kisum[e(t)] + Kd* d e(t)/dt

You can find more details in Karl Astrom's book: https://www.cds.caltech.edu/~murray/courses/cds101/fa02/caltech/astrom-ch6.pdf

Title: Simple explanation of PID control


答:
I think, it is easier to explain these areas in terms of guidance, navigation and control layers for an autonomous robot. Let's stay an autonomous robot is commanded to reach a desired goal position from where it is.

Guidance (what to do): this layers computes a motion plan (a sequence of positions) that starts from the current position of the robot and reaches the desired goal position.

Navigation (where am I): this layer computes an estimate of the robot's state (x,y, heading, speed, etc).

Control (how to do): this layer computes the actuation commands in order to follow the generated path (computed by the guidance layer) based on the estimated state (computed by the navigation layer).

Arguably, AI is heavily used at the guidance layer whereas classical control algorithms (such as LQR, PID) are used in the control layer. Each layer works at different frequency! Again, arguably, engineers tend to use simpler algorithms at the lower layers since they need to execute at higher rates. Also, it is easier to prove closed-loop system stability and performance for simpler control algorithms.

Guidance layer: graph-search algorithms, A*, Dijkstra, MDPs (more AI is used here)

Navigation layer: filtering algorithms, Kalman Filter, EKF, Unscented KF, particle filter, etc.

Control layer: linear control algorithms (PID, LQR), optimal control (MPC), adaptive control (more classical control theory is used here)

Title: Control VS artificial intelligence?

Body:
I have heard of both the terms AI (artificial intelligence) based robots and control based robots.

Although they are both different fields, what is the difference between AI and control in regards to application (since both are doing same task of automation)?


问:
Basic question about Markov Localization, probability and belief distribution shift
I am starting in robotics, and reading about Markov Localization, I have one doubt, probably very stupid, but, well, I want to solve it.

Let's take the CMU Website example: https://www.cs.cmu.edu/afs/cs/project/jair/pub/volume11/fox99a-html/node3.html

Basically and very summarized:

The robot does not know its location (uniform probability of being
at any point), but knows there are 3 doors.

It senses a door, and since that door could be any one out of the 3, the belief distribution spikes at those 3 doors.

It moves to the right, and the belief distribution shifts to the right also, let's say "following the robot movement", and then the convolution is done when finding the 2nd door... This gets described in the next graphic, from the CMU:

But why does the belief distribution get shifted to the right, and not to the left, as the door is left behind?

Shouldn't the robot sense that there's no door between door 1 and 2 (starting from the left)?

Is there something about probability theory I've forgotten (I studied it like 14 years ago)?

答:
I think this is just a way of illustrating the main idea behind the probability distribution and the representation is not complete.

The idea is that there is a moment when the door is detected and the prior distribution not yet considered, this is when the robot assumes this could also be door 1 and therefore the positions of the other doors are as shown. There can be 3 similar images drawn, where the robot assumes standing in front of door 2 or door 3, but when the prior information is mixed in, only door 2 seems plausible.

I am just guessing, I did not read the book.


答:
In a control engineering sense AI (or in this case learning based approaches) and classical control based approaches are just different sides of the same coin.

In control theory the problem is to control a system (sometimes called the plant) to behave in a desired way. The desired way is given (in form of a reference value, which can change over time).

The simplest form of closed loop control is to take the current, measured value subtract this from the reference value and the error signal is created. This difference is the beginning of any closed loop control. Simplest is to multiply this with a constant to make sure that if there is an error between these two the system will try to "move" in order to get to the reference value.

There are many advanced and complicated approaches to achieve this. Simplest above is the P (proportional) controller but one can complicate this further with integrative  and derivative terms and end up with the so called PID controller (still the most used in industrial practice). Control systems have evolved and model based predictive, optimal etc. control approaches have been developed.

However, the control problem can be formulated as a machine learning problem and this is how machine learning can be mixed with control theory. Probably one of the fundamentally new approaches is the PILCO approach presented here.

So.. for low level control learning and classical control is somewhat interchangeable. (Machine learning based control systems can behave fully deterministically after training)

In higher levels closed loop control has sometimes been used, but mostly, for robots planning methods generate paths to be followed by the closed loop controllers. These paths can be hard-coded like in the case of most industrial robots or more flexibly defined as in the case of service robots. Planning problems and their solutions have always been a subfield of AI, therefore it can be argued that any robot which solves a planning problem is AI-based. Machine learning itself is also a subfield of AI. Machine learning methods can also solve planning problems.

If we take grasping as an example.
Detecting grasp point can be done using classical machine vision, with no machine learning or with a neural network based approach e.g. 2. These methods are interchangeable ans dome perform better then the others in different situation.

Any robot which ever navigated a labyrinth is AI-based. Way-finding in a labyrinth is a classical AI planning problem. Somewhat novel are the machine learning based solutions for these well known planing problems.

In areas such as speech recognition or gesture recognition is a similar situation. These have been always part of AI, the novelty, also here is the success of machine learning based approaches. Here again, methods, classical vs. machine learning based are interchangeable, but the latter have a much better success for these applications.

Title: Control VS artificial intelligence?


答:
My personal experience is in industrial automation and controls designing utility fed electrical panels. I do not have experience with industrial battery powered equipment like AGVs but maybe you can apply some of what I share below to your needs.

Typically your main power (usually AC power) is brought in and is immediately fed into a circuit protective device and/or a power disconnect (on-off switch). From there it may be filtered, further protected with fuses or circuit breakers, and subsequently fed into devices which consume power directly from the main. When control power is required (think 5, 12, 24VDC or 120VAC) the main power is fed into a DC power supply or AC control transformer. The output from these power supplies is fed into fuses for circuit protection and made available at a central distribution point. Each branch of power is individually protected with fuses or circuit breakers.

When devices outside of the control panel require power, the power is typically transmitted through the connection cable to the device at the voltage the device requires. I would say it is very rare to see power supplies or transformers at the end device.

Since your cable run is very short, I would have no issue with centrally converting power to your requirements and only sending the power you need through the cable. This simplifies the design since you only need one central supply, and it allows you to locate all your circuit protective devices together at the power supply.

Title: How to configure a DC power distribution bus

Body:
If you have a distributed system of DC motors, sensors and microcontrollers, is power usually distributed over a single high volt bus, using DC converters where needed?  Or is it typical to implement separate power buses for each device class?

Maximum cable length from battery to device is about 1 meter, 12 V, 5 V and 3.3 V will be needed depending on the device.

What's used in practice, like in industrial equipment or large robot arms?


问:
Libraries to calculate kinematics using Screw Theory
Most kinematics libraries/packages use the conventional transformation matrices (DH parameters). However, I'm looking for something that uses Screw Theory principles to set up the Product of Exponentials formula.

For eg., the KDL library from Orocos uses homogeneous transformation matrices, quaternions, Euler angles, etc. under the hood. But are there libraries that make use of twists and exponentials to derive the kinematics?

答:
While Screw theory has only been explored and deployed in robotics in research and academic capacity, I found this library on github that could help you.

Screw-Theory-Toolbox-for-Robotics-ST24R

I hope you find this useful.


问:
Fuzzy logic controller for controlling a four-bar linkage
I am trying to design a control system to move a joint of four bar linkage according to desired trajectory. A dc-motor is used to move the joint.
Can fuzzy logic controller be used to solve this problem?

I have already implemented a PID controller to do this task. I want to explore other control strategies to do this

答:
Yes, you can use any kind of algorithm to control a system.

However, I wouldn't suggest preferring a fuzzy logic based controller over PID just because it yields better performance! Because it is hard to prove, if not possible, the stability of the closed-loop system when there is a fuzzy logic controller in the loop. That is the reason why the fuzzy logic has not been used in major control applications such as space, aviation, safety-critical systems, etc.

Just a friendly advice: you can study fuzzy logic for your academic curiosity, but don't expect it will shine on your resume when looking for controls engineering jobs.


问:
Do I have to use the CAN protocol that the motor controller uses in order to communicate with it?
I have a question about using the CAN bus to control motor controllers. Do I have to use the CAN protocol that the motor controller uses, e.g. CANopen CiA DS 301 CiA profile 402, in order to communicate with it? Or I can just use any CAN API library, let’s say SocketCan, to communicate with the motor controller? </p>

答:
CANopen is a application level protocol and socketcan is at the transport level.

You can send Canopen messages using socketcan without any problems.

You can compose canopen messages by hand but it will be a lot easier if you use a library


问:
Plot a map using wheel encoder and IMU data
I want to plot a map( with matplotlib or any other library ) using a wheel encoder and IMU data.

Eg:- For every 10cm robot moves it should draw line (in a graph) and draw angles depending on the data received from the IMU.

I'm using python in Raspberry pi.

How can I achieve this function? Is there any algorithm for this? I googled for a couple of hours but still found nothing.

答:
You should maybe look at SLAM. Sinultaneous Localization and Mapping. There are really robust ROS packages which might help you in doing it. However, usially SLAM uses cameras, LIDARs, kinect-like sensors. But you could try if you can find some sort of implementation with IMU and Encoder.

For example I found this Or this

I hope this might be useful for you.


问:
why we need both vel and acc contribution for actual position?
I was trying to understand multiwii quadcopter code. I started with understanding GPS code. Here is a section of the code where I have doubt. Why actual position = pos + velocity contribution + acceleration contribution ? I mean velocity contribution and acceleration contribution, both are the same thing (I Think). So what is the purpose of adding both vel contribution and acceleration contribution ?

Here is the section of the code:

```<code>class LeadFilter {
public:
    LeadFilter() :
        _last_velocity(0) {
    }

    // setup min and max radio values in CLI
    int32_t         get_position(int32_t pos, int16_t vel, float lag_in_seconds = 1.0);
    void            clear() { _last_velocity = 0; }

private:
    int16_t         _last_velocity;

};

int32_t LeadFilter::get_position(int32_t pos, int16_t vel, float lag_in_seconds)
{
    int16_t accel_contribution = (vel - _last_velocity) * lag_in_seconds * lag_in_seconds;
    int16_t vel_contribution = vel * lag_in_seconds;

    // store velocity for next iteration
    _last_velocity = vel;

    return pos + vel_contribution + accel_contribution;
}
</code>```

答:
I didn't quite understand the codes you provide. Back to your wrong statement, velocity and acceleration are two different physical quantities. Acceleration is the time derivative of velocity. When you integrate the equations of the motion, there are multiple terms that affect the next position.

Continuous motion model:

dx/dt = v;

dv/dt = a;

where x is the position [m], v is the velocity [m/s] and a is the acceleration [m/s^2].

These equations of motion can be discretized by using 'dt' time step and constant acceleration profile between discrete time steps.

Discrete motion model:

x_k = x_k_1 + v_k_1*dt + 0.5*a_k_1*dt^2

v_k = v_k_1 + a_k_1*dt

Here you can the see that the next position (x_k) is a function the previous position (x_k_1), previous velocity (v_k_1) and the acceleration input (a_k_1).


答:
The robot has sensed a door, so the initial belief distribution matches the three possible door positions. i.e. the only three places that it is possible for the robot to be in that scenario.

The robot moves to the right so, since the belief distribution matches the possible positions of the robot, the belief distribution must also move to the right. As the robot moves, so the belief distribution must move with it.

Notice that the three peaks are no longer quite as well defined at this point because of that motion.  Movement is inherently noisy, which introduces uncertainty.  The more the robot moves, the less certain it becomes about its position, and the belief distribution thus tends to flatten or smooth out.

Finally, the robot senses the second door.  Given the (previously known) possible door positions, the belief distribution now also centres on the second door in the diagram.

Title: Basic question about Markov Localization, probability and belief distribution shift

Body:
I am starting in robotics, and reading about Markov Localization, I have one doubt, probably very stupid, but, well, I want to solve it.

Let's take the CMU Website example: https://www.cs.cmu.edu/afs/cs/project/jair/pub/volume11/fox99a-html/node3.html

Basically and very summarized:

The robot does not know its location (uniform probability of being
at any point), but knows there are 3 doors.

It senses a door, and since that door could be any one out of the 3, the belief distribution spikes at those 3 doors.

It moves to the right, and the belief distribution shifts to the right also, let's say "following the robot movement", and then the convolution is done when finding the 2nd door... This gets described in the next graphic, from the CMU:

But why does the belief distribution get shifted to the right, and not to the left, as the door is left behind?

Shouldn't the robot sense that there's no door between door 1 and 2 (starting from the left)?

Is there something about probability theory I've forgotten (I studied it like 14 years ago)?


问:
Is Fuzzy logic applicable for robotics research
I found some papers that use fuzzy logic to solve robotics algorithmic problems. But I have recently been told by a few roboticists that fuzzy logic should not be used in robotics because it has recently been proven by some theoreticians to be a mathematically dubious field. And so any results that you generate using fuzzy logic in robotics will not get published. Is that true?

I find it hard to believe. Is fuzzy logic dubious with respect to applications on real-world problems, say robotics? I have talked to mathematicians and they surely believe that fuzzy logic is a robust and clever field. But then mathematicians do a lot of abstract stuff that is completely irrelevant to the real world and must not be touched. Is fuzzy logic one of those things?

答:
I have not seen any industry-grade application of fuzzy logic in space, flight, automotive control systems. Fuzzy logic came during mid-60s and it gradually faded away due to several reasons:

It did not solve any control problem that cannot already be solved by the existing methods at that time. Bad news, no major advantage in terms of extending the application domain!

It lacked theorems for proving stability, performance of closed-loop system. Bad news, not being so rigorous!

The second item is of utmost importance for safety-critical systems such as space, aviation, self-driving cars, surgical robotics, etc. You are not allowed to deploy an aircraft flying over cities before certifying its flight control system. When you put a fuzzy logic controller in the loop, how can you prove that the closed-loop system is stable? I mean, in the rigorous sense. FAA won't accept the ad-hoc hand-tuning, working experiment results as a certificate. You have to provide the operating conditions that fuzzy logic controller will not work.

Back to your question, nowadays, there are so many publishers in academia. Even if you do fuzzy logic research in robotics, of course, you can find a journal that will eventually accept your work. The real question is if someone will read your paper or adopt your methods for their own application.

A friendly advice, as a researcher, I would not invest my time to do research in fuzzy logic area. Control theory is already a mature field; and fuzzy logic is arguably NOT one of the fruitful sub-areas. I spent one year working on fuzzy logic during my undergraduate years. Then, I came to USA for my PhD and realized that most of control researchers in USA were not working on fuzzy logic anymore. Nonetheless, never say never! Maybe, you can contribute to the field and make it more widely-used in the future.


问:
Controllability of a car with a single trailer
I'm studying the kinematic model of a car with a single trailer. This picture shows the system:

I started from the following statements:

With these constraints, I got the Pfaffian form:

And then the kinematic model:

I hope the calculations are good. Now I should use the Lie brackets to verify the system controllability, by checking the accessibility first. To do this, I need to write the system in the following form:

The question is: how do I do it? Is g the two column matrix showed in the model above? In this case, should f be a null vector/matrix? I think this should make sense, but - assuming it's all right - I wouldn't know how to proceed with the Lie brackets, because the iteration I studied leads to the calculation of this sequence: g, [f,g], [f,[f,g]], [f,[f,[f,g]]] and so on. Does it make sense with a null vector as f?
In short, the doubt is about how to choose the inputs.

Maybe it's a stupid question, but I didn't really understand the topic and I don't manage to get any concrete results.

答:
"A car with n trailers" is known to be a differentially flat system. Flatness implies that the Lie algebra generated by the system's vector fields (f and g_i's) is full. Therefore, the example you give is controllable.

In the example, f is zero, but you have two vector fields g1 and g2 that are associated with u1, u2, respectively. You need to work on the Lie brackets that are generated by g1 and g2.

x = g1*u1 + g2*u2;

I'd like to point out some references on the subject. You can find more information how Lie algebra is used for your system.

[1] Rouchon, P., Fliess, M., Lévine, J., & Martin, P. (1993, June). Flatness and motion planning: the car with n trailers. In Proc. ECC’93, Groningen (pp. 1518-1522).

https://www.researchgate.net/profile/Michel_Fliess2/publication/228772991_Flatness_and_motion_Planning_the_Car_with_n-trailers/links/00463520fc493b3390000000.pdf

[2] M. Fliess, J. L´evine, Ph. Martin, and P. Rouchon. D´efaut d’un syst`eme non lin´eaire et commande haute fr´equence. C.R. Acad. Sci. Paris,
I-316, 1993

[3] J.P. Laumond. Controllability of a multibody mobile robot. In IEEE International Conf. on advanced robotics, 91 ICAR, pages 1033–1038, 1991.


问:
Confused about I and D in PID controller?
I am trying to learn PID controllers from basics and i came to know that

"P" term looks for current error
"I"term looks for past error
"D"term looks for future error

I have some how understood "P" but i am confused about "I" and "D" terms?How do they control past and future error respectively?

答:
The literature on PID control is huge and you could certainly find many resources capable of explaining the theory behind, but to stick to your question let's start from the central consideration that a PID does not control the error. The purpose of a PID is to control the plant instead, in order to meet some given requirements, among which very often you'll have specific performances of the error profile.

Under this new light, for the I part, the PID controller takes into account the past errors as an aggregate (the integral is a summation) to drive the system toward the target. How could an agent be capable of controlling past events that have already happened? It cannot, indeed, although it can extract very useful information out of them.

Likewise, when it comes down to the D part, we don't control future events but we rather make a prediction of how the error would look like in a small instant ahead of time based on the current information we know of it, in the hope that by adding this new piece we'll be better off at getting what we aim to, that is an improved plant's behavior.

In math terms, we can sort of demonstrate that by writing the effort $u\left(t\right)$ delivered by a PD controller in its standard form:
$$
u \left( t \right) = K \left(\ e \left( t \right) + T_d \frac{de \left( t \right)}{dt} \right).
$$

A Taylor series expansion of $e\left(t+T_d\right)$ gives:
$$
e \left( t+T_d \right) \approx e \left( t \right) + T_d \frac{de \left( t \right)}{dt},
$$

meaning that the control signal is proportional to an estimate of the control error at time $T_d$ ahead (into the future), where the estimate is obtained by linear extrapolation (see [1] at page 69).

And if you're now wondering whether a solely D controller may ever exist, disjointly from the P term, the answer is of course no! I believe you can easily come up with the correct explanation.

References

K. Åström, T. Hägglung, PID Controllers, Theory, Design and Tuning, 2nd Edition


问:
effect of three terms of PID controller on output response?
What is the effect of each of the three terms on output response of a pid controller?

i mean how will P term shape/effect the output response
similarly what is the effect of I and D terms on output response respectively?

答:
You have a few questions about PID control.  Let’s break it down to its basic concepts.

The P term (for Proportional) is what you might think of as the strength of the controller.  If you want a system to reach a particular state, and it is instead at some other state, the P gain multiplies the error to drive the system toward the desired state.   In a perfect world, the system gets there.  However, if there is a lot of friction, or the P gain is too low, the system may only get partway to the goal.   This is overdamped behavior.  Conversely, if there is little friction, or the P gain is too high, the system may travel past the goal state and overshoot the goal.  In this case, the error will change sign, and the P gain will cause it to go back toward the goal state.  This is underdamped behavior.  In general, you want the P gain to be relatively high so the system responds strongly (quickly) to error states.

The D gain (for Derivative) helps compensate for underdamped behavior.  When the derivative of the error is large, so that the system is approaching the desired state quickly, the D gain responds to counter the rapidly-changing state.  In effect, this adds damping to the system to reduce or eliminate overshoots.  When the system is close to the goal state, and the error is not changing much, the D term does very little.  When the error is reducing quickly, the influence of the D gain can stabilize the performance. Note:  if the D gain is very large, it can lead to oscillatory behavior due to the rapidly-changing derivatives.

The I gain (for Integral) serves to drive a system to its goal state in those situations for which the P (&D) gains are not strong enough to overcome the system’s characteristics and cannot precisely reach the goal state.  This is really only useful when trying to achieve a steady-state position.  The I gain is a multiplier of the integrated error, so as a small fixed error remains over time, the I term grows until it can drive the system to the goal.   Note that real physical systems always lag the controller (due to friction, inertia, power supply slew rates, etc), so the integral term should not be enabled until the system is within a threshold of the desired state.  Otherwise, the accumulated errors from the lagging response will cause the I term to be large, causing overshoot, due to the accumulated errors during motion, instead of just considering the errors when at steady-state.


问:
For what step disturbance value the system will become unstable?
I am new to control theory and have difficulties about this question

R is the input, Td is the disturbance, C is the output
Given that G1=K/(s^2+A*s), where K is the gain and A is a parameter greater than zero.
The question is, for what value of the step disturbance the system can become unstable?
How do I solve this?

答:
The stability is a property of the linear systems themselves, hence there is no meaning in considering stability as regarded with the input disturbance $T_d$.

To verify if the closed-loop system $C/T_d$ is stable/unstable, you ought to compute the roots of the characteristic polynomial.

Given that
$$
\frac{C}{T_d} = - \frac{s^2+As}{s^2+As+K},
$$
the roots of $s^2+As+K$ − poles of the closed-loop system − are:
$$
s_{1,2} = \frac{-A \pm \sqrt{A^2-4K}}{2}.
$$
For $C/T_d$ to be unstable, at least one pole needs to have a positive real part, thus $K<0$.


问:
Are all drone propellers compatible with all brushless motors?
I want to build a drone using these motors

SunnySky X2212 KV1400 Brushless Motor For RC Drone FPV Racing Multi Rotor

and these propellers

DYNAM 2X RC Model Airplanes 9x5 Inch Nylon Propellers DYP-1003

Are all propellers compatible with all brushless motors? If not, how do I know if mine are compatible with each other?

答:
Yes, all propellors are compatible with all motors brushed or brushless if you’re looking for the right propellor for your motor.

And yes, the propellors that you’ve linked in your question will fit the motors that you’ve also linked.

Make sure you double check using the specifications of the motors and propellors, usually found on the product page of online market places, however, the amazon link doesn’t seem to have it.

Most of the time, with your propellors you’ll get small pipe things that fit around your motor shaft to make the diameter of the shaft bigger so the propellor will fit much tighter, forgot what they’re called, oops.


答:
Check this video: https://www.youtube.com/watch?v=4Y7zG48uHRo

It explains how PID algorithm work for controlling self driving cars.

Title: effect of three terms of PID controller on output response?

Body:
What is the effect of each of the three terms on output response of a pid controller?

i mean how will P term shape/effect the output response
similarly what is the effect of I and D terms on output response respectively?


问:
ORB-SLAM pose estimation
I've been reading about ORB-SLAM and ORB-SLAM2, but I can't quite figure out how pose estimation is done. I see that it uses a bag-of-word method for loop detection, but how are current features matched against the features of the map? As the map is 3D, a sought change in position can cause different perspectives. Bag-of-word can't really address the problem of perspectives, right? </p>

答:
Bag-of-word is just a similarity check routine. Perspective change is more related to the robustness of the feature descriptor against view change. Also, the map is 3D but I guess they are using 2D image-based place recognition only.

"The vocabulary is created offline with the ORB descriptors extracted from a large set of images." section III.E of ORB-paper.

So, I guess given a new image they extract orb features and compare them to the orb features in the DB.

Title: ORB-SLAM pose estimation


问:
Data structure to store a robot map
I'm studying robotics at the university and I have to implement on my own SLAM algorithm. To do it I will use ROS, Gazebo and C++.

I have a doubt about what data structure I have to use to store the map (and what I'm going to store it, but this is another story).

I have thought to represent the map as a 2D grid and robot's start location is (0,0). Each cell of the grid will be 1x1 meters. I will use a laser to know where are the obstacles. Using current robot's location, I will set to 1 on all the cells that represent an obstacle. For example, it laser detects an obstacle at 2 meters in front of the robot, I will set to 1 the cell at (0,2).

Using a vector, or a 2D matrix, here is a problem, because, vector and matrices indices start at 0, and there could be more room behind the robot to map. And that room will have an obstacle at (-1,-3).

On this data structure, I will need to store the cells that have an obstacle and the cells that I know they are free.

Which kind of data structure will I have to use?

答:
I recommend you use the Gridcell data structure to start. It is designed for storing grid information in a 1d array. You will just need to create algorithms to store data in the array and retrieve data in the array properly.

https://docs.ros.org/kinetic/api/nav_msgs/html/msg/GridCells.html

Then, when you want to display data, you use Markers in a marker array.

```<code>from visualization_msgs.msg import Marker, MarkerArray
</code>```

This link documents more about this message type

https://wiki.ros.org/visualization_msgs

Title: Data structure to store a robot map

Body:
I recommend you use the Gridcell data structure to start. It is designed for storing grid information in a 1d array. You will just need to create algorithms to store data in the array and retrieve data in the array properly.

https://docs.ros.org/kinetic/api/nav_msgs/html/msg/GridCells.html

Then, when you want to display data, you use Markers in a marker array.

from visualization_msgs.msg import Marker, MarkerArray

This link documents more about this message type

https://wiki.ros.org/visualization_msgs


问:
Why is behavior-based robotics not as popular as deep learning or reinforcement learning?
I am a master student in Germany and one of our professors is doing robotics research but with a different paradigm - the behavior-based robotics based on Subsumption Architecture developed by prof. Rodney Brooks from MIT in 1986. I was looking online for more info about this topic but could not find much, compared to the popular nowadays Deep learning techniques. Do you think behavior-based robotics is a fruitful research direction? Does it have any future? At this moment I am inclined to think that Deep Learning and Reinforcement Learning are the ways to add intelligence to robotic systems.</p>

答:
Deep Learning and behavior based robotics as well were developed as the opposite to something which was common before. In the 1980s, Brooks developed the subsumption architecture as an alternative to the former AI planning technique which was widespread discussed in the 1970s together with LISP symbolic systems. Behavior based robotics says in short, that there is no need for an abstract representation of the world which is formalized in the STRIPS language, instead the robot has to react to incoming sensor perception.

Deep Learning were also developed as a valid alternative to something known before. The main idea behind machine learning is, that there is no need to create sourcecode like in a programming project. It's enough to train neural networks with example data and the programming part of a robotics project is low or not there. A certain paradigm becomes successful, if a larger audience has the same understanding of how technology should be realized. The reason why deep learning is more attractive to a mainstream audience than behavior based robotics, is because the number of people who are trying to escape from symbolic AI is low, but the amount of people who doesn't understand why they should program is large.

Deep learning can be summarized to the idea, not to write a single line of code, but letting the combination of a GPU plus backpropagation algorithm do all the work. This sounds attractive to newbies in the domain of AI because writing millions lines of code is a complicated issue.


答:
I have not seen that many people working on behavior-based robotics. I am not sure even if Rodney Brooks still works on the subject.

Deep Learning: the approach is good for problems without a model. It is not to-go approach for many robotics problems. Because data collection, labeling, training, testing can be very costly. Even if you are interested in paying the price, sometimes there may not be enough data. If you want to land a rocket to a moving platform, probably you wouldn't want to use deep learning. :)

Reinforcement Learning: the approach does not work in real-life applications. It is costly since you need to do a lot experiments. Most of the times it is not easy to interpret what your agent actually learned.

=== purely subjective statements begin ===

My friendly advice: stay away from esoteric research subjects. I've seen some university professors who have a thing for obscure topics. These professors usually are the ones who passed the critical phase of their careers (pre-tenure) and like to experiment different topics at the expense of their students' career. It is highly likely that the outcome of the experiment will not make the professors more or less famous. They win some small grants and lure some young students to work on esoteric topics as if the subject were very important. You should ask yourself what you are going to achieve after you successfully study "xyz" topic. Is it going to help you find a job in industry or is it going to get you your own research agenda? Do not study a subject just because your professor has funding and he/she finds that topic interesting.

=== purely subjective statements end ===

Title: Why is behavior-based robotics not as popular as deep learning or reinforcement learning?

Body: I am a master student in Germany and one of our professors is doing robotics research but with a different paradigm - the behavior-based robotics based on Subsumption Architecture developed by prof. Rodney Brooks from MIT in 1986. I was looking online for more info about this topic but could not find much, compared to the popular nowadays Deep learning techniques. Do you think behavior-based robotics is a fruitful research direction? Does it have any future? At this moment I am inclined to think that Deep Learning and Reinforcement Learning are the ways to add intelligence to robotic systems.</p>


问:
Null space of the Jacobian matrix for a robotic arm
I have doubts on how to find all the joint velocities that don't produce any linear velocity, so are in the Null space, when we are in a singular configuration. For example, suppose we have a 2R planar robotic arm. If we compute the Jacobian we have:

$J(q)= \begin{bmatrix}-l_1sin(q1)-l_2sin(q1+q2)  & -l_2sin(q1+q2)\\ l_1cos(q1)+l_2cos(q1+q2) & l_2cos(q1+q2)\end{bmatrix} $

and if we consider the sigular configuration for which $q_2=0$ we have:

$J(q)= \begin{bmatrix}-(l_1+l_2)sin(q1)  & -l_2sin(q1)\\ (l_1+l_2)cos(q1) & l_2cos(q1)\end{bmatrix} $

now i want to find the joint velocities that produce no linear velocity of the end-effector, so all the velocities that arein the Null space. I have that those are all the velocities of the type :

$N(J)= \alpha \begin{bmatrix}
l_2\\ -(l_1+l_2)
\end{bmatrix}$

but i don't understand how this result is obtained.

Can somebody please help me?

Thank's in advance.

答:
Quite easily, by applying the definition of the Null Space straight away, you have to solve for:
$$
\mathbf{J} \left( q_1,q_2=0\right) \cdot \left[\dot{q_1}, \dot{q_2} \right]^T = 0.
$$
You'll come up with the following relation:
$$
\frac{\dot{q_1}}{\dot{q_2}} = - \frac{l_2}{l_1+l_2},
$$
which in turn can be summarized by $\mathcal{N} \left( \mathbf{J} \right)$.


问:
Field oriented control of brushless motors
If I was controlling a normal brushed motor as a servo, I would measure the motor's position, and adjust the PWM signal to control the voltage. This way I could achieve a precise velocity/position profile if my control was good enough.

```<code>pwm_duty = CalcPID(motor_position - target_position);
</code>```

When doing Field Oriented Control (FOC) of a brushless motor, there are two parameters I can control: The voltage angle, and the voltage magnitude. There are three things I can measure, the current angle and magnitude, and the rotor position.

I want to achieve a precise velocity/position profile including good control down to zero speed and reverse.

Question: how can I calculate the correct voltage field angle (or phase lead) and magnitude?  Do I need two PID algorithms?

```<code>phase_lead  = CalcPID_1( ... );
voltage_mag = CalcPID_2( ... );
</code>```

Assume I can take any reasonable measurements of the motor state, including rotor position and winding current.

答: I believe the most efficient thing to do is to maintain a 90 degree phase lead, and adjust your voltage magnitude for control.  You'll probably want to have an inner current loop, wrapped by the actual position loop.</p>


问:
ROS: catkin_make vs. catkin build
When using ROS:

Why should I use catkin build from catkin_tools instead of catkin_make?

I've been told that catkin build is better but no one who tells me this can give me a reason why.

答:
Apart from the isolated build, it is much more convenient to use:

Independent packages are build in parallel which can make it much faster.

catkin build can be used from any directory in the workspace while catkin_make only works in the top level directory.

It is easy to only build a single package (+ dependencies): catkin build package_name or, when called from the package directory, catkin build --this.  Add --no-deps to skip dependencies.

(Note that catkin_make has a  --only-pkg-with-deps flag for this, but there it will result in a persistent setting so next call of just catkin_make would also only build this package which is very unintuitive.)

catkin clean makes it easy to wipe build/devel without having to use a scary rm -rf.

Some other useful commands (list, locate, ...) as already mentioned by @bergercookie.

Title: ROS: catkin_make vs. catkin build


问:
What is the purpose of these grey balls on the drone?
Are these used for position tracking? Are there any papers

答:
These are markers for a visual Motion Capture system. Buy some markers here
Most MoCap systems work by setting up multiple cameras with strong IR-Flashes and IR-Cameras and the surface of the balls are optimized to reflect the specific wavelength. The cameras then almost only see the markers and can use triangulation to compute their position.

As at least the last image was capture at ETH Zurich (specifically the Polyterasse), they likely used their Vicon tracking system. Note that they captured the data on a cloudy day as direct sunlight also contains IR and could compromise the MoCap. However, you normally set up the MoCap cameras in a full circle around your working area to improve accuracy and have a lower probability of occluded markers. So it's also possible that there was no MoCap and just a photo session.


问:
Selection of motor and Calculating the torque for 6DOF robot Arm
I am trying to select the motor for a robot arm with six degrees of the freedom robot arm. What should I do to select the motors and which type of motor I should select?</p>

答:
First you need to specify your target payload and then the target velocity/acceleration for moving this payload.

After this, I would start with an inverse kinematic model of the robot (incl. higher order models for velocity and acceleration). A kinematic model can map end effector position, velocity and acceleration to joint position, velocity and acceleration.

Based on this, you can develop a dynamic model of the robot. This will have the role of translating the target payload mass, position, velocity and acceleration to joint torques, velocities and accelerations. Please note that this is position dependent, so you might want to find the worst case position. Also, a different worst case configuration is expected for all joints.

Based on the maximum joint performance you should calculate the power needed for the joints to narrow down possible motors and get to the required torque and velocity/acceleration using a motor and a gearbox combination. Please note also that the drive amplifier used for the motor will also have an affect on the dynamic performance of the motor (but in many cases this is negligible).

The above modelling does not necessarily have to be analytic modelling. Numerical simulation can also be used, but care must be taken when identifying worst case configurations.

Motor selection cannot be generally solved. It is always a case by case decision. For hobbyist robots RC-Servos can be an easy way to start and get into robotics. One step towards complexity would be to use a DC motor with a simple drive amplifier. In commercially available industrial robots PMSMs (Permanent Magnet Synchronous Motors) are the most often used motor types.


问:
Variables that Improve SLAM
I have a general question regarding SLAM as I am not an expert on the topic. What are the variables that can improve map generation?

The ones I can think of are:

A higher resolution camera

Consistent lighting conditions

A room with plenty of high confidence landmarks

A lot of processing power on the robot

Could someone help elaborate this list for me or tell me if I'm completely wrong?

答:
If you are restricted to camera-only SLAM you are on a good track. You mentioned a robot, do you use its odometry?

How good is your extrinsic robot-camera calibration?

How good is your intrinsic camera calibration?

Could you add a better IMU?

Could you improve the Odometry by changing the wheels or the floor?

Can you add other sensors like a laserscanner?

Does your camera have a rolling shutter or global shutter?

Do you exactly know when the image acquisition was started (e.g. because it was triggered by a hardware trigger?)

Which opening angle does your camera have? (bigger would be better if you can handle lens distortion)

Can you add artificial landmarks (e.g. QR-Marker) in the scene?

Title: Variables that Improve SLAM


问:
Problem with moving heavy computation into ISR's (dspic33E)?
I am controlling a robotic system using a dspic33E. I have a few PID control loops for motor control, several SPI slaves, and an I2C master that I communicate with. Currently, I use interrupts for setting flags which I then address in a tasks loop.

However, I am now starting to add in some orientation filtering/fusion which takes a few milliseconds to compute. This is unacceptable for my motor controllers and communication channels, so I was thinking about moving all of the computation related to those modules (motor control, SPI, I2C) into their respective ISR's (instead of setting flags, addressing them in the tasks loop).

The dsPIC33E has 7 interrupt priorities, so I can effectively structure the interrupts so that the higher priority timings are met, and then just do the orientation filtering/fusion in my tasks loop and have it be interrupted when needed.

This seems like a good structure to me, however I've been taught not to spend too  much time in ISR's. Does the ISR priority structure effectively mitigate any issues I would run into with this? Is this a bad idea? Or are there just some things I need to look out for?

答:
A great article on this approach is Build a super simple Tasker.

I have implemented this on dsPIC33e mcu's.

The biggest issue I faced was priority inversions that came from me trying to share information between tasks with global variables. Once I started using the typical IPC techniques to move information between tasks，it all worked well.


问:
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.

答:
As others have said in comments, a screw is probably your best bet. It's mechanically pretty simple to set up, and could be made to look fairly tidy, which is always nice in a home.

But the main problem, as always is going to be doing this on the cheap. The cost of the parts soon adds up. Even if your motors are only $15, you still need to buy the lead screw and nuts. These can be shockingly expensive if you buy nice ones for CNC machines, but you can probably get away with a simple length of threaded rod attached to a motor mounted on the wall, and a nut attached to the window. Since this thing isn't going to be moving very often, it should last a reasonably long time. And when the components wear out, they'll be cheap to replace.

Title: How to open a sliding window?


问:
How to suck using vacuum only first sheet of paper from pack of paper?
We are designing robot that will pick and place sheets of paper. We have found an issue that it is hard to suck only first sheet of paper of paper pack. Issue occurs because paper sheet passes vacuum through it and vacuum sucks additional (2 - 3) sheets of paper.

How to resolve this? Maybe we are using too small suction cups or incorrect design?

Current pneumatic system contains following:
1) Vacuum pump that produces 120 kpa vacuum
2) SGPN 20 FPM-65 suction cups 20 mm in diameter for paper handling
3) Need to hold standard office paper A4 80 gsm (210 x 297 mm)
4) Distance between suction cups is 100 x 125 mm
5) Paper pack could contain at least 30 sheets of paper.

Current experiments results.
1) 1 suction cup easely holds 5 sheets of paper because vacuum is flowing through paper
2) if pressure is decreased to minimum its stops sucking or sucks 3 sheets

Solution which we are trying to get is shown on this video:
https://www.youtube.com/watch?v=FT7NWbXyM7Q

Similar issue that we are getting is shown on this video:
https://www.youtube.com/watch?v=LKBDzkm3moo

Maybe somebody have other ideas how to make it possible to suck only first sheet of paper without mechanical holding of it?

答:
Sounds like some kind of stiction, between individual paper sheets.

How about:

Suck three or five sheets.

Do some secondary manipulation to remove the additional sheets. Like lateral motion, twisting etc. Think about how you get rid of extra sheets when turning a book page.


答:
I have in mind the following:

When placing the stack of sheets, make sure that they are not bound at the edges, due to the cutting. Just "wave" the stack of sheets (the edges are enough) to separate them.

Move the top-most sheet horizontally (sliding movement) using some rubber rolls. This system is used in pretty much all printers.

Pick the separated sheet of paper. Or keep sliding it until it reaches the next machine.

Title: How to suck using vacuum only first sheet of paper from pack of paper?

Body:
We are designing robot that will pick and place sheets of paper. We have found an issue that it is hard to suck only first sheet of paper of paper pack. Issue occurs because paper sheet passes vacuum through it and vacuum sucks additional (2 - 3) sheets of paper.

How to resolve this? Maybe we are using too small suction cups or incorrect design?

Current pneumatic system contains following:
1) Vacuum pump that produces 120 kpa vacuum
2) SGPN 20 FPM-65 suction cups 20 mm in diameter for paper handling
3) Need to hold standard office paper A4 80 gsm (210 x 297 mm)
4) Distance between suction cups is 100 x 125 mm
5) Paper pack could contain at least 30 sheets of paper.

Current experiments results.
1) 1 suction cup easely holds 5 sheets of paper because vacuum is flowing through paper
2) if pressure is decreased to minimum its stops sucking or sucks 3 sheets

Solution which we are trying to get is shown on this video:
https://www.youtube.com/watch?v=FT7NWbXyM7Q

Similar issue that we are getting is shown on this video:
https://www.youtube.com/watch?v=LKBDzkm3moo

Maybe somebody have other ideas how to make it possible to suck only first sheet of paper without mechanical holding of it?


问:
Drone Payload Potential
I am new to the art of building quadcopters and am looking to build a camera platform with a payload of 250g. With the following setup would that be possible or could someone point me in the direction of calculations to find out the answer.

I have a 450 frame that weighs 363g. My motors and escs are ~200g and my flight computer and transmitter are ~20 g. And my battery weighs in at 254g

I am using 2212 brushless motors at 1000 kv. My battery is a 3s lipo with a 30c discharge rate (4000mAh) and the props I am using are 1045 nylon carbon props.

Any and all help would be greatly appreciated, if you need any further I’d be happy to comply.

答:
Perhaps this link would be of some help.

The key here is to have a payload to thrust ratio of 1:2. The thrust of your motors can be found on the datasheet and also based on the power produced, the battery and the props.

Title: Drone Payload Potential


问:
Autonomous quadcopter: How to transform setpoint into motor inputs?
I would like to know how to transform a setpoint to inputs for the motors of a quadcopter. I would like a function like that:

def goto(x, y, z):
  # ...
  # Magic happens here
  # ...
  return [thrust1, thrust2, thrust3, thrust4]
```

I can't seem to find good documentation on how to do that so my research keywords must be lacking something. If you could point me to some good resources I would be glad to see them.

答:
Here here are a couple of papers that solve the problem you are interested in.

Nonlinear Robust Tracking Control of a Quadrotor UAV on SE(3)
by Taeyoung Lee, Melvin Leok and N. Harris McClamroch

Polynomial Trajectory Planning for Aggressive Quadrotor Flight in Dense Indoor Environments by Charles Richter, Adam Bry, and Nicholas Roy


问:
teleop_twist_joy with Logitech F710 Joystick force feedback error
I am using a Logitech F710 joystick game controller in ROS Kinetic Kame. I was able to perform jstest testing, and can see my joystick works well.

But when I try to use joystick with Turtlesim or with simple teleop_twist_joy, I see this error :[ERROR] [1567106281.990244467]: Couldn't open joystick force feedback! and there is no response on the screen in turtlesim or in the terminal itself.

Here's entire terminal log:

```<code>$user@user: roslaunch teleop_twist_joy teleop.launch ... logging to /home/sma1/.ros/log/2bdd147a-ca8f-11e9-80dc-5891cf766ee3/roslaunch-user-14722.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://user:44089/

SUMMARY
========

PARAMETERS
 * /joy_node/autorepeat_rate: 20
 * /joy_node/deadzone: 0.3
 * /joy_node/dev: /dev/input/js0
 * /rosdistro: kinetic
 * /rosversion: 1.12.14
 * /teleop_twist_joy/axis_angular: 0
 * /teleop_twist_joy/axis_linear: 1
 * /teleop_twist_joy/enable_button: 8
 * /teleop_twist_joy/enable_turbo_button: 10
 * /teleop_twist_joy/scale_angular: 0.4
 * /teleop_twist_joy/scale_linear: 0.7
 * /teleop_twist_joy/scale_linear_turbo: 1.5

NODES
  /
    joy_node (joy/joy_node)
    teleop_twist_joy (teleop_twist_joy/teleop_node)

ROS_MASTER_URI=http://localhost:11311

process[joy_node-1]: started with pid [14739]
process[teleop_twist_joy-2]: started with pid [14740]
[ERROR] [1567106281.990244467]: Couldn't open joystick force feedback!
</code>```

答:
I think your ROS joy node isn't configured correctly, which would explain the failure with teleop_twist_joy, because that package subscribes to sensor_msgs/Joy. You said that the joystick is working with jstest, but that's a test to see if your machine can use the joystick. It's not a ROS test.

You said you followed the Configure a Joystick tutorial; what do you get when you do the following (from the tutorial):

Now let's make the joystick accessible for the ROS joy node. Start by listing the permissions of the joystick:

$ ls -l /dev/input/jsX

You will see something similar to:

crw-rw-XX- 1 root dialout 188, 0 2009-08-14 12:04 /dev/input/jsX

If XX is rw: the js device is configured properly.

If XX is --: the js device is not configured properly and you need to:

$ sudo chmod a+rw /dev/input/jsX

What do you get when you try to listen to the sensor_msgs/Joy output?

$ rostopic echo joy


问:
Place for GPS antenna on autonomous vehicle
I used to think that the higher GPS antenna position the better until I read the following on GPSd FAQ:

One common error is to place the GPS or antenna as high as possible.
This will increase multipath effects due to signal bounce from the
ground or water, which can cause the GPS to mistake its position and
the time signal. The correct location for a boat GPS antenna is on the
gunwale rail or pushpit rail, close to the water and as far from the
mast as possible (to reduce signal bounce from the mast). If you're
outside or in a fixed location, put the GPS antenna as far from
buildings as possible, and on the ground.

If you're in a car, don't
put the GPS antenna on the roof, put it on the towbar or some similar
location. If you're driving in a heavily built up area, you're going
to get signal bounce off buildings and reduced accuracy. That's just
how the physics works. Note, however, that as your velocity goes up it
becomes easier for the convergence filters in your GPS to spot and
discard delayed signal, so multipath effects are proportionally less
important in fast-moving vehicles.

Does anyone has experience placing GPS antenna on a towbar of the car as suggested? Does it give reasonable effect?

My concern is that placing antenna there will not reduce an error that much, but will expose the device (antenna) to possible mechanical damage.

So, are there any better positions apart from roof and towbar?

Thanks

答:
I work on  race cars which occasionally race in built up areas such as street circuits.
As part of the mandatory electronic systems we fit a GPS antenna to the car to allow vehicle tracking.

Some of the guidance we have for the installation is

Fit the antenna to the upper surface of the car

Keep the antenna within 5 degrees of horizontal

Do not place metal objects above the antenna

Guarantee the direct visibility of the sky from the antenna, with a minimum of 170º cone unimpeded

So I would have expected that mounting a GPS antenna on a towbar where, potentially, half of the visibility would be obstructed by the metal structures at the rear of the vehicle would not be a good idea and would almost certainly be worse than fitting it to the roof


问:
What exactly is a nodelet?
I am new to ROS. I tried to read the documentation regarding nodelets on ROS wiki. But I couldn't understand it very well. I would like to know what is a nodelets in simple and intuitive terms</p>

答:
Regular nodes share data by passing messages over TCP.

Nodelets share data by sharing a pointer to a block of memory.

So, for a regular node, you've got to collect all the data, pack it into a ROS form, and then write the entire data packet, and then the receiver has to read the thing and unpack it.

Nodelets only work where there is memory to be shared (i.e., the same physical machine), so you can't use them for networked devices. But you could have something like a laser scanner, which produces a breathtaking amount of data, connected via nodelet to a process that extracts something of meaning from that data. The extraction process could then be connected via a regular node to some networked device and pass only the important results from the scan data analysis.

Title: What exactly is a nodelet?