Gazebo | Ignition | Community
Ask Your Question
0

insert model from a path using c++ api

asked 2020-06-09 00:32:28 -0500

cadbury gravatar image

How to insert model from a path in local computer in gazebo? I have heard solutions like using an EXPORT statement. But what I require is that we must automatically add path from a plugin using some function. I have tried addURIpath function but it is not working and the model is being searched from the online database. Can anyone suggest a solution for this? Thank you.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-06-09 03:21:08 -0500

You can add a model path with the following

#include <gazebo/common/SystemPaths.hh>
gazebo::common::SystemPaths::Instance()->AddModelPaths("path");
edit flag offensive delete link more

Comments

Hi, thanks for your reply. I have tried this, when I print the model paths my custom model path can be seen. However when I try to insert model using insertModelSDF which is in my current directory and which is supposed to import meshes from other directory, it is not working and again tries to search in the model database. Can you suggest a fix for that?

cadbury gravatar imagecadbury ( 2020-06-10 02:13:22 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-06-09 00:32:28 -0500

Seen: 135 times

Last updated: Jun 09 '20