Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visualizing a model that uses .gltf #369

Open
TrevorJohst opened this issue Nov 10, 2024 · 0 comments
Open

Visualizing a model that uses .gltf #369

TrevorJohst opened this issue Nov 10, 2024 · 0 comments

Comments

@TrevorJohst
Copy link

Hi, sorry if I am missing something simple but I can't seem to figure out how to visualize a model that uses .gltf meshes instead of .obj. I made a copy of the iiwa manipulator example, and tried to load my own urdf with a parser. It seemingly works fine looking at rqt_graph and echoing the visualization topic, but if I try to open rviz I get a segmentation fault.

When I tried replacing the .gltf files with an .obj, it worked perfectly fine. I would think .gltf simply doesn't work, but looking at the multirobot example, it seems to be loading this urdf, which uses .gltf.

My file is the same as the iiwa manipulator example, but I removed the manipulation_station and replaced it with this:

plant, scene_graph = AddMultibodyPlantSceneGraph(builder, time_step=0.1)

parser = Parser(plant)
parser.AddModels("path/to/urdf")
link_1_frame = plant.GetFrameByName("link-1")
plant.WeldFrames(plant.world_frame(), link_1_frame)
plant.Finalize()

rviz_visualizer = builder.AddSystem(
    RvizVisualizer(ros_interface_system.get_ros_interface()))

rviz_visualizer.RegisterMultibodyPlant(plant)
rviz_visualizer.ComputeFrameHierarchy()

builder.Connect(
    scene_graph.GetOutputPort('query'),
    rviz_visualizer.get_graph_query_input_port()
)

I have confirmed that the urdf works normally in Drake, as I was able to load it in Meshcat in a separate notebook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant