ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Usually you don't have to take care about that. ROS is a framework in which you write C++ (C++03) applications which dialog with the underlyind drivers. Take as an example a joystick. You plug the joystick in the PC and it will be recognized by the linux kernel. If yu want to use the joystick In ROS then you write an application which dialogs with those drivers. So you don't touch the hardware directly. Simply look for a linux driver for that device and don't care about it anymore. The main idea behind this concept is: you install a sensor/hardwware/device in linux as you never heard about ROS. The related device's drivers usually let you to speak directly to the hardware. The next step is then writing a code in ROS which dialogs with those drivers but doesn't touch your device/sensors... and for this you must use C++

In a rare case, where you need to write C or to create an interface for a device, which has/has no C++ support, you can use the following C++ directive in your surce file:

extern "C" {
// code
}

and write C code.

Regards

Usually you don't have to take care about that. ROS is a framework in which you write C++ (C++03) applications which dialog with the underlyind drivers. Take as an example a joystick. You plug the joystick in the PC and it will be recognized by the linux kernel. If yu you want to use the joystick In ROS then you write an application which dialogscommnicates with those drivers. So you don't touch the hardware directly. Simply look for a linux driver for that device and don't care about it anymore. The main idea behind this concept is: you install a sensor/hardwware/device in linux as you never heard about ROS. The related device's drivers usually let you to speak directly to the hardware. The next step is then writing a code in ROS which dialogs with those drivers but doesn't touch your device/sensors... and for this you must use C++

In a rare case, where you need to write C or to create an interface for a device, which has/has no C++ support, you can use the following C++ directive in your surce file:

extern "C" {
// code
}

and write C code.

Regards

Usually you don't have to take care about that. ROS is a framework in which you write C++ (C++03) applications which dialog with the underlyind drivers. Take as an example a joystick. You plug the joystick in the PC and it will be recognized by the linux kernel. If you want to use the joystick In ROS then you write an application which commnicates with those drivers. So you don't touch the hardware directly. Simply look for a linux driver for that device and don't care about it anymore. The main idea behind this concept is: is that ROS takes care about communication betweens many nodes, that's all. In this way you install a sensor/hardwware/device in linux as you never heard about ROS. The related device's drivers usually let you to speak directly to the hardware. hardware or provides some useful functions, that can be called from your code. The next step is then writing a code in ROS which dialogs with those drivers but doesn't touch your device/sensors... and for this you must use C++

In a rare case, where you need to write C or to create an interface for a device, which has/has no C++ support, you can use the following C++ directive in your surce file:

extern "C" {
// code
}

and write C code.

Regards

Usually you don't have to take care about that. ROS is a framework in which you write C++ (C++03) applications which dialog with the underlyind drivers. Take as an example a joystick. You plug the joystick in the PC and it will be recognized by the linux kernel. If you want to use the joystick In ROS then you write an application which commnicates with those drivers. So you don't touch the hardware directly. Simply look for a linux driver for that device and don't care about it anymore. The main idea behind this concept is that ROS takes care about communication betweens many nodes, that's all. In this way you install a sensor/hardwware/device in linux as you never heard about ROS. The related device's drivers usually let you to speak directly to the hardware or provides some useful functions, that can be called from your code. The next step is then writing a code in ROS which dialogs with those drivers but doesn't touch your device/sensors... and for this you must use C++

In a rare case, where you need to write C or to create an interface for a device, which has/has no C++ support, you can use the following C++ directive in your surce file:

extern "C" {
// code
}

and write C code.

Or we can have the following situation. You have bought a new device, let's say a 9 DOF accelerometers, gyroscope and magnetometer (https://www.sparkfun.com/products/10736). And for this device you don't have any driver yet. The only thing you want is to get data from the device for your application. What you can do is getting the serial raw data output from the device into ROS though serial interface (with rosserial) and there write your application for working with that datas. In this case you didn't need specifically a driver for that device. In the same manner you could plug your camera, a sensor, a I2C interface, and so on.

For many motor drivers, interfaces and so on there are ready to use ROS-packages available. On the next level you need (maybe) a package to work with that datas and...for example, implement a Kalman filter for your application. Even in that case you have many available ROS-packages raedy to use. So you don't need to write and debug your Kalman filter, spending 2 months of your life debbing that code. Some other people wrote already a stable application (package) and share it with others. Another example could be kinematic transformation for a robot arm. If you look in a book about robotics you understand very fast, that writing a code for that is too expansive.

Why ROS: the main idea behind ROS' concept is: we have many applications (nodes) which differents tasks. What I need is a way to let them to comunicate (publishing and listening) each other those streams (topics) of informations. Thats all.

Regards

Usually you don't have to take care about that. ROS is a framework in which you write C++ (C++03) applications which dialog with the underlyind drivers. Take as an example a joystick. You plug the joystick in the PC and it will be recognized by the linux kernel. If you want to use the joystick In ROS then you write an application which commnicates with those drivers. So you don't touch the hardware directly. Simply look for a linux driver for that device and don't care about it anymore. The main idea behind this concept is that ROS takes care about communication betweens many nodes, that's all. In this way you install a sensor/hardwware/device in linux as you never heard about ROS. The related device's drivers usually let you to speak directly to the hardware or provides some useful functions, that can be called from your code. The next step is then writing a code in ROS which dialogs with those drivers but doesn't touch your device/sensors... and for this you must use C++

In a rare case, where you need to write C or to create an interface for a device, which has/has no C++ support, you can use the following C++ directive in your surce file:

extern "C" {
// code
}

and write C code.

Or we can have the following situation. You have bought a new device, let's say a 9 DOF accelerometers, gyroscope and magnetometer (https://www.sparkfun.com/products/10736). And for this device you don't have any driver yet. The only thing you want is to get data from the device for your application. What you can do is getting the serial raw data output from the device into ROS though serial interface (with rosserial) and there write your application for working with that datas. In this case you didn't need specifically a driver for that device. In the same manner you could plug your camera, a sensor, a I2C interface, and so on.

For many motor drivers, interfaces and so on there are ready to use ROS-packages available. On the next level you need (maybe) a package to work with that datas and...for example, implement a Kalman filter for your application. Even in that case you have many available ROS-packages raedy to use. So you don't need to write and debug your Kalman filter, spending 2 months of your life debbing that code. Some other people wrote already a stable application (package) and share it with others. Another example could be kinematic transformation for a robot arm. If you look in a book about robotics you understand very fast, that writing a code for that is too expansive.

Why ROS: the main idea behind ROS' concept ROS concept's is: we have many applications (nodes) which differents tasks. What I need is a way to let them to comunicate (publishing and listening) each other those streams (topics) of informations. Thats all.

Regards