Gazebo | Ignition | Community
Ask Your Question

Problem of creating a model with texture and using a ros camera

asked 2018-11-13 14:46:30 -0600

michou214 gravatar image

updated 2018-11-14 09:41:49 -0600

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 : image description

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. image description

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 image description

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: image description 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: image description

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

edit retag flag offensive close merge delete


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.

chapulina gravatar imagechapulina ( 2018-11-13 16:20:36 -0600 )edit

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.

michou214 gravatar imagemichou214 ( 2018-11-14 02:46:47 -0600 )edit

I edit my problem to give you more details.

michou214 gravatar imagemichou214 ( 2018-11-14 09:42:25 -0600 )edit

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?

chapulina gravatar imagechapulina ( 2018-11-14 11:56:17 -0600 )edit

Here you can find the files : **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 ...

michou214 gravatar imagemichou214 ( 2018-11-14 13:41:15 -0600 )edit

**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

michou214 gravatar imagemichou214 ( 2018-11-14 13:44:47 -0600 )edit

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 :, under **Printing Your Own AprilTags**

michou214 gravatar imagemichou214 ( 2018-11-14 13:46:22 -0600 )edit

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.

chapulina gravatar imagechapulina ( 2018-11-14 14:55:16 -0600 )edit

Okay let me know if it works with rosrun rqt_image_view rqt_image_view

michou214 gravatar imagemichou214 ( 2018-11-14 15:00:12 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2018-11-16 01:52:25 -0600

michou214 gravatar image


I found a solution and I'm pretty sure it is a problem of path.

When I was creating my world with Gazebo, I get this Insert tab: image description

I inserted my modified models from /home/username/model_editor_models(green arrow, 2nd picture) and it creates the problem mentionned above.

When I was running a simulation, I tried to add an another Iris model. I discover that the one in my world was coming from the folder /home/username/Firmware/Tools/sitl_gazebo/models. image description

So I tried to put my modified models in this folder. To be able to insert my model, I had to launch my simulation otherwise I didn't get the right folder (red arrow) to insert my models. Then I save the world and change it in my launch files.

Now when I used rosrun rqt_image_view rqt_image_view, I have my models with the right texture.

I hope it could help you if you have the same problem even if it is not a clean solution (or maybe yes). If someone have a precise response or explanation, I would appreciate his contribution.

Best regards :)

edit flag offensive delete link more

answered 2019-05-05 21:15:43 -0600

YX.E.Z gravatar image

Totally appreciate your answers, they help a lot. I solve a similar problem in a similar way.I used to put my custom textured model in my own folder, and then the gazebo camera plugin seems don't like it, so the simulated camera don't work any more. I solve it by putting all my custom models in the /.gazebo/models folder. Then the simulated camera is satisfied and happy to work finally.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-11-13 14:46:30 -0600

Seen: 2,314 times

Last updated: May 05 '19