问:
ROS PCL: Help with Moving Least Squares filter
I'm trying to implement a simple ROS node to perform Moving Least Squares <s>filtering</s> on a sensor_msgs/PointCloud2 topic.

I'm following this PCL tutorial, which uses the pcl/surface/mls.h file.

My code is at this GitHub page, but replicated below;

```<code>#include <ros/ros.h>

// PCL specific includes
#include <sensor_msgs/PointCloud2.h>
#include <pcl_conversions/pcl_conversions.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/io/pcd_io.h>
#include <pcl/kdtree/kdtree_flann.h>
#include <pcl/surface/mls.h>

/**
 * Simple class to allow appling a Moving Least Squares smoothing filter
 */
class MovingLeastSquares {
private:
    double _search_radius;

public:
    MovingLeastSquares(double search_radius = 0.03)
        : _search_radius(search_radius)
    {
        // Pass
    };

    ros::Subscriber sub;
    ros::Publisher pub;
    void cloudCallback (const sensor_msgs::PointCloud2ConstPtr& cloud_msg);
};

/**
 * Callback that performs the Point Cloud downsapling
 */
void MovingLeastSquares::cloudCallback (const sensor_msgs::PointCloud2ConstPtr& cloud_msg)
{
    // Container for original & filtered data
    pcl::PCLPointCloud2 cloud;

    // Convert to PCL data type
    pcl_conversions::toPCL(*cloud_msg, cloud);

    // Convert to dumbcloud
    pcl::PointCloud<pcl::PointXYZ>::Ptr dumb_cloud (new pcl::PointCloud<pcl::PointXYZ> ());
    //pcl::MsgFieldMap field_map;
    //pcl::createMapping<pcl::PointXYZ>(cloud_msg->fields, field_map);
    //pcl::fromPCLPointCloud2<pcl::PointXYZ>(cloud, *dumb_cloud);
    pcl::fromPCLPointCloud2<pcl::PointXYZ>(cloud, *dumb_cloud);

    // Create a KD-Tree
    pcl::search::KdTree<pcl::PointXYZ>::Ptr tree (new pcl::search::KdTree<pcl::PointXYZ>);

    // Output has the PointNormal type in order to store the normals calculated by MLS
    pcl::PointCloud<pcl::PointNormal> mls_points;

    // Init object (second point type is for the normals, even if unused)
    pcl::MovingLeastSquares<pcl::PointXYZ, pcl::PointNormal> mls;

    mls.setComputeNormals (true);

    // Set parameters
    mls.setInputCloud (dumb_cloud);
    mls.setPolynomialFit (true);
    mls.setSearchMethod (tree);
    mls.setSearchRadius (_search_radius);

    // Reconstruct
    mls.process (mls_points);

    // Convert from dumbcloud to cloud
    pcl::PCLPointCloud2 cloud_filtered;
    pcl::toPCLPointCloud2(mls_points, cloud_filtered);

    // Convert to ROS data type
    sensor_msgs::PointCloud2 output;
    pcl_conversions::moveFromPCL(cloud_filtered, output);

    // Publish the data
    pub.publish (output);
}

/**
 * Main
 */
int main (int argc, char** argv)
{
    // Initialize ROS
    ros::init (argc, argv, "pcl_mls");
    ros::NodeHandle nh("~");

    // Read optional leaf_size argument
    double search_radius = 0.03;
    if (nh.hasParam("search_radius"))
    {
        nh.getParam("search_radius", search_radius);
        ROS_INFO("Using %0.4f as search radius", search_radius);
    }

    // Create our filter
    MovingLeastSquares MovingLeastSquaresObj(search_radius);
    const boost::function< void(const sensor_msgs::PointCloud2ConstPtr &)> boundCloudCallback = boost::bind(&MovingLeastSquares::cloudCallback, &MovingLeastSquaresObj, _1);

    // Create a ROS subscriber for the input point cloud
    MovingLeastSquaresObj.sub = nh.subscribe<sensor_msgs::PointCloud2> ("/input", 10, boundCloudCallback);

    // Create a ROS publisher for the output point cloud
    MovingLeastSquaresObj.pub = nh.advertise<sensor_msgs::PointCloud2> ("/output", 10);

    // Spin
    ros::spin ();
}
</code>```

This compiles fine for me, but I don't get any points coming through the output topic. Can anyone tell me what I'm doing wrong? I suspect it is something to do with the conversions at line 46 or line 74.

Thank you!

答:
Update: I got it working. Thanks for the feedback everyone.

To address some of the comments:

I wasn't aware that 'filtering' has a specific meaning in the context of PCL. My code wasn't trying to implement an actual filter.

I was able to compile and run the PCL tutorial no problems

Sure enough, my problem was in the conversion from ROS message types to PCL point cloud types. I was essentially missing a call to pcl_conversions::toPCL().

The working code can be seen here.


问:
What is the best way to turn in 2WD simple differential drive line following robot?
I've used 4 sensors & a standard smart robot chassis kit with geared motors & L298 motor driver.

What is the difference between turning in:

One wheel stopped, one wheel moves.

Both wheels moves, but in opposite direction.

What is the best way to go in a curve?
What is the best way to turn 90°?

答:
You should use inverse kinematics equations for teleoperation/derive your robot:

The best way to the deriving curve is use from inverse kinematics equation and the best way for turning 90 degree (Both wheels move, but in opposite direction until 90 degree (this reason to your robot's dimensional )) which that handled by inverse kinematics too.

Which r is wheel radius, d is robot width, v is linear velocities, w is angular velocities, and thetaR and thetaL are left/right wheel RPM that you must get them.

And before these, you must obtain/solve v, w from using wheels encoder.

In additional, check this post: calculating differential drive robot ICC position

ContentLicense: CC BY-SA 4.0


问:
hard realtime signal processing
I am going to realize a real time monitoring system for medical care and finally the system should make phone calls according to the severity of the result , I would like to know is it best to perform realtime signal processing on raspberry or stm ,
the processed signal is ECG  and the processing will include denoising , segmentation , feature extraction , classification . I am using an ECG acquisition sensor ad8232 and I found while doing my research that stm32 provides a dsp unit(digital signal processor) , that raspberry pi is not suitable for realtime activities because it has no timer and so u need to add other components , also I found real time operating systems such as RTAI https://www.rtai.org/ that should work on raspberry's os
what how can I choose ?
an other question is does working on the os of the raspberry make this count as an embedded project ?</p>

答:
This sounds like a great project.

You should have a list of at least 20 processors from at least 10 companies that you are choosing from when starting a new project. Understand your requirements and make an informed decision.

You will find that most available processor manufacturers are careful about using their products in life critical systems. For example, STMicroelectronics health products brochure says

UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZED ST
  REPRESENTATIVE, ST PRODUCTS ARE NOT RECOMMENDED, AUTHORIZED OR
  WARRANTED  FOR USE IN LIFE SAVING, OR LIFE SUSTAINING APPLICATIONS,
  NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN
  PERSONAL INJURY, DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE.

Most chip manufacturers have something similar.

This should not stop your project, but you should keep in mind that if you make enough progress, you will eventually need to use processors and components that can be certified for use in your country.

ContentLicense: CC BY-SA 3.0

Title: hard realtime signal processing


问:
Mujoco and MoveIt!
I want to implement deep reinforcement learning using a UR5 robot. A little research told me nowadays researchers are using openAI gym, Mujoco, rllab as their frameworks. The thing is, I want to train my UR5 robot in virtual environment and transfer the learning to my real robot. The task can be peg insertion.

Previously I worked on a project using ROS with the UR5 robot and a Kinect. In that project, we are using MoveIt for motion planning. Everything has already been set up and I'm quite familiar with ROS and MoveIt.

Do you think I should bother myself modeling the UR5 robot and adding RGBD camera using Mujoco (I am not sure if I can do this in Mujoco), and after that training it using openAI gym framework, and finally transferring learning to the real robot using ROS? Or should I stick with ROS and MoveIt while incorporating openAI gym only as my reinforcement learning framework? I just don't see why I need Mujoco if I can use MoveIt and gazebo for modeling, which is already done. Thanks for your advice on this.

答:
The question would have been easier to answer had you put links to the various packages you intended to use.

Is there a reason you don't want to use Gazebo (the simulator which is normally used with ROS)? You might be able to find the UR5 robot and RGBD camera already created for Gazebo.

I would do as you suggest in the last paragraph of your question. You can use whatever planner and learning you want to with ROS.

Title: Mujoco and MoveIt!


问:
Jacobian for Inverse Kinematics with quaternion of end effector
Quaternion has four parameters. Calculating Jacobian for inverse-kinematics, 3 positions and four quaternion parameters make Jacobian $7\times7$ instead of $6\times6$. How to reduce Jacobian to $6\times6$ when using quaternion?</p>

答:
Jacobian does not have to be a square matrix. It is a matrix that maps joint velocities $\dot{q}$ to tool velocities $\dot{x}$ so its size is whatever fits with the two velocity vectors.

In your case, since the tool velocity vector is $\dot{x} \in \mathbf{R}^7$, a Jacobian will be $J \in \mathbf{R}^{7 \times 6}$, when your robot has $6$ DOFs.


问:
What is appearance-based SLAM?
To my understanding appearance-based SLAM uses only information coming from sensors for mapping and localization. It completely discards control information from actuators. I'm I correct?

答:
This depends on the localization approach on your SLAM (Simultaneous localization and mapping), i.e.  AMCL localization algorithm using the laser (sensor) + wheels encoders (actuators sensors).

[Note]:

This algorithm based on adaptive Monte Carlo + EKF (extended Kalman filter)

list of SLAM

Title: What is appearance-based SLAM?


问:
What are good strategies for tuning PID loops?
Tuning controller gains can be difficult, what general strategies work well to get a stable system that converges to the right solution?

答:
If you want to have a accurate PID coefficient:

Get your statistic actuator data (i.e. collecting input voltages + encoder pulses in a const frequently (0.01sec) time for 20secs as a 3x2000 matrix)

Get transfer function (TF) of your actuator (using Ident toolbox in MATLAB).

Finally, use PIDTool toolbox in MATLAB and upload your transform function.

Or in a quick and simple manner:

There is a quicker approach called Ziegler–Nichols:

And in this image demonstrate PID parameters effects:


问:
How to Calculate gyroscope bias given an input vector of measurements w?
I am developing a GPS-Localizer using accelerometer and gyroscope sensor values. for more accuracy, i want to calculate sensor biases, so i already implemented the accelerometer calculation via matlab using an input vector $ a$ and it looks like this:

```<code>function [sigma_out, mean_out, bias_out] = aCalibration (a)

sigma_out = std(a, 0, 2);
mean_out = mean(a, 2);

% The direction of the mean acceleraion is assumed to be the direction
% of gravity (thus down). Any other component is considered bias. This
% is by no means an acurate representation of the biases.
bias_out = mean_out - mean_out / norm(mean_out) * 9.81;
</code>```

For the Gyroscope i use an input vector $w$, so i calculate standard deviation and mean like this:

```<code>function [w_sigma, w_mean, w_bias] = wCalibration (w)

% TODO: implement the sigma/mean/bias computation
w_sigma = std(w,0,2);
w_mean = mean(w,2)
w_bias = [0; 0; 0];
</code>```

How do i calculate the gyroscope bias $b_w$ now? i dont know i think i still need to consider some angular velocity constants but i dont know which ones.... :(

Thanks for the help!

答:
Do the exact same thing you're doing for the accelerometer.

With the accelerometer, you're assuming that the device isn't actually constantly accelerating in any particular direction. You assume that the net long term acceleration is zero.

Are you expecting that the gyro is constantly rotating in a particular direction? Or are you assuming that the net long term rotational speed is also zero?

The only difference is that you know a "zero reading" of an accelerometer is [0; 0; -g], and the "zero reading" of a gyroscope is [0; 0; 0].

This is all pretty similar to another answer I gave recently. You could essentially use the same function for both, as in something like:

```<code>function [sigmaOut, meanOut, unknownBias] = Calibrate(data, knownBias)
sigmaOut = std(data);
meanOut = mean(data);
unknownBias = meanOut - knownBias;
end
</code>```

Pass in [0; 0; -9.81] for an accelerometer's known bias and [0; 0; 0] for the gyro. I'll point out that you don't have any rotations included in your code, so be careful there. Orientation matters!

Body:
Do the exact same thing you're doing for the accelerometer.

With the accelerometer, you're assuming that the device isn't actually constantly accelerating in any particular direction. You assume that the net long term acceleration is zero.

Are you expecting that the gyro is constantly rotating in a particular direction? Or are you assuming that the net long term rotational speed is also zero?

The only difference is that you know a "zero reading" of an accelerometer is [0; 0; -g], and the "zero reading" of a gyroscope is [0; 0; 0].

This is all pretty similar to another answer I gave recently. You could essentially use the same function for both, as in something like:

function [sigmaOut, meanOut, unknownBias] = Calibrate(data, knownBias)
sigmaOut = std(data);
meanOut = mean(data);
unknownBias = meanOut - knownBias;
end

Pass in [0; 0; -9.81] for an accelerometer's known bias and [0; 0; 0] for the gyro. I'll point out that you don't have any rotations included in your code, so be careful there. Orientation matters!


问:
How to move robotic arm in straight line
So here is my problem. I need to grab an object with my robotic arm, but I don't know the position of the object. The only thing I know is the angle between object and gripper. You will maybe better understand better from this image.

So my question is, how do I do that my robotic arm will be approaching the possible position of object in straight line? I tried inverse kinematic but it didn't work, because I don't know position of the object although I tried set the position of the object to end of the gripper. So I think IK is not the right way.

答:
First of all you should start to check 2 things:

the angle $\alpha$ is given by some sensor

the object and the path to the object (blue dotted line)
both lie in the arm workspace

If 1. is not met, I suggest you to look in the literature of eye-in-hand servoing.
If 2.  is not met your object can not be reached ... you might still want to travel until the end of the workspace following the dotted line.
From now I assume both are met.

Concerning the following of the dotted line, you where right in your attempt of using IK, but if you only specify the location of the object the IK which is composed of a pseudo-inverse/inverse react by not following the line you describe because the inversion can be seen as least square in the joint space, so it will minimize the joint motion. If you want to follow the line, you need to generate a trajectory from you current end-effector position to somewhere further along the line (if you know where is the ground plane you can gp up to it). Then this trajectory can be fed to the IK and if it lies inside the robotic arm limits it will follow it.

Further consideration, based on the number of DoFs of your robot and if you go in 6D space, you might or might not be able to follow the line with any given orientation of the gripper. In your drawing for example a part of the line can be followed with the desired orientation, while an other part can be followed but only if the orientation is let free, i.e. follows the robot arm constraints.


答:
The question is subjective along two directions

what is best way ? Fastest turning speed or best way to conserve momentum ?

How do you want to turn ? do you want to turn with the CoM remaining almost still or with the CoM following a curve ?

I guess that you would like to follow curves in general  in this case usually you command different velocities to both wheels, and in most case you don't need to stop or revert one wheel (this is conditioned by the curvature of the path and the robot kinematics/dynamics).

In small spaces or at low speed it might be useful to turn while keeping the CoM steady, ie turn instantaneously around an vertical axis passing by the middle point between you wheels, which should be where you try to have your CoM. In this case the best is to use opposite sign spinning commands of the same magnitude to your wheels so that there is no lateral motion induced.

In the end, you can generate a control algorithm going from one hand of the scope to the other hand based on the desired trajectory you want to follow.

Title: What is the best way to turn in 2WD simple differential drive line following robot?

Body:
I've used 4 sensors & a standard smart robot chassis kit with geared motors & L298 motor driver.

What is the difference between turning in:

One wheel stopped, one wheel moves.

Both wheels moves, but in opposite direction.

What is the best way to go in a curve?
What is the best way to turn 90°?


问:
inverse kinematics matlab RVC for 3 joint RRR
Hi im having problem with Inverse kinematic using RVC toolbox in matlab for RRR manipulator.

```<code> L_1 = 20;
 L_2 = 50;
 L_3 = 40;
 L(1) = Link([0 L_1 0 pi/2]);
 L(2) = Link([0 0 L_2 0]);
 L(3) = Link([0 0 L_3 0]);
 Robot = SerialLink(L);
 Robot.name = 'RRR_Robot';
 T = [1 0 0 0; 0 1 0 0; 0 0 1 0; 0 0 0 1];
 J = Robot.ikine(T, [0,0,0], [1 1 1 0 0 0]) *180/pi;
</code>```

Error using SerialLink/ikine (line 164) Number of robot DOF must be >= the same number of 1s in the mask matrix

Can somone explain me why my code is not working? / how to fix it ?

答:
based on the documentation you shall use the mask option, see page 291.

The mask highlight  what translation/orientation should be considered in the world frame. Are you sure that your RRR robot can move follow a trajectory which is specified by xyz ?

Also you ask the end-effector to go at the base of the robot that might not be physically possible ... Make sure that your goal position is comprised in the workspace. To do so the best is to use first forward kinematic with a reasonable joint configuration and then try to single to solve your issue with IK on the given position, this way you know that the goal is achievable and can play around with the parameter of th IK until you are satisfied.


问:
What is the difference between 4-point and 8-point connectivity in graph based planning?
In graph-based planning (say, A*), states are connected to their neighbors.  How should one decide whether to connect to the 4 neighbors or the 8 neighbors?  What are the pros and cons of each approach?</p>

答:
In generally there is difference between 4 and 8 neighborhood in many algorithms which are graph based, (such as A*, MRF(markov random field), edge detection algorithm and etc).

This depend on computational complexity, time, performance or some things like this (Trade off/balance between of them).

I will give some examples:

in MRF algorithm you can choose 4 neighborhood in each pixel (left, right, up, down)

or you can choose 8 neighborhood in each pixel (left, right, top, down, top right, top left, down right, down left)

or you can choose 8 neighborhood again in each pixel which 4 of them is assigned to current frame neighborhood pixels, and 4 of them is assigned to last frame neighborhood pixels


问:
What is difference between 2 wheels and 4 wheels and tracked differential mobile base kinematics?
In generally I know that no difference between 2WD and 4WD mobile base control kinematics equations.

but is there really difference between two wheels differential mobile base and tracked/continuous tracks differential robot (Tank Treads) inverse kinematics equations?

I using this inverse kinematics of differential equation:

Which 'r' is wheel radius, 'd' is robot width, 'v' is linear velocity, 'w' is angular velocity, and thetaR and thetaL are left/right wheel RPM that you want them.

For autonomous drive, I use DWA Planner that send v, w to my
driver which inverse kinematics is here, and my driver calculate
thetaR/thetaL of each posted v,w.

For manualy driving, I use many of teleop node, that all of them sends v, w too.

答:
The short answer is that the equations/models for these different vehicle should be different but there is no value in using more accurate equations.

All these equations are approximations that make assumptions about how the ground and wheels/tracks interact.

If there is 2 wheels and no slipping of the wheels on the ground, then the equation is reasonably close the reality. Otherwise the equation is equally bad for all cases.

However, if there is another feedback loop, a human driver or visual servoing or slam, then the equation is good enough.

If you are using this equation in an open loop manner, and your wheel-ground contact is very well behaved，then you can write more accurate equations. However you are unlikely to encounter such well behaved conditions outside of a lab.

Edit:

A tracked vehicle spends all its time slipping, except for when it is driving straight. For the equation to be an approximation during slipping, we are assuming the center of mass is in the middle of the vehicle and that the friction is uniform at all points under the track. If your conditions are different, then the actual motion will diverge from the prediction faster.

For some situations a small enough window or step size should work fine for those algorithms. I would not call them advanced; if they aren't working look for another approach, both in the model and in the navigation algorithms.


问:
Quicktron company - Mobile robots (Equivalent of Kiva Systems?)
Since some months on many websites, I read and I have seen images of the Alibaba (the Chinese e-commerce giant) warehouses. One example is the following article:

http://www.dailymail.co.uk/news/article-4754078/China-s-largest-smart-warehouse-manned-60-robots.html

It seems interesting and it seems really the same Amazon is doing with its Kiva Systems. The equivalent of Kiva Systems here should be a company called Quicktron but I am not able to find anything about it on the internet.

Someone of you has any knowledge about this company? A website?

答:
The company is called Flashhold, here is the link to the website:
http://www.flashhold.com/

They raised more than 29M$ in aseries B funding recently and seem to gain a lot of traction
https://www.chinamoneynetwork.com/2017/03/30/cainiao-softbank-lead-29m-round-in-chinese-logistic-robot-firm-flashhold

Hope this helps, do not hesitate to exchange back if you have more info.


问:
Probably basic question about how control a DC motor
over the past weeks I was trying to figure out how use the information from hall sensor to control a DC motor. Basically this is the motor which I'm using: https://www.servocity.com/32-rpm-hd-premium-planetary-gear-motor-w-encoder I chose this motor because torque is enough for my application. Basically I would like to use the signal from hall sensor to fix several position (10 position) and make something similar to "stepper motor". Briefly, my goal is create a system in which I could start the system, then the system go to a "home position", and wait for "go to position 1" or "go to position 10",  I would like to fix absolute position using the hall sensor that came with the motor (The rotational speed would be slow). Theoretically this seems to be easy but right now I'm stuck in how fix the absolute position. And probably my real question is: Using this motor and a limit switch with roller lever, is it possible to make this kind of application? Thanks a lot for read this post. </p>

<p>PS. In case you wonder why I omit other technical details like the board, driver for the motor, connections, is because I more interesting in the odds to make this application using this motor, or it would be better make an optical encoder with shaft disk that sense 10 position. To be honest I'm looking for the most parsimonious solution.  </p>

答:
Since the encoder with that motor is an incremental encoder, you would have to keep track of the motor position constantly.

If you really want to go to a home position, you'll need another sensor, like a limit switch, to tell you when you've gotten to home.

There are also physical problems such as acceleration and deceleration which makes stopping immediately difficult, and you will need to take this into account.

In order to get to ten spots reliably, you will probably need as much resolution in your encoder as possible.


问:
Is there any ROS community effort bases on golang?
I recently read a Go language(Golang) book and feel that this language is what I like.

I like C and Python, C can do the low level and basic jobs well. This language is also designed lovely. Also python(but python is really slow...). The Golang can also embed C. So may Golang also be good for Robot development in the future?

Is there any effort bases on golang in ROS community now? Any reason that Golang is not good for ROS/robotics?

答:
recently I find a project called "rosgo" which is doing similar thing. But seems that it is not active recently. here's thel link: wiki.ros.org/rosgo

Hope this project can go further because golang is designed well like c and alleviate the develop time problem of c/c++ && run speed problem of python.


问:
Jacobian of kinematic IMU Model
I have the following problem: given two Input Vectors $x = \begin{pmatrix}x\\y\\z\\v_x\\v_y\\v_z\\q_1\\q_2\\q_3\\q_4\end{pmatrix}$, $u = \begin{pmatrix}a_x\\a_y\\a_z\\w_x\\w_y\\w_z\end{pmatrix}$ time $t$ and gravity $g$ calculate  $\dot{x}$. These vectors contain values recorded from an IMU.

for $\dot{x}$ I simply considered the motions of equation:
$\dot{x} = f(x,u) = \begin{pmatrix}a_x*t+v_x\\a_y*t+v_y\\a_z*t+v_z\\a_x\\a_y+g\\a_z\\\dot{q_1}\\\dot{q_2}\\\dot{q_3}\\\dot{q_4}\end{pmatrix}$.
Any $\dot{q_i}$ is calculated using a given Formula which is okay so far

Is my IMU-Model for $x$ and $\dot{x}$ correct?
I need to calculate the Jacobian $A=\frac{\partial \dot{x}}{\partial x} $.

I dont really get to calculate $A$. it has to be $A \in \mathbb{R}^{10x10}$.
But i always fail at calculating it, especially with respect to the quaternions.

My First 6 Lines look like that:

$\left[ {\begin{array}{cc}
   0 & 0 & 0 & a_x & 0 & 0 & ? & ? & ? & ?\\
   0 & 0 & 0 & 0 & a_y & 0 & ? & ? & ? & ?\\
0 & 0 & 0 & 0 & 0 & a_z & ? & ? & ? & ?\\
0 & 0 & 0 & 0 & 0 & 0 & ? & ? & ? & ?\\
0 & 0 & 0 & 0 & 0 & 0 & ? & ? & ? & ?\\
0 & 0 & 0 & 0 & 0 & 0 & ? & ? & ? & ?\\
0 & 0 & 0 & 0 & 0 & 0 & ? & ? & ? & ?\\
0 & 0 & 0 & 0 & 0 & 0 & ? & ? & ? & ?\\
0 & 0 & 0 & 0 & 0 & 0 & ? & ? & ? & ?\\
0 & 0 & 0 & 0 & 0 & 0 & ? & ? & ? & ?\\
\end{array} } \right] $

Thanks for the help!

:EDIT:

As i just found out, any derivative $\frac{\partial \dot{q}}{\partial q}=0$. So i guess its:

$A=\left[ {\begin{array}{cc}
   0 & 0 & 0 & a_x & 0 & 0 & 0 & 0 & 0 & 0\\
   0 & 0 & 0 & 0 & a_y & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0 & a_z & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
\end{array} } \right]$ ?

答:
A robot Jacobian is

The time derivative of the kinematics equations  [...] which relates the joint rates to the linear and angular velocity of the end-effector.

I'll emphasize that it

relates the joint rates to the linear and angular velocity of the end-effector.

You give no information about a physical configuration, joints, or where the IMU is located. You give no information about what you're trying to do with the Jacobian.

You ask if your IMU model is correct, but then say, "any $\dot{q}_i$ is calculated using a given Formula which is okay so far." What is the formula? If it's working, then what is the question?

For the linear speed terms, you're failing to take into account the linear speed caused by rotation -

$$
v = \omega \times r \\
$$

It's also not clear what your terms are. You have $a_N$ - are these accelerometer readings? I ask because you have $\dot{v}_y = a_y + g$. This only works if $g$ is exactly colinear with the y-axis. Is this the case? No, unless your IMU is always perfectly level. Otherwise, you're going to need to apply a rotation matrix somewhere - either to rotate gravity to the local frame, or to rotate the local measurements (IMU measurements) to the global frame.

Title: Jacobian of kinematic IMU Model


问:
Connecting two microcontrollers using I2C
I Have an ATmega16 mc which is master on the i2c and a ATMega8 mc which is slave on the i2c.

I have connected the two mcs' sda and scl ports to each other alongside a pullup resistor.

Now I want to read a register from the ATMega8 using the ATMega16.

The problem is that I don't want to assign all the variables manually. Is there any libs or headers that will do this thing for me?

答:
It's been a while since I've used the AVR, but there where two libraries which would do what you are looking for. Unfortunately ATMEL doesn't provide proper firmware libraries themselves (as e.g. STM does).

Procyon AVRlib is quite outdated, but also very lightweight. You can just use the parts that you are interested in.

AVR Libc is another library which is slightly more recent and in my experience quite comprehensive. I think it is actually bundled with a lot of toolchains.


问:
What's the difference between feedback and feedforward control?
I'm reading from Astrom & Murray (2008)'s Feedback Systems: An introduction for scientists and engineers about the difference between feedback and feedforward.  The book states:

Feedback is reactive: there must be an error before corrective actions are taken.  However, in some circumstances, it is possible to measure a disturbance before the disturbance has influenced the system.  The effect of the disturbance is thus reduced by measuring it and generating a control signal that counteracts it.  This way of controlling a system is called feedforward.

The passage makes it seem that feedback is reactive, while feedforward is not.  I argue that because feedforward control still uses sensor values to produce a control signal, it is still reactive to the conditions that the system finds itself in.  So, how can feedforward control possibly be any different from feedback if both are forms of reactive control?  What really separates the two from each other?

A illustrative example of the difference between the two would be very helpful.

答:
Controllers are always reacting to something, so you're correct in thinking that "being reactive" is not the difference between the two.  The key is what the controllers are reacting to.

In feedback control, the controller acts to minimize an error signal.  A system including feedback control would have:

A sensor to measure system output

A reference signal, to which the system output is compared

A controller which operates on (i.e. "reacts to") the difference between the reference and the measurement

This type of control scheme is also referred to as "closed-loop control."

In feed forward control, the controller acts without any direct knowledge of the system's response.  It may be reacting to a reference signal or output from a sensor (as long as the sensor is not measuring system output - this would create a feedback loop) or both.  This is also called "open-loop control."

This is more than a semantic difference.  Only a closed-loop controller has the ability to compensate for unknown parameters, modelling errors, etc.

In your question, you refer to a situation where feed forward is used as a means to achieve disturbance rejection.  The idea would be that you measure the disturbance input, model the response of the system due to the this input, calculate the required control input to counteract this response, and then apply that control input.  Since your control signal (controller output) is independent of system response, this is open-loop control.

It is not uncommon for controllers to be designed with both feedback and feed forward components.  In this case, I usually think of the feedback component as the primary path, and the feed forward component as supplementary, to improve performance in some way.

For example, in motion control, a motor can be made to follow a velocity reference by using a PID controller that operates on the velocity error.  Because the PID controller operates only on the error, without any knowledge of the reference signal, there must be some error before the controller responds, so there will be some amount of delay.  You can increase the gains to minimize the delay, but because real systems are flexible, there will be some point at which the system will become unstable as the gains are increased.

You can add a feed forward path, however, which operates on the derivative of the velocity reference (so, the acceleration).  If the system's inertia is constant, the feed forward controller can be a simple proportional gain times the acceleration signal, which would correspond to some additional torque.

Now the motor will generate torque in response to changes in the velocity reference without waiting for the system to develop velocity error.  Because the feedback controller exists as well, any effects of friction, modelling error (i.e. if the selected feed forward gain is not exactly correct for the system's inertia), etc., the controller can still compensate and drive the error to zero.


问:
How to detect writing on a chalkboard?
I've got an idea for a simple robot (with an Arduino or something similar) that will play noughts-and-crosses (aka tic-tac-toe) on a chalkboard, so that kids can play against it.

It will use a couple of servos to move an articulated arm holding a piece of chalk which will draw the O's and X's.  Then the opponent will draw an O or X and press a button to tell the robot to make the next move.

The tricky bit is: how will the robot know where the opponent made their mark?  I could use a camera and some sort of motion detection software, but that sounds complex.

I was wondering if there's a way to detect the touch of the chalk on the board, perhaps using something like a MTCH101 chip -- one per square on the board.  The board will have a wooden wipe-clean surface, but chips could be embedded just under the surface.

Does anyone have any suggestions?

Edit 4 Jan 2018: Perhaps a force sensitive resistor would work -- such as http://www.trossenrobotics.com/store/p/6496-1-5-Inch-Force-Sensing-Resistor-FSR.aspx

答:
Since you are going to have a mechanism that can draw within a square why not put a light sensor on it and use the same mechanism scan for the opponent's move?

At the start of the game, scan all the squares and record the brightness value for each square.  If the board is clear, all the values should be low.

After your opponent is done and before each move, scan the "open" squares to confirm that a move has been made and where it was made (that cell should be brighter then the original scan).

Record the square where the opponent made a move as no longer "open" then make your move and record that square as no longer "open".

Back to 2. until someone looses.

Do something fun with the mechanism to show who won.  This can add "personality" to the game.

This Color Sensor from adafruit works well and uses I2C so it is very easy to use with Arduino.  It has a white LED light you can turn on to improve reflective readings.

Adafruit also has a lot of other options if this one doesn't work for you.  There are also sensors like the TCS3200 that have more lights; but, some don't support I2C and may be be more difficult to use.

Note: Determining whether your opponent drew an 'X' or an 'O' is really not necessary.  Just say 'X' always goes first.  If you are first assume he drew an 'O' and if he is first, assume he drew an 'X'.

Title: How to detect writing on a chalkboard?


问:
Invoking "cmake" failed
I am unable to solve this problem. I tried to run catkin_make command in catkin_ws directory</p>

```<code>yograj@yograj-Inspiron-5537:~/catkin_ws$ catkin_make
Base path: /home/yograj/catkin_ws
Source space: /home/yograj/catkin_ws/src
Build space: /home/yograj/catkin_ws/build
Devel space: /home/yograj/catkin_ws/devel
Install space: /home/yograj/catkin_ws/install
####
#### Running command: "cmake /home/yograj/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/yograj/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/yograj/catkin_ws/install -G Unix Makefiles" in "/home/yograj/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/yograj/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/kinetic
-- This workspace overlays: /opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /home/yograj/anaconda2/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/yograj/catkin_ws/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
ImportError: "from catkin_pkg.package import parse_package" failed: No module named catkin_pkg.package
Make sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH.
CMake Error at /opt/ros/kinetic/share/catkin/cmake/safe_execute_process.cmake:11 (message):
  execute_process(/home/yograj/anaconda2/bin/python
  "/opt/ros/kinetic/share/catkin/cmake/parse_package_xml.py"
  "/opt/ros/kinetic/share/catkin/cmake/../package.xml"
  "/home/yograj/catkin_ws/build/catkin/catkin_generated/version/package.cmake")
  returned error code 1
Call Stack (most recent call first):
  /opt/ros/kinetic/share/catkin/cmake/catkin_package_xml.cmake:74 (safe_execute_process)
  /opt/ros/kinetic/share/catkin/cmake/all.cmake:151 (_catkin_package_xml)
  /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:20 (include)
  CMakeLists.txt:52 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/yograj/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/yograj/catkin_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
</code>```

答:
I solved this problem using the following command:-</p>

```<code>pip install -U rosdep rosinstall_generator wstool rosinstall six vcstools
</code>```

Title: Invoking "cmake" failed

Body:
I solved this problem using the following command:-

pip install -U rosdep rosinstall_generator wstool rosinstall six vcstools


问:
Introduction to AI Robotics book: robot implementation, with ROS?
I'm reading the book Introduction to AI Robotics By Robin R. Murphy and it the first character said, more or less, that after chapter 5 I will be able to design and implement my own robots, either in a real robot or in simulation.

I don't have a lot of money to buy the components to implement a robot, so I want to do it in simulation.

My question is: where I can do a robot simulation?

I've found ROS is suitable for this but I'm not sure. Is a good idea to use ROS with this book?

I have no idea about how to do it or what do I need because this is the first time I do something with robotics.

I have also found this Virtual Simulator For Robots.

答:
There are many tutorials and forums to help in learning ROS. It can work on a Raspberry Pi, so you don't need an expensive computer to run Linux.

ROS includes (or is associated with) Gazebo, a robot simulator.

With ROS you get a lot of things involving movement that are easy to use. You also get drivers for many common sensors. You get SLAM and a few kinds of path planning.

What you don't get, as far as I know, is an overall goal planner. In other words, the AI part of the robot's brain. Which is good because you'll need to do that part as your degree. :)


答:
You can set a fixed camera points towards the chalkboard to check the content in every cell. This can be done by simply crop the image taken by the camera.

Then, by setting a color (brightness) threshold, you should be able to isolate the hand-written content from the background. In this way you can differentiate cells with marks from the vacant ones. Note that this threshold can be dynamic: you can get the color (brightness) of the background by check the part of chalkboard that is not being used.

A Handwritten Digit Recognition system (e.g. here) should be able to recognize the content of the processed image (which only contains pure white and black) of each cell. A "O" will be recognized as number 0. "X" will be recognized as other values.

Title: How to detect writing on a chalkboard?

Body:
I've got an idea for a simple robot (with an Arduino or something similar) that will play noughts-and-crosses (aka tic-tac-toe) on a chalkboard, so that kids can play against it.

It will use a couple of servos to move an articulated arm holding a piece of chalk which will draw the O's and X's.  Then the opponent will draw an O or X and press a button to tell the robot to make the next move.

The tricky bit is: how will the robot know where the opponent made their mark?  I could use a camera and some sort of motion detection software, but that sounds complex.

I was wondering if there's a way to detect the touch of the chalk on the board, perhaps using something like a MTCH101 chip -- one per square on the board.  The board will have a wooden wipe-clean surface, but chips could be embedded just under the surface.

Does anyone have any suggestions?

Edit 4 Jan 2018: Perhaps a force sensitive resistor would work -- such as http://www.trossenrobotics.com/store/p/6496-1-5-Inch-Force-Sensing-Resistor-FSR.aspx


答:
I'd recommend V-REP for multiple reasons:

It is a robotics simulator with GUI.

It has many pre-installed robot models.

It works with ROS.

It has detailed tutorials and an official forum.

Check the demonstration video here.

Title: Introduction to AI Robotics book: robot implementation, with ROS?

Body:
I'm reading the book Introduction to AI Robotics By Robin R. Murphy and it the first character said, more or less, that after chapter 5 I will be able to design and implement my own robots, either in a real robot or in simulation.

I don't have a lot of money to buy the components to implement a robot, so I want to do it in simulation.

My question is: where I can do a robot simulation?

I've found ROS is suitable for this but I'm not sure. Is a good idea to use ROS with this book?

I have no idea about how to do it or what do I need because this is the first time I do something with robotics.

I have also found this Virtual Simulator For Robots.


问:
Transforming Point Cloud to get Top Down Image
My task:

I have a task where I am asked to track parcels(carton boxes) of different dimensions moving on a conveyor. I am using Asus Xtion pro camera mounted on top of a conveyor in any inclined angle. I am looking for a model free object tracker that will detect boxes in the scene, track them & gives their 6 DOF? My target object is just a box and I want to eliminate all other things in the scene.

My approach:

I do Point cloud pre-processing like down-sampling, pass through filtering and segmentation. All these should give me a final point cloud containing only the objects on the conveyor.

I planned to make the "z" values in each point(depth value) as zero, thereby making the point cloud of the box to be flat on the ground.

I planned to transfer the view of the camera from any inclined position to a top down view so that I can view any number of carton boxes moving on the conveyor from a top down view. I feel the top down view will prevent perspective viewing problems

The process flow of step 2 and 3 is shown below.

After the top down view of the point cloud is achieved, I need to convert the 3rd point cloud to 2nd image, so that I can perform object tracking with so many OpenCV based tracking algorithms available.

A Sample point cloud is shown below in different views

Original View from camera:

Point Cloud View 1:

Point Cloud View 2:

Point Cloud Target/Desired View for converting to 2nd: (The box is the target. All the ground plane and unnecessary points would be eliminated)

Is my approach correct? How will I achieve steps 2,3 and 4?

答:
I cannot answer (and I don't think anyone would be able to) the question of "is this the correct method". It is subjective and, in the end, you can only try and see :).

But I can tell that this would not be the way I would go with this problem. Why ?

In my experience, point cloud processing, especially when trying to find shapes, is slow and hard. Since you're only searching for box and you have a 2D image, I would start there. Unless you know the background and can quickly remove it, I would not do step one.

I'm not sure why finding the top view will be of any help. If anything, it will be problematic if the boxes are stacked one above the other.

Another idea

Consider using deep learning (or just learning) on your 2D image to find the boxes and extract their pose from the point cloud once they have been found. If you need tracking after use some tracking algorithm on the 2D image.

Learning to recognize a box should be feasible given that you have a good training dataset. Then, once you have localized them in the 2D image, finding the pose is a matter of extracting it from the point cloud. Since you are using an Xtion, the point cloud and the 2D image should have a simple fixed transformation between them such that it should not be too hard to do that (hint: find the faces of the box).


问:
Transform timestamped messages recorded in a bag file using tf messages
I have a .bag which contains recorded messages on topics /topic1 and /topic2. The messages have /world as frame_id, so both of the messages associated with these topics are stamped, i.e. they have a header.

The same .bag file also contains recorded messages on the topic /tf (of type tf2_msgs/TFMessage). These transform messages have the frame_id set to /world and the child_frame_id set to the local frames associated with the IMUs from which the messages are being sent over respectively topic /topic1 and /topic2.

Now, I need the messages sent over the /topic1 and /topic2 to be converted to their corresponding local frame (i.e. the child frame or child_frame_id ) from the (fixed) frame /world. Since both the /tf messages and the messages of the topics /topic1 and /topic2 are stamped, I thought we could do this without much trouble, but I'm not sure since I'm very new to ROS.

I've looked around for various solutions, but I didn't find an exact solution for my problem, maybe because I didn't recognize it as such, given my limited knowledge of ROS, as I said.

I would appreciate a step by step description of the approach and, if you don't want to write a full solution with code (preferably in Python), at least point me to the similar examples. Please, do not suggest me to read the tutorials of /tf, I've partially done it, and it didn't help much.

答:
As far I understand, you have a topic /topic and an associated transformation on the tf topic. You then want to move the pose according to the tf transformation.

TF provides you with a tree representing all the transformations and the changes in time. It's really useful for easily tracking the position of each sensor on the robot for example. By knowing the transformation of each sensor to the base of the robot, you only need to change the transformation between the world and the base of the robot to know the position of all sensors in space.

If you want to transform /topic to its actual pose in tf, you'll need first to read the transformation from the tf topic from frame_id to child_frame_id. Then apply this transformation to the pose in topic at the same time. An efficient way to get messages at the same time is to use message filter. I'm sure you'll find plenty of example to do just that, for example here.


问:
Explanation for exponential coordinate of rotation

From figure above, suppose a three-dimensional vector $p(0)$ is rotated by an angle $\theta$ about the fixed rotation axis $\omega$ to $p(\theta)$. Here we assume all quantities are expressed fixed frame coordinates and $\Vert \omega \Vert = 1$. This rotation can be achieved by imagining that $p(0)$ is subject to a rotation about $\omega$ at a constant rate of $1$ rad/sec, from time $t = 0$ to $t = \theta$. Let $p(t)$ denote this path. The velocity of $p(t)$, denoted $\dot{p}$, is then given by

$$
\begin{equation}
\dot{p} = \omega \times p
\end{equation}
$$

Please explain in detail as to how to derive the above equation. Thank you.

答:
First note that

$p(0)$ travels along an arc of the circle of radius $r = \Vert p \Vert \sin(\phi)$ centered at a point on the axis of $\omega$; and

the velocity $\dot{p}$ is perpendicular to the arc of the circle; and

(from the definition) $\omega = \dot{\theta} u$, where $u$ is a unit vector perpendicular to the plane of rotation.

Now we try to relate $\dot{p}$ to the known quantities.

We have
$$
\begin{align}
\Vert \dot{p} \Vert &= r\dot{\theta} & \text{(from 2.)}\\
&= (\Vert p \Vert \sin(\phi))\dot{\theta} & \text{(from 1.)}\\
&= \Vert p \Vert \Vert \omega \Vert \sin(\phi) & \text{(from 3.)}
\end{align}
$$
From the above, we can therefore conclude that $\dot{p} = \omega \times p$.


问:
3D mapping using only datasets and no hardware
I am planning a project which compares the different techniques of 3D mapping of a setup. I understand that there are many algorithms to accomplish the same, but due to a non-existent hardware budget, I have to compare 3D techniques/algorithms that can be accomplished with the algorithm and datasets only. I have done a fair share of research that is still ongoing, but I was looking for assistance by people who may already have knowledge of this and can help me narrow down what I'm searching.

In summary, I am looking for 3D mapping techniques/algorithms that can be accomplished using only software and datasets in order to compare them on various performance and application parameters. Since I have to compare performance, all techniques should be applied on the same dataset.

I would appreciate any information, research papers, links, otherwise that could direct me.

答:
You need no hardware for this :)

Check out OpenSLAM website, you'll find plenty of options for slam algorithms and dataset. A quick Google search gives you things such as the KITTI Dataset.

I particularly like this webpage to find datasets.

Most of those can be used with ROS so I would advise you to implement your comparison method in ROS. Then testing different slam algorithm and/or datasets is mainly a matter of (almost) plug and play.


答:
The author expects a background that includes a course in physics or mechanics where this equation is taught. When that is the case, this equation gives you instantaneous velocity of a particle (point) moving on a circular path.

The $\times$ in $\dot{p} = \omega \times p$ is the cross product. (This may already be obvious to you, it's hard to tell from the question).

The vector result of the cross product will always be perpendicular to the plane that the operand vectors lie in. The magnitude of the vector result will be $\Vert \omega \Vert\Vert p \Vert  \sin(\phi)$. How to do the cross product operation is in the wikipedia article.

A break down of the equation that may answer your question is on wikipedia.

For a book that does a good job teaching working in exponential coordinates I highly recommend A mathematical introduction to robotic manipulation by Murray, Li, and Sastry.

Title: Explanation for exponential coordinate of rotation

Body:
From figure above, suppose a three-dimensional vector $p(0)$ is rotated by an angle $\theta$ about the fixed rotation axis $\omega$ to $p(\theta)$. Here we assume all quantities are expressed fixed frame coordinates and $\Vert \omega \Vert = 1$. This rotation can be achieved by imagining that $p(0)$ is subject to a rotation about $\omega$ at a constant rate of $1$ rad/sec, from time $t = 0$ to $t = \theta$. Let $p(t)$ denote this path. The velocity of $p(t)$, denoted $\dot{p}$, is then given by

$$
\begin{equation}
\dot{p} = \omega \times p
\end{equation}
$$

Please explain in detail as to how to derive the above equation. Thank you.


问:
Camera ego-motion estimation via dense optical flow
Help me please resolve some questions in the article

1) "A Robust Method for Computing Vehicle Ego-motion",  Gideon P. Stein et al.

According to this paper we can find three components of motion (one translation and two rotational components) using model from the article:

2) "The interpretation of a moving retinal image" Longuet-Higgins (1980).

As for me, the equation (1) from the first paper doesn't correspond to the equation from the second. There are velocities in the second paper that seems to be more correct than in the first where measurement units are not matched with left and right sides.

The second question is how can we find the motion parameters (translation and two rotations)? In the 1) paper they suggest to minimize cost function using gradient descent. But how can we do this? The function doesn't depend directly on motion variables $t_z, w_x, w_y $.

And the last question: if we got two subsequent frames $ I_1 $ at time $t_1$ and $I_2$ at time $t_2$, in what point of time $t$ we must consider estimated motion parameters? I guess at $(t_1 + t_2) / 2 $, but I'm not sure.

Help me please with these questions.

答:
The equation in your first reference comes from taking the time derivative of the pixel location of a feature. I suspect that the equations are different because the second paper is looking at features projected on to a sphere, not an image plain.

It looks like all the terms you are looking for are present in the equation being solved.


问:
Publisher and subscriber
Can anyone please explain what is a publisher and a subscriber when we talk about ROS?

Where is which of them installed and what do they do? Any simple example is appreciated.

答:
Publishers and subscribers are your own ROS nodes - programs that you write which make use of ROS' API.

A publisher basically just puts data into a ROS topic, and a subscriber gets said data from a topic.

Take a look at section 2.1:
http://wiki.ros.org/ROS/Tutorials/UnderstandingTopics

Someone wrote 2 programs (or nodes). One of them is called "teleop_turtle" which reads your keyboard input and uses the ROS API to publish that information on a topic called "/turtle1/command_velocity".

The other is called "turtlesim" and it "subscribes" to that topic, meaning that a specific function in the node's code will be executed when new data is published to that topic.

Title: Publisher and subscriber


答:
Think about writing code that provides information which needs to be consumed by a number of other functions.  That information could be written to a memory structure, and sent to each routine that needs the information.  With this design, every time a new method is written that needs this information, both the source and the consumer of the data need to be rewritten to link the data from the source to the consumer.

With a publisher-subscriber model, the integration becomes easier.   The source of the information just needs to write the results to a message.   It does not need to know who all will be consuming the data.  The subscriber(s) sign up to receive these particular messages.  When new data becomes available, the publisher sends a new message.   The subscribers all receive this data because they have signed up to receive these messages.

This design is particularly useful for state information such as health checks.  Any routine that causes motion can subscribe to a “health” message, and each of these routines can “check health” before moving a joint.   Without the publisher-subscriber model, both the motion routine and the health monitoring routine would need to be updated before this health check would work.

Title: Publisher and subscriber

Body:
Can anyone please explain what is a publisher and a subscriber when we talk about ROS?

Where is which of them installed and what do they do? Any simple example is appreciated.


问:
roslaunch mavros px4.launch not working properly
when I run roslaunch mavros px4.launch command process start and shut down.</p>

```<code>> ... logging to /home/yograj/.ros/log/77663396-f411-11e7-b93c-3c77e68de09b/roslaunch-yograj-Inspiron-5537-12518.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://yograj-Inspiron-5537:40223/
>
> SUMMARY
>
> ========
>
> CLEAR PARAMETERS
>
>  * /mavros/
> PARAMETERS
>
>  * /mavros/cmd/use_comp_id_system_control: False
>  * /mavros/conn/heartbeat_rate: 1.0
>  * /mavros/conn/system_time_rate: 1.0
>  * /mavros/conn/timeout: 10.0
>  * /mavros/conn/timesync_rate: 10.0
>  * /mavros/distance_sensor/hrlv_ez4_pub/field_of_view: 0.0
>  * /mavros/distance_sensor/hrlv_ez4_pub/frame_id: hrlv_ez4_sonar
>  * /mavros/distance_sensor/hrlv_ez4_pub/id: 0
>  * /mavros/distance_sensor/hrlv_ez4_pub/orientation: ROLL_180
>  * /mavros/distance_sensor/hrlv_ez4_pub/send_tf: True
>  * /mavros/distance_sensor/hrlv_ez4_pub/sensor_position/x: 0.0
>  * /mavros/distance_sensor/hrlv_ez4_pub/sensor_position/y: 0.0
>  * /mavros/distance_sensor/hrlv_ez4_pub/sensor_position/z: -0.1
>  * /mavros/distance_sensor/laser_1_sub/id: 3
>  * /mavros/distance_sensor/laser_1_sub/orientation: ROLL_180
>  * /mavros/distance_sensor/laser_1_sub/subscriber: True
>  * /mavros/distance_sensor/lidarlite_pub/field_of_view: 0.0
>  * /mavros/distance_sensor/lidarlite_pub/frame_id: lidarlite_laser
>  * /mavros/distance_sensor/lidarlite_pub/id: 1
>  * /mavros/distance_sensor/lidarlite_pub/orientation: ROLL_180
>  * /mavros/distance_sensor/lidarlite_pub/send_tf: True
>  * /mavros/distance_sensor/lidarlite_pub/sensor_position/x: 0.0
>  * /mavros/distance_sensor/lidarlite_pub/sensor_position/y: 0.0
>  * /mavros/distance_sensor/lidarlite_pub/sensor_position/z: -0.1
>  * /mavros/distance_sensor/sonar_1_sub/id: 2
>  * /mavros/distance_sensor/sonar_1_sub/orientation: ROLL_180
>  * /mavros/distance_sensor/sonar_1_sub/subscriber: True
>  * /mavros/fake_gps/eph: 2.0
>  * /mavros/fake_gps/epv: 2.0
>  * /mavros/fake_gps/fix_type: 3
>  * /mavros/fake_gps/geo_origin/alt: 408.0
>  * /mavros/fake_gps/geo_origin/lat: 47.3667
>  * /mavros/fake_gps/geo_origin/lon: 8.55
>  * /mavros/fake_gps/gps_rate: 5.0
>  * /mavros/fake_gps/mocap_transform: True
>  * /mavros/fake_gps/satellites_visible: 5
>  * /mavros/fake_gps/tf/child_frame_id: fix
>  * /mavros/fake_gps/tf/frame_id: map
>  * /mavros/fake_gps/tf/listen: False
>  * /mavros/fake_gps/tf/rate_limit: 10.0
>  * /mavros/fake_gps/tf/send: False
>  * /mavros/fake_gps/use_mocap: True
>  * /mavros/fake_gps/use_vision: False
>  * /mavros/fcu_url: udp://:14540@127....
>  * /mavros/gcs_url:
>  * /mavros/global_position/child_frame_id: base_link
>  * /mavros/global_position/frame_id: map
>  * /mavros/global_position/rot_covariance: 99999.0
>  * /mavros/global_position/tf/child_frame_id: base_link
>  * /mavros/global_position/tf/frame_id: map
>  * /mavros/global_position/tf/global_frame_id: earth
>  * /mavros/global_position/tf/send: False
>  * /mavros/global_position/use_relative_alt: True
>  * /mavros/image/frame_id: px4flow
>  * /mavros/imu/angular_velocity_stdev: 0.000349065850399
>  * /mavros/imu/frame_id: base_link
>  * /mavros/imu/linear_acceleration_stdev: 0.0003
>  * /mavros/imu/magnetic_stdev: 0.0
>  * /mavros/imu/orientation_stdev: 1.0
>  * /mavros/local_position/frame_id: map
>  * /mavros/local_position/tf/child_frame_id: base_link
>  * /mavros/local_position/tf/frame_id: map
>  * /mavros/local_position/tf/send: False
>  * /mavros/local_position/tf/send_fcu: False
>  * /mavros/mission/pull_after_gcs: True
>  * /mavros/mocap/use_pose: True
>  * /mavros/mocap/use_tf: False
>  * /mavros/odometry/estimator_type: 3
>  * /mavros/odometry/frame_tf/desired_frame: ned
>  * /mavros/plugin_blacklist: ['safety_area', '...
>  * /mavros/plugin_whitelist: []
>  * /mavros/px4flow/frame_id: px4flow
>  * /mavros/px4flow/ranger_fov: 0.118682389136
>  * /mavros/px4flow/ranger_max_range: 5.0
>  * /mavros/px4flow/ranger_min_range: 0.3
>  * /mavros/safety_area/p1/x: 1.0
>  * /mavros/safety_area/p1/y: 1.0
>  * /mavros/safety_area/p1/z: 1.0
>  * /mavros/safety_area/p2/x: -1.0
>  * /mavros/safety_area/p2/y: -1.0
>  * /mavros/safety_area/p2/z: -1.0
>  * /mavros/setpoint_accel/send_force: False
>  * /mavros/setpoint_attitude/reverse_thrust: False
>  * /mavros/setpoint_attitude/tf/child_frame_id: target_attitude
>  * /mavros/setpoint_attitude/tf/frame_id: map
>  * /mavros/setpoint_attitude/tf/listen: False
>  * /mavros/setpoint_attitude/tf/rate_limit: 50.0
>  * /mavros/setpoint_attitude/use_quaternion: False
>  * /mavros/setpoint_position/mav_frame: LOCAL_NED
>  * /mavros/setpoint_position/tf/child_frame_id: target_position
>  * /mavros/setpoint_position/tf/frame_id: map
>  * /mavros/setpoint_position/tf/listen: False
>  * /mavros/setpoint_position/tf/rate_limit: 50.0
>  * /mavros/setpoint_velocity/mav_frame: LOCAL_NED
>  * /mavros/startup_px4_usb_quirk: True
>  * /mavros/sys/disable_diag: False
>  * /mavros/sys/min_voltage: 10.0
>  * /mavros/target_component_id: 1
>  * /mavros/target_system_id: 1
>  * /mavros/tdr_radio/low_rssi: 40
>  * /mavros/time/time_ref_source: fcu
>  * /mavros/time/timesync_avg_alpha: 0.6
>  * /mavros/time/timesync_mode: MAVLINK
>  * /mavros/vibration/frame_id: base_link
>  * /mavros/vision_pose/tf/child_frame_id: vision_estimate
>  * /mavros/vision_pose/tf/frame_id: map
>  * /mavros/vision_pose/tf/listen: False
>  * /mavros/vision_pose/tf/rate_limit: 10.0
>  * /mavros/vision_speed/listen_twist: False
>  * /rosdistro: kinetic
>  * /rosversion: 1.12.12
>
> NODES
>   /
>     mavros (mavros/mavros_node)
>
> ROS_MASTER_URI=http://localhost:11311
>
> process[mavros-1]: started with pid [12536]
> [FATAL] [1515375213.809935923]: UAS: GeographicLib exception: File not readable /usr/share/GeographicLib/geoids/egm96-5.pgm | Run install_geographiclib_dataset.sh script in order to install Geoid Model dataset!
>
> ================================================================================
>
> REQUIRED process [mavros-1] has died!
> process has finished cleanly
> log file: /home/yograj/.ros/log/77663396-f411-11e7-b93c-3c77e68de09b/mavros-1*.log
> Initiating shutdown!
>
> ================================================================================
>
> [mavros-1] killing on exit
> shutting down processing monitor...
> ... shutting down processing monitor complete
> done
</code>```

答: I followed the source installation process as mentioned for mavros dependencies. And remaining problem solved here.</p>


答:
Ok I'm going to pitch another answer with a different take :).

Why not have the user tell the robot where they wrote their X or O?

Make an arm with the servo motors you have as you have already planned to do. For the player to make its move, make it grab the end effector of your arm holding the chalk and write down the X or O.
Now, the robot can memorise the movement it has done through its encoders, while writing the user's answer on the board, with the user. Thus it can figure out where the user drew their symbol. Then, just memorise where the robots own answers are and you can play tic-tac-toe.

I believe it would be quite fun to grab the robot arm to directly write on the board and then see the robot answer by itself :).

For added fun, make it understand when the user is erasing the board by doing it with the user.
For even more added fun, make it understand when it is drawing the double cross to play in (I don't the name of this) so you don't avec to play at a fixed location on the board.

Title: How to detect writing on a chalkboard?


问:
What mechanical parts can be attached to a 28BYJ-48 stepper motor?
Sorry I am asking a mechanical question here, but, after all, where else people have experience with using motors? If there is a better forum for this, please do guide me.

Everywhere I've seen online, the stepper motor 28BYJ-48 is used in tutorials, to rotate on its own, or, at most, to spin a clothes pin attached to it. I am trying to get Arduino to work for my 10 year old kid. He's got the motor rotating, now what? How does he attach anything to it?

Don't laugh, I made him a wheel out of a raw potato. He is happy with it now. Where can I find any guidance as to what to do next?

答:
The simplest, most versatile, and cheapest method I found is explained in this ebay page.

Basically you can get a Lego Technic axle (part #6538), remove 2 thin flaps, and it fits perfect. This allows you to connect the DYJ48 stepper motor onto any Lego Technic wheel (there is a range of them), gear, or any other Lego Technic part.

OwnerDisplayName: Таня Т.


问:
catkin_make unable to build and throws "Makefile:138: recipe for target 'all' failed make: *** [all] Error 2 Invoking "make -j4 -l4" failed"
I have been trying to build my ROS workspace using catkin_make, where i have cloned a repo/PACKAGE. I tried many of the things mentioned in previous answers to questions similar to my issue but without any progress. I tried building another package and it worked well. I am new to ROS and Linux, and this issue has been impeding me for a 3 days now.

Many thanks in advance!

```abouseif@abouseif-ThinkCentre-M92p:~/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws$ catkin_make
Base path: /home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws
Source space: /home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src
Build space: /home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/build
Devel space: /home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/devel
Install space: /home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/install
####
#### Running command: "cmake /home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/install -G Unix Makefiles" in "/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/kinetic
-- This workspace overlays: /opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.8
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 3 packages in topological order:
-- ~~  - gazebo_grasp_plugin
-- ~~  - kuka_arm
-- ~~  - kr210_claw_moveit
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'gazebo_grasp_plugin'
-- ==> add_subdirectory(RoboND-Kinematics-Project/gazebo_grasp_plugin)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   thread
--   signals
--   system
--   filesystem
--   program_options
--   regex
--   iostreams
--   date_time
--   chrono
--   atomic
-- Found Protobuf: /usr/lib/x86_64-linux-gnu/libprotobuf.so
-- Boost version: 1.58.0
-- Looking for OGRE...
-- OGRE_PREFIX_WATCH changed.
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for module 'OGRE'
--   Found OGRE, version 1.9.0
-- Found Ogre Ghadamon (1.9.0)
-- Found OGRE: optimized;/usr/lib/x86_64-linux-gnu/libOgreMain.so;debug;/usr/lib/x86_64-linux-gnu/libOgreMain.so
-- Looking for OGRE_Paging...
-- Found OGRE_Paging: optimized;/usr/lib/x86_64-linux-gnu/libOgrePaging.so;debug;/usr/lib/x86_64-linux-gnu/libOgrePaging.so
-- Looking for OGRE_Terrain...
-- Found OGRE_Terrain: optimized;/usr/lib/x86_64-linux-gnu/libOgreTerrain.so;debug;/usr/lib/x86_64-linux-gnu/libOgreTerrain.so
-- Looking for OGRE_Property...
-- Found OGRE_Property: optimized;/usr/lib/x86_64-linux-gnu/libOgreProperty.so;debug;/usr/lib/x86_64-linux-gnu/libOgreProperty.so
-- Looking for OGRE_RTShaderSystem...
-- Found OGRE_RTShaderSystem: optimized;/usr/lib/x86_64-linux-gnu/libOgreRTShaderSystem.so;debug;/usr/lib/x86_64-linux-gnu/libOgreRTShaderSystem.so
-- Looking for OGRE_Volume...
-- Found OGRE_Volume: optimized;/usr/lib/x86_64-linux-gnu/libOgreVolume.so;debug;/usr/lib/x86_64-linux-gnu/libOgreVolume.so
-- Looking for OGRE_Overlay...
-- Found OGRE_Overlay: optimized;/usr/lib/x86_64-linux-gnu/libOgreOverlay.so;debug;/usr/lib/x86_64-linux-gnu/libOgreOverlay.so
CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:166 (message):
  catkin_package() DEPENDS on 'gazebo' but neither 'gazebo_INCLUDE_DIRS' nor
  'gazebo_LIBRARIES' is defined.
Call Stack (most recent call first):
  /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
  RoboND-Kinematics-Project/gazebo_grasp_plugin/CMakeLists.txt:32 (catkin_package)

-- +++ processing catkin package: 'kuka_arm'
-- ==> add_subdirectory(RoboND-Kinematics-Project/kuka_arm)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- kuka_arm: 0 messages, 1 services
-- +++ processing catkin package: 'kr210_claw_moveit'
-- ==> add_subdirectory(RoboND-Kinematics-Project/kr210_claw_moveit)
-- Configuring done
WARNING: Target "trajectory_sampler" requests linking to directory "/opt/ros/kinetic/lib/roslib".  Targets may link only to libraries.  CMake is dropping the item.
-- Generating done
-- Build files have been written to: /home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/build
####
#### Running command: "make -j4 -l4" in "/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/build"
####
Scanning dependencies of target trajectory_msgs_generate_messages_lisp
Scanning dependencies of target actionlib_msgs_generate_messages_lisp
Scanning dependencies of target trajectory_msgs_generate_messages_nodejs
Scanning dependencies of target trajectory_msgs_generate_messages_py
[  0%] Built target trajectory_msgs_generate_messages_nodejs
[  0%] Built target actionlib_msgs_generate_messages_lisp
[  0%] Built target trajectory_msgs_generate_messages_lisp
[  0%] Built target trajectory_msgs_generate_messages_py
Scanning dependencies of target trajectory_msgs_generate_messages_eus
Scanning dependencies of target gazebo_msgs_generate_messages_py
Scanning dependencies of target dynamic_reconfigure_gencfg
Scanning dependencies of target dynamic_reconfigure_generate_messages_py
[  0%] Built target trajectory_msgs_generate_messages_eus
[  0%] Built target dynamic_reconfigure_generate_messages_py
[  0%] Built target gazebo_msgs_generate_messages_py
[  0%] Built target dynamic_reconfigure_gencfg
Scanning dependencies of target dynamic_reconfigure_generate_messages_cpp
Scanning dependencies of target dynamic_reconfigure_generate_messages_eus
Scanning dependencies of target dynamic_reconfigure_generate_messages_lisp
Scanning dependencies of target tf2_msgs_generate_messages_nodejs
[  0%] Built target dynamic_reconfigure_generate_messages_cpp
[  0%] Built target dynamic_reconfigure_generate_messages_eus
[  0%] Built target dynamic_reconfigure_generate_messages_lisp
[  0%] Built target tf2_msgs_generate_messages_nodejs
Scanning dependencies of target tf2_msgs_generate_messages_lisp
Scanning dependencies of target tf2_msgs_generate_messages_eus
Scanning dependencies of target tf2_msgs_generate_messages_cpp
Scanning dependencies of target dynamic_reconfigure_generate_messages_nodejs
[  0%] Built target tf2_msgs_generate_messages_lisp
[  0%] Built target tf2_msgs_generate_messages_eus
[  0%] Built target tf2_msgs_generate_messages_cpp
[  0%] Built target dynamic_reconfigure_generate_messages_nodejs
Scanning dependencies of target std_srvs_generate_messages_cpp
Scanning dependencies of target _catkin_empty_exported_target
Scanning dependencies of target roscpp_generate_messages_nodejs
Scanning dependencies of target tf_generate_messages_eus
[  0%] Built target std_srvs_generate_messages_cpp
[  0%] Built target _catkin_empty_exported_target
[  0%] Built target roscpp_generate_messages_nodejs
[  0%] Built target tf_generate_messages_eus
Scanning dependencies of target geometry_msgs_generate_messages_nodejs
Scanning dependencies of target std_msgs_generate_messages_lisp
Scanning dependencies of target roscpp_generate_messages_lisp
[  0%] Built target geometry_msgs_generate_messages_nodejs
Scanning dependencies of target geometry_msgs_generate_messages_lisp
[  0%] Built target std_msgs_generate_messages_lisp
[  0%] Built target roscpp_generate_messages_lisp
Scanning dependencies of target std_srvs_generate_messages_lisp
Scanning dependencies of target geometry_msgs_generate_messages_eus
[  0%] Built target geometry_msgs_generate_messages_lisp
Scanning dependencies of target roscpp_generate_messages_cpp
[  0%] Built target std_srvs_generate_messages_lisp
[  0%] Built target geometry_msgs_generate_messages_eus
Scanning dependencies of target actionlib_msgs_generate_messages_py
Scanning dependencies of target std_msgs_generate_messages_py
[  0%] Built target roscpp_generate_messages_cpp
Scanning dependencies of target gazebo_msgs_generate_messages_nodejs
[  0%] Built target actionlib_msgs_generate_messages_py
[  0%] Built target std_msgs_generate_messages_py
Scanning dependencies of target gazebo_msgs_generate_messages_cpp
[  0%] Built target gazebo_msgs_generate_messages_nodejs
Scanning dependencies of target std_msgs_generate_messages_nodejs
Scanning dependencies of target geometry_msgs_generate_messages_py
[  0%] Built target gazebo_msgs_generate_messages_cpp
Scanning dependencies of target trajectory_msgs_generate_messages_cpp
[  0%] Built target std_msgs_generate_messages_nodejs
[  0%] Built target geometry_msgs_generate_messages_py
Scanning dependencies of target geometry_msgs_generate_messages_cpp
[  0%] Built target trajectory_msgs_generate_messages_cpp
Scanning dependencies of target sensor_msgs_generate_messages_nodejs
Scanning dependencies of target rosgraph_msgs_generate_messages_cpp
[  0%] Built target geometry_msgs_generate_messages_cpp
Scanning dependencies of target rosgraph_msgs_generate_messages_nodejs
[  0%] Built target sensor_msgs_generate_messages_nodejs
[  0%] Built target rosgraph_msgs_generate_messages_cpp
[  0%] Built target rosgraph_msgs_generate_messages_nodejs
Scanning dependencies of target roscpp_generate_messages_eus
Scanning dependencies of target std_msgs_generate_messages_eus
Scanning dependencies of target std_srvs_generate_messages_py
Scanning dependencies of target gazebo_msgs_generate_messages_eus
[  0%] Built target roscpp_generate_messages_eus
[  0%] Built target std_msgs_generate_messages_eus
[  0%] Built target std_srvs_generate_messages_py
[  0%] Built target gazebo_msgs_generate_messages_eus
Scanning dependencies of target rosgraph_msgs_generate_messages_eus
Scanning dependencies of target std_srvs_generate_messages_eus
Scanning dependencies of target tf_generate_messages_cpp
Scanning dependencies of target actionlib_generate_messages_eus
[  0%] Built target rosgraph_msgs_generate_messages_eus
[  0%] Built target tf_generate_messages_cpp
[  0%] Built target actionlib_generate_messages_eus
[  0%] Built target std_srvs_generate_messages_eus
Scanning dependencies of target rosgraph_msgs_generate_messages_lisp
Scanning dependencies of target std_srvs_generate_messages_nodejs
Scanning dependencies of target gazebo_ros_gencfg
Scanning dependencies of target rosgraph_msgs_generate_messages_py
[  0%] Built target rosgraph_msgs_generate_messages_lisp
[  0%] Built target gazebo_ros_gencfg
[  0%] Built target rosgraph_msgs_generate_messages_py
[  0%] Built target std_srvs_generate_messages_nodejs
Scanning dependencies of target tf_generate_messages_lisp
Scanning dependencies of target roscpp_generate_messages_py
Scanning dependencies of target tf_generate_messages_py
Scanning dependencies of target tf_generate_messages_nodejs
[  0%] Built target tf_generate_messages_lisp
[  0%] Built target roscpp_generate_messages_py
[  0%] Built target tf_generate_messages_py
[  0%] Built target tf_generate_messages_nodejs
Scanning dependencies of target sensor_msgs_generate_messages_cpp
Scanning dependencies of target gazebo_msgs_generate_messages_lisp
Scanning dependencies of target sensor_msgs_generate_messages_lisp
Scanning dependencies of target sensor_msgs_generate_messages_py
[  0%] Built target sensor_msgs_generate_messages_cpp
[  0%] Built target gazebo_msgs_generate_messages_lisp
[  0%] Built target sensor_msgs_generate_messages_lisp
[  0%] Built target sensor_msgs_generate_messages_py
Scanning dependencies of target tf2_msgs_generate_messages_py
Scanning dependencies of target actionlib_generate_messages_cpp
Scanning dependencies of target std_msgs_generate_messages_cpp
Scanning dependencies of target actionlib_msgs_generate_messages_nodejs
[  0%] Built target actionlib_generate_messages_cpp
[  0%] Built target tf2_msgs_generate_messages_py
[  0%] Built target actionlib_msgs_generate_messages_nodejs
[  0%] Built target std_msgs_generate_messages_cpp
Scanning dependencies of target actionlib_msgs_generate_messages_cpp
Scanning dependencies of target sensor_msgs_generate_messages_eus
Scanning dependencies of target actionlib_generate_messages_py
Scanning dependencies of target actionlib_generate_messages_nodejs
[  0%] Built target sensor_msgs_generate_messages_eus
[  0%] Built target actionlib_msgs_generate_messages_cpp
[  0%] Built target actionlib_generate_messages_py
[  0%] Built target actionlib_generate_messages_nodejs
Scanning dependencies of target actionlib_generate_messages_lisp
Scanning dependencies of target actionlib_msgs_generate_messages_eus
Scanning dependencies of target graph_msgs_generate_messages_lisp
Scanning dependencies of target octomap_msgs_generate_messages_cpp
[  0%] Built target actionlib_generate_messages_lisp
[  0%] Built target actionlib_msgs_generate_messages_eus
[  0%] Built target octomap_msgs_generate_messages_cpp
[  0%] Built target graph_msgs_generate_messages_lisp
Scanning dependencies of target object_recognition_msgs_generate_messages_nodejs
Scanning dependencies of target object_recognition_msgs_generate_messages_lisp
Scanning dependencies of target octomap_msgs_generate_messages_py
Scanning dependencies of target moveit_msgs_generate_messages_lisp
[  0%] Built target object_recognition_msgs_generate_messages_nodejs
[  0%] Built target object_recognition_msgs_generate_messages_lisp
[  0%] Built target octomap_msgs_generate_messages_py
[  0%] Built target moveit_msgs_generate_messages_lisp
Scanning dependencies of target moveit_msgs_generate_messages_eus
Scanning dependencies of target object_recognition_msgs_generate_messages_eus
Scanning dependencies of target visualization_msgs_generate_messages_lisp
Scanning dependencies of target moveit_msgs_generate_messages_cpp
[  0%] Built target object_recognition_msgs_generate_messages_eus
[  0%] Built target visualization_msgs_generate_messages_lisp
[  0%] Built target moveit_msgs_generate_messages_eus
Scanning dependencies of target object_recognition_msgs_generate_messages_py
[  0%] Built target moveit_msgs_generate_messages_cpp
Scanning dependencies of target graph_msgs_generate_messages_cpp
Scanning dependencies of target _kuka_arm_generate_messages_check_deps_CalculateIK
[  0%] Built target object_recognition_msgs_generate_messages_py
Scanning dependencies of target shape_msgs_generate_messages_cpp
[  0%] Built target graph_msgs_generate_messages_cpp
Scanning dependencies of target graph_msgs_generate_messages_py
[  0%] Built target shape_msgs_generate_messages_cpp
Scanning dependencies of target moveit_msgs_generate_messages_nodejs
Scanning dependencies of target shape_msgs_generate_messages_py
[  0%] Built target moveit_msgs_generate_messages_nodejs
[  0%] Built target graph_msgs_generate_messages_py
[  0%] Built target shape_msgs_generate_messages_py
Scanning dependencies of target visualization_msgs_generate_messages_cpp
Scanning dependencies of target visualization_msgs_generate_messages_py
[  0%] Built target _kuka_arm_generate_messages_check_deps_CalculateIK
[  0%] Built target visualization_msgs_generate_messages_cpp
Scanning dependencies of target visualization_msgs_generate_messages_eus
[  0%] Built target visualization_msgs_generate_messages_py
Scanning dependencies of target object_recognition_msgs_generate_messages_cpp
Scanning dependencies of target visualization_msgs_generate_messages_nodejs
[  0%] Built target visualization_msgs_generate_messages_eus
Scanning dependencies of target octomap_msgs_generate_messages_eus
[  0%] Built target object_recognition_msgs_generate_messages_cpp
[  0%] Built target visualization_msgs_generate_messages_nodejs
[  0%] Built target octomap_msgs_generate_messages_eus
Scanning dependencies of target moveit_msgs_generate_messages_py
Scanning dependencies of target octomap_msgs_generate_messages_lisp
Scanning dependencies of target graph_msgs_generate_messages_eus
Scanning dependencies of target shape_msgs_generate_messages_lisp
[  0%] Built target moveit_msgs_generate_messages_py
[  0%] Built target octomap_msgs_generate_messages_lisp
[  0%] Built target graph_msgs_generate_messages_eus
Scanning dependencies of target kuka_arm_generate_messages_py
[  0%] Built target shape_msgs_generate_messages_lisp
Scanning dependencies of target shape_msgs_generate_messages_eus
[  8%] Generating Python code from SRV kuka_arm/CalculateIK
Scanning dependencies of target octomap_msgs_generate_messages_nodejs
Scanning dependencies of target kuka_arm_generate_messages_eus
[  8%] Built target shape_msgs_generate_messages_eus
[ 16%] Built target octomap_msgs_generate_messages_nodejs
[ 16%] Generating EusLisp code from kuka_arm/CalculateIK.srv
Scanning dependencies of target moveit_ros_planning_gencfg
[ 25%] Generating EusLisp manifest code for kuka_arm
[ 25%] Built target moveit_ros_planning_gencfg
Scanning dependencies of target graph_msgs_generate_messages_nodejs
[ 25%] Built target graph_msgs_generate_messages_nodejs
Scanning dependencies of target moveit_ros_manipulation_gencfg
[ 25%] Built target moveit_ros_manipulation_gencfg
Scanning dependencies of target kuka_arm_generate_messages_cpp
[ 33%] Generating C++ code from kuka_arm/CalculateIK.srv
Scanning dependencies of target kuka_arm_generate_messages_nodejs
[ 41%] Generating Javascript code from kuka_arm/CalculateIK.srv
[ 50%] Generating Python srv __init__.py for kuka_arm
[ 50%] Built target kuka_arm_generate_messages_nodejs
Scanning dependencies of target shape_msgs_generate_messages_nodejs
[ 50%] Built target shape_msgs_generate_messages_nodejs
Scanning dependencies of target gazebo_grasp_fix
[ 50%] Built target kuka_arm_generate_messages_py
Scanning dependencies of target kuka_arm_generate_messages_lisp
[ 58%] Generating Lisp code from kuka_arm/CalculateIK.srv
[ 58%] Built target kuka_arm_generate_messages_cpp
[ 58%] Built target kuka_arm_generate_messages_lisp
[ 75%] Building CXX object RoboND-Kinematics-Project/gazebo_grasp_plugin/CMakeFiles/gazebo_grasp_fix.dir/src/GazeboGraspFix.cpp.o
[ 75%] Building CXX object RoboND-Kinematics-Project/gazebo_grasp_plugin/CMakeFiles/gazebo_grasp_fix.dir/src/GazeboGraspGripper.cpp.o
[ 75%] Built target kuka_arm_generate_messages_eus
Scanning dependencies of target kuka_arm_generate_messages
Scanning dependencies of target trajectory_sampler
[ 75%] Built target kuka_arm_generate_messages
[ 83%] Building CXX object RoboND-Kinematics-Project/kuka_arm/CMakeFiles/trajectory_sampler.dir/src/trajectory_sampler.cpp.o
/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src/RoboND-Kinematics-Project/kuka_arm/src/trajectory_sampler.cpp: In constructor ‘TrajectorySampler::TrajectorySampler(ros::NodeHandle)’:
/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src/RoboND-Kinematics-Project/kuka_arm/src/trajectory_sampler.cpp:180:43: error: cannot convert ‘moveit::planning_interface::MoveItErrorCode’ to ‘bool’ in initialization
     bool success = move_group.plan(my_plan);
                                           ^
/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src/RoboND-Kinematics-Project/kuka_arm/src/trajectory_sampler.cpp:224:15: error: cannot convert ‘moveit::planning_interface::MoveItErrorCode’ to ‘bool’ in assignment
       success = move_group.execute(my_plan);
               ^
/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src/RoboND-Kinematics-Project/kuka_arm/src/trajectory_sampler.cpp:291:39: error: cannot convert ‘moveit::planning_interface::MoveItErrorCode’ to ‘bool’ in initialization
         bool worked = move_group.move();
                                       ^
/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src/RoboND-Kinematics-Project/kuka_arm/src/trajectory_sampler.cpp:313:13: error: cannot convert ‘moveit::planning_interface::MoveItErrorCode’ to ‘bool’ in assignment
     success = move_group.move();
             ^
/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src/RoboND-Kinematics-Project/kuka_arm/src/trajectory_sampler.cpp:339:13: error: cannot convert ‘moveit::planning_interface::MoveItErrorCode’ to ‘bool’ in assignment
     success = move_group.move();
             ^
/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src/RoboND-Kinematics-Project/kuka_arm/src/trajectory_sampler.cpp:351:13: error: cannot convert ‘moveit::planning_interface::MoveItErrorCode’ to ‘bool’ in assignment
     success = move_group.plan(my_plan);
             ^
/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src/RoboND-Kinematics-Project/kuka_arm/src/trajectory_sampler.cpp:375:15: error: cannot convert ‘moveit::planning_interface::MoveItErrorCode’ to ‘bool’ in assignment
       success = move_group.execute(my_plan);
               ^
/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src/RoboND-Kinematics-Project/kuka_arm/src/trajectory_sampler.cpp:452:39: error: cannot convert ‘moveit::planning_interface::MoveItErrorCode’ to ‘bool’ in initialization
         bool worked = move_group.move();
                                       ^
/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src/RoboND-Kinematics-Project/kuka_arm/src/trajectory_sampler.cpp:497:13: error: cannot convert ‘moveit::planning_interface::MoveItErrorCode’ to ‘bool’ in assignment
     success = move_group.move();
             ^
/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src/RoboND-Kinematics-Project/kuka_arm/src/trajectory_sampler.cpp: In member function ‘bool TrajectorySampler::OperateGripper(const bool&)’:
/home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/src/RoboND-Kinematics-Project/kuka_arm/src/trajectory_sampler.cpp:543:33: error: cannot convert ‘moveit::planning_interface::MoveItErrorCode’ to ‘bool’ in initialization
   bool success = eef_group.move();
                                 ^
RoboND-Kinematics-Project/kuka_arm/CMakeFiles/trajectory_sampler.dir/build.make:62: recipe for target 'RoboND-Kinematics-Project/kuka_arm/CMakeFiles/trajectory_sampler.dir/src/trajectory_sampler.cpp.o' failed
make[2]: *** [RoboND-Kinematics-Project/kuka_arm/CMakeFiles/trajectory_sampler.dir/src/trajectory_sampler.cpp.o] Error 1
CMakeFiles/Makefile2:3178: recipe for target 'RoboND-Kinematics-Project/kuka_arm/CMakeFiles/trajectory_sampler.dir/all' failed
make[1]: *** [RoboND-Kinematics-Project/kuka_arm/CMakeFiles/trajectory_sampler.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 91%] Linking CXX shared library /home/abouseif/main/udacity/roboticsnd/robotics_term1/ROS/catkin_ws/devel/lib/libgazebo_grasp_fix.so
[ 91%] Built target gazebo_grasp_fix
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed
```

答:
This is because of using a newer version of gcc compiler (C++11).

Use static_cast<bool>() to resolve the issue.

example: change

```<code>success = move_group.move();
</code>```

to

```<code>success = static_cast<bool>(move_group.move());
</code>```

Body:
This is because of using a newer version of gcc compiler (C++11).

Use static_cast<bool>() to resolve the issue.

example: change

success = move_group.move();

to

success = static_cast<bool>(move_group.move());


问:
Control geared DC motor based on timing?
According to this video from Khan Academy about electronics of a DVD drive the position of the sled (which moves the reading head) is controlled by a geared DC motor by using only timing and one end-stop switch.

I've also took apart some DVD drives and where there was a DC motor (instead of a stepper) I did not find any sensor as a feedback for closed loop control.

I could not find any reference for this online. If this is really the case can anybody point me to a page/site with the explanation? Why this is not used in hobby projects?

Edit

After the feedbacks I would focus on one specific question: is it possible that a DVD drive can operate with open-loop control and a DC motor?

答:
Just because it is not directly measuring where the sled is does not mean that it is open loop control. What matters is where the laser is in relation to the tracks on the disc, where the sled is doesn't matter - unless it's run into the end of travel, and there's a switch for that - so that isn't the variable you close the control loop around.

The tracking needs to be done to less than 1μm so is not possible without feedback from the optical system. The optical signal is split into side beams and these are compared, this then can control both the micro system adjustments and the larger sled motor movements.

The side beams created by the diffraction grating are positioned forward and back of the main beam straddling the track of pits being followed (not directly on either side as shown in the diagram - but that was easier to draw!).
  Segments on either side of the photodiode array designated E and F monitor the side beams. Tracking is perfect when the E and F signals are equal.

https://www.repairfaq.org/sam/cdfaq.htm#cdcdopop

So if you are oscillating a little bit off the track, then you can use the tracking coil to compensate, but if you trend continuously to one side you would move the sled. I don't know how this is done, but that looks like a job for a Kalman filter. The linked page also mentions open-loop heuristics for track seeks, but then you check the timecode where you landed and go back into closed-loop fine control.

The principle here of 'measuring the effect rather than the actuator position' is commonly used in both hobby and industrial settings; it arguably is what makes closed loop control closed.


问:
Robot heading uncertainty values
I'm tracking the state of a robot using an EKF defined by:
$$(x,y,\theta)$$
where $x$ and $y$ are the coordinates in the ground-plane and $\theta$ the heading angle.
I initialized the covariance matrix $P$ to the following values:
$$P
=
\begin{bmatrix}
\sigma_{xx}^2 & 0 & 0 \\
0 & \sigma_{yy}^2 & 0 \\
0 & 0 & \sigma_{\theta \theta}^2 \\
\end{bmatrix}
$$
where $\sigma_{xx}=1$, $\sigma_{yy}=1$ and $\sigma_{\theta \theta }=0.1$

In the system i'm using, valid measurements are rearely obtained so the predicted covariance matrix becomes very big.
My question concerns the angle uncertainty, the angle is predicted from angle increments $\Delta_{theta}$ so, at each time stamp $k$:
$$\theta=\theta+\Delta_{theta_{k}}$$
We wrap the value of the obtained angle to make $\theta\in[-\pi,\pi]$.
Does the uncertainty have to be also wrapped to the interval $[-\pi,\pi]$? means that making $\sigma_{\theta }\in[-\pi,\pi]$?

答:
If your angle is oscillating by 0.2° between 259.9° and 0.1° and you apply wrapping to it before feeding back into the Kalman filter, you will get a large error; your description doesn't make it clear when you wrap $\theta$ - before calculating the error or after.

Also ensure $\mid\Delta_{theta}\mid < 180°$ so you don't do larger jumps (or, if large rotations in a time step are possible, have a heuristic to assume the direction is the same as last time if the steps were increasing in magnitude up to the wrap point). Eventually (depending on how many times you spin round and what precision you are working with) you'll have to deal with wind up and wrap the internal state of the filter; at that point you'll have to adjust the residual to allow for the step change.

Title: Robot heading uncertainty values


答:
No, the uncertainty should not be wrapped.

Remember, uncertainty is fundamentally different than angle. At the most trivial level, uncertainty cannot be negative or even zero (i.e. $\sigma_\theta > 0$).

At another level, the angles $\pi$ and $3\pi$ represent the exact same thing, and wrapping the angle is more a nicety than an actual requirement. But $\sigma_\theta=\pi$ implies less uncertainty than $\sigma_\theta = 3\pi$ so if you wrapped you'd be fundamentally changing the uncertainty.

Title: Robot heading uncertainty values

Body:
I'm tracking the state of a robot using an EKF defined by:
$$(x,y,\theta)$$
where $x$ and $y$ are the coordinates in the ground-plane and $\theta$ the heading angle.
I initialized the covariance matrix $P$ to the following values:
$$P
=
\begin{bmatrix}
\sigma_{xx}^2 & 0 & 0 \\
0 & \sigma_{yy}^2 & 0 \\
0 & 0 & \sigma_{\theta \theta}^2 \\
\end{bmatrix}
$$
where $\sigma_{xx}=1$, $\sigma_{yy}=1$ and $\sigma_{\theta \theta }=0.1$

In the system i'm using, valid measurements are rearely obtained so the predicted covariance matrix becomes very big.
My question concerns the angle uncertainty, the angle is predicted from angle increments $\Delta_{theta}$ so, at each time stamp $k$:
$$\theta=\theta+\Delta_{theta_{k}}$$
We wrap the value of the obtained angle to make $\theta\in[-\pi,\pi]$.
Does the uncertainty have to be also wrapped to the interval $[-\pi,\pi]$? means that making $\sigma_{\theta }\in[-\pi,\pi]$?


问:
Powering Off Main Processor Without Software shutdown
I am building a robot that uses an Intel NUC (running ArchLinux) as its main processing unit to run some machine learning and ROS programs scripts.  One of the requirements for the robot is that it must fully turn off and on by a single main power switch.  By doing so, it cuts power to the entire robot, including the NUC.  I am worried that doing so will damage the NUC.  Is there any safe way to shut down a computer without having to turn it off via software. </p>

<p>**One more requirement for the robot is that its electronics are sealed in in an airtight box, therefore the NUC cannot be accessed to turn off via the main power button.</p>

答:
Most PCs can survive power loss.
Here is a video showing how to configure the NUC BIOS to restart on Power On after Power Fail.

I would be more concerned about your comment that it must be "sealed in an airtight box"!  PCs generate a lot of heat and they need a way to get rid of it.  If not, they will overheat.

There is a fan in most PCs.  The fan is not always obvious (they often like to hide it); but, when it is there, it needs to be able to circulate air to keep the PC cool.  Here is a video about that.

Note: Even if you have a fanless computer, it will still require some sort of air flow (possibly convection) to prevent it from overheating.  For example, this fanless NUC has a max operating temp of 40C (104F).  Even a hot day WITH air circulation it can overheat it.  Without a source of fresh air, this it going to be much worse.  Remember what happens in your car on a summer's day when you leave the windows rolled up.