A: In order to do navigation using a laser for localization and obstacle avoidance, you need to do first a map of the environment you want to move through. For that, you need to use the gmapping package. Launch the gmapping package, and then move the robot around using the keyboard or joystick so it can build the map.
Once the map is done, you need to save it using the following command:
rosrun map_server map_saver -f name_of_map
Then you are ready to use that map for localization and sending the robot to different locations in the map, while avoiding obstacles. Kill the gmapping node and launch now the localization package (the amcl). Together with the amcl you need to launch the map_server (to use the map you created on the previous step) and the move_base (to make the robot move around while avoiding obstacles).
Why you should equip your team with ROS skills? How to give your team not only knowledge but also practical experience to create any ROS based robotics development? Get answers in this webinar.
Q: How to use ira_laser_tools package to merge laser data
A: the reason why you cannot see in the /scan_multi the obstacles of the back is because you are using the default configuration of the ira_laser_tool. By default, the ira_laser_toolpackage does not produce the /scan_multi from -PI to +PI, but some other weird values.
The solution, is to use the rqt_reconfigure tool to set the angle_min and angle_max parameters to -PI and +PI respectively. To do that, open the tool with the command:
rosrun rqt_reconfigure rqt_reconfigure
You should see something like in the picture attached. Then, just change the angle values. I recommend you change that while watching the scan in rviz so you will see clearly how the scan changes based on your values.
The original question can be found here: https://answers.ros.org/question/273572/how-to-use-ira_laser_tools-package-to-merge-laser-datas/#273809
Learn how to publish a blob detection in 2D in RVIZ through markers : https://answers.ros.org/question/273792/hi-i-wanto-to-meake-a-program-that-give-the-position-of-a-red-ball-in-2d-with-rviz/
Q:Hi, i wanto to meake a program that give the position of a red ball in 2D with rviz
A: So here you have very rudimentary solution. Of course you will need to add calibration procedures, and take extra thing into account like the blob area to get the distance value, but this I hope gives you a starting point.
So essentially you need to publish a Marker topic , with a Sphere Type of colour red. This marker will have to be referenced to your camera link or similar. I’ve done this Video as an example of how it could be done.
In today’s Q&A, the question is How to use a c++ vector container in my code and to publish and subscribe it in ROS.
Let’s see how to do it.
Step 0. Create a project in ROS Development Studio(ROSDS)
ROSDS helps you follow our tutorial in a fast pace without dealing without setting up an environment locally. If you haven’t had an account yet, you can create a free account here. Let’s create a new project and call it ros_q_a_messages.
Step 1. Create a package
Let’s create a new package and a msg folder for our code.
cd ~/catkin_make/src
catkin_create_pkg my_pkg roscpp std_msgs geometry_msgs
cd my_pkg
mkdir msg
In the msg folder, we’ll define the message in the my_msg.msg file
geometry_msgs/Point[] points
uint8 another_field
In order to compile the message, we have to change two files. The first one is the pckage.xml, add the following two line.
cd ~/catkin_ws
catkin_make
source devel/setup.bash
Now you can run the executable rosrun my_pkg my_publisher with the node is publishing something.
You also have to run a simulation or run roscore to start the rosmaster
The next step is to create a subscriber to subscribe to the topic. Let’s create a my_subscriber.cpp file under the src folder with the following content.