Ask Your Question
0

Sensor implementation

asked 2020-04-08 13:28:01 -0500

jean01 gravatar image

updated 2020-04-08 13:33:37 -0500

gvdhoorn gravatar image

From this page, there are lots of sensors to be used in ros robots.

http://wiki.ros.org/Sensors

but I could not install any of them to the robots in my simulations.

For example I want to install the camera:

$ sudo apt-get install ros-kinetic-usb-cam

I get the error:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package ros-kinetic-usb-cam

What is the most straightforward way to install any sensor or camera to a robot? What can be the reason of the error I am getting?

Thanks

edit retag flag offensive close merge delete

Comments

but I could not install any of them to the robots in my simulations.

In general it's a good idea to provide sufficient information when posting a question.

We don't know what type of "simulations" you are referring to. Which tool(s) you are using, what you are simulating or even whether you're using ROS.

gvdhoorn gravatar image gvdhoorn  ( 2020-04-08 13:37:29 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2020-04-08 13:33:20 -0500

gvdhoorn gravatar image

updated 2020-04-08 13:56:07 -0500

The packages on the page you list almost exclusively support real hardware, so sensors you would install physically on a real robot system.

These so called drivers (just as you would call them under Windows or OSX) are typically not used with simulated robots, as the simulators either don't support simulation at that level of detail and/or the models don't use / support any of those sensors.

Perhaps already clear, but just to emphasise: ROS is not primarily targetting simulations. It's a software framework which can be used with both real and simulated hardware/robots. It's relatively easy to setup ROS applications which are agnostic to whether a real robot or a simulated one is what they are controlling, but you will need to be aware of the difference and not attempt to use drivers for real hardware with a simulated robot.

As to the issue with apt-get there are many potential causes. You'll have to provide more information about things such as which OS you are using, which version, which version of ROS you've installed and how you installed it.


Edit:

Actually I am working on theconstructsim.com on Ubuntu 16.04 + ROS Kinetic + Gazebo 7 with different simulation environments and robots. As far as I could understand from the sources I read, sensor implementation can be done from the shell.

If you're using The Construct's environment I would not be able to help you. I've not used that, so I would not know whether or how you'd install additional packages.

You'd have to ask them.

For a regular installation of ROS, such as on your own PC, laptop or even in a VM, the command line you showed would/should work. But to reiterate: it would not help you with your simulation, as the package you mention (usb_cam) is for working with real hardware, not with a simulator.

As you seem to be working with Gazebo, you may want to take a look at gazebosim.org/tutorials, especially the categories Build a Robot and Connect to ROS. They should show you that with Gazebo, you use virtual sensors, but those don't use regular driver nodes, but directly publish their sensor data from the simulation.

edit flag offensive delete link more

Comments

Thank you very much for your answer gvdhoorn.

Actually I am working on theconstructsim.com on Ubuntu 16.04 + ROS Kinetic + Gazebo 7 with different simulation environments and robots. As far as I could understand from the sources I read, sensor implementation can be done from the shell.

jean01 gravatar image jean01  ( 2020-04-08 13:49:20 -0500 )edit

Thank you again. This was helpful. Anyone who has used theconstructsim.com before with sensors?

jean01 gravatar image jean01  ( 2020-04-08 14:11:39 -0500 )edit

I was able to get sensor readings of Lidar from an unmanned car robot with the help of this website http://gazebosim.org/tutorials?tut=co...

Now I need to get all sensor readings from a longer time interval. Linux command shell shows only a limited number of the last sensor readings. My aim is to get them all together with timestamps in order to merge into one simple xls or csv file

jean01 gravatar image jean01  ( 2020-04-08 15:28:52 -0500 )edit

I would actually recommend you take a look at rosbag. It is the standard go-to tool to record ROS datastreams.

Linux command shell shows only a limited number of the last sensor readings.

This is really not how you should be approaching this. rostopic echo is not meant as a tool to use too heavily. It's really just a programmers/debugging interface to a running ROS node graph.

Please invest some time into rosbag. Only if that doesn't appear to satisfy your requirements start looking at alternatives.

Anyone who has used theconstructsim.com before with sensors?

You may also want to become a bit more familiar with Gazebo, gazebo_ros_pkgs and how Gazebo models/integrates which what you refer to as "sensors".

Just about all ROS robots integrate a sensor of some sort. The Construct doesn't really do anything here which seems to warrant special attention. It's ...(more)

gvdhoorn gravatar image gvdhoorn  ( 2020-04-09 02:53:31 -0500 )edit

Oh, and something I just remembered: perhaps ros_flight could be interesting. Perhaps not as something to use out-of-the-box, but as a source of information on how drone control could be implemented in ROS and to give you more insight into how they have solved certain challenges.

I don't use drones myself at all, so I don't know whether it works, how well it works, etc. But at least on the software side it could prove useful to take a look.

gvdhoorn gravatar image gvdhoorn  ( 2020-04-09 04:32:26 -0500 )edit

Thank you very much again. Now I have collected the data into a csv and txt file with the help of these links

http://wiki.ros.org/ROS/Tutorials/Rec...

https://answers.ros.org/question/9102...

Now I will have to change the sampling rate of sensors to a higher time interval as there is too much data collected in a short amount of time. It becomes harder to download. How can I reduce the created amount of data at a certain time of simulation?

jean01 gravatar image jean01  ( 2020-04-09 09:48:52 -0500 )edit

Please do not ask follow-up questions in comments under answers of your previous question.

Post a new question, while potentially referring back to this one.

gvdhoorn gravatar image gvdhoorn  ( 2020-04-09 11:13:18 -0500 )edit

ok I am opening a new question on https://answers.ros.org/question/3489...

jean01 gravatar image jean01  ( 2020-04-09 11:23:33 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-04-08 13:28:01 -0500

Seen: 38 times

Last updated: Apr 08