Problem of creating a model with texture and using a ros camera
Hello everyone,
I'm quite new in Gazebo and ROS but even after following tutorials and try to copy what is working, I get some weird results as shown in this picture :
I'm trying to create some model with a texture that would be an Apriltag (like QR code). I will explain all the steps I did to arrive a the picture above:
Step 0:
In Gazebo, I add a cube and by using the "Model edit" mode, I transformed it into a small squared panel. When I saved it, it create my a new folder in my home: model_editor_models which contains the model (texture, material and so on). Now as you can see in the picture below there are more of them. They are my other tests.
Step 1:
Then, after closing Gazebo, I launched it again and I add the model that I created/modified. I saved them in a file called Test_for_forum.world.
Step 2:
I made a catkin_make in my project workspace (just to be sure but I know it changes nothing). I launch in differente terminal:
roscore
rosrun rqt_image_view rqt_image_view
roslaunch waypoint_navigation main.launch
And I get this:
As we can see, the big box does not have anymore the Apriltag at the top. This is a first problem. I don't know why but it takes a long time to get an image in the rqt windows. When finally, it works, I obtain this result:
As you can see through the rqt window, the texture on the cube is white and there is no more the apriltag.The same thing happens on the small panel.
More precision the cube is just a copy/past of the folder that create the cube/sphere/cylinder with the colored texture. I just delete the sphere and cylinder in the model file and change the texture with mine.
Is there someone that have this problem ? Thanks in advance
What Gazebo / ROS versions are you using? When you check the camera image on Gazebo's topic viewer (press Ctrl+T), does it look right? I just tried Gazebo 9 and it seems to work.
I'm using Gazebo 7 and ROS Kinetic. I'll try your suggestion this afternoon and keep you in touch. How did you try it ? Because if I used the model "Textured Shapes" from the database of Gazebo it works for me too. But since I try to make modification, it doesn't.
I edit my problem to give you more details.
Thanks for the extra details. The problem could be coming from your texture. You haven't changed `textures.material`, right? Are you using a PNG texture? Could you add a link to the texture file or the whole model?
Here you can find the files : https://github.com/michou214/Rendering_problem **APtag folder** is a copy of "textured_shapes" that I modified to get my small panel with the apriltag texture. **APtag0 folder** is my first try of doing all but I there is a .dae file created with blender and adding directly the texture inside the meshed model (from https://www.youtube.com/watch?v=WDhIaVOUwskl). ...
**textured_shapes folder** is the official one that you can found in the Gazebo database. **textured_shapes(copy) folder** is the copy of above one. Where I deleted the sphere and cylinder and juste change the png file of the texture. I
I changed the script because otherwise I can't precise which texture it should use. Yes it's a PNG that I generated using the instruction provided : http://wiki.tekkotsu.org/index.php/AprilTags, under **Printing Your Own AprilTags**
I tried your models on both Gazbeo 7 and 9 and the camera images published within Gazebo look ok. I haven't checked with ROS yet.
Okay let me know if it works with rosrun rqt_image_view rqt_image_view