Ask Your Question

Visualize collada file on rviz [closed]

asked 2016-03-07 00:16:14 -0500

swethmandava gravatar image

updated 2016-03-13 03:26:49 -0500

I exported a collada file through sketch up but am unable to figure out what the problem is. Here is my code! Status on Rviz is okay but cannot see any display! Please help

#!/usr/bin/env python
import rospy
from visualization_msgs.msg import Marker

marker = Marker()
marker.header.frame_id = "/surface"
marker.header.stamp = rospy.Time()
marker.ns = "primitive_surfaces" = 0
marker.type = marker.MESH_RESOURCE
marker.action = marker.ADD
marker.pose.position.x = 0
marker.pose.position.y = 0
marker.pose.position.z = 0
marker.pose.orientation.x = 0.0
marker.pose.orientation.y = 0.0
marker.pose.orientation.z = 0.0
marker.pose.orientation.w = 1.0
marker.scale.x = 1
marker.scale.y = 1
marker.scale.z = 1
marker.color.a = 1.0
marker.color.r = 0.0
marker.color.g = 1.0
marker.color.b = 0.0
marker.mesh_resource = "file:///home/swethmandava/catkin_ws/src/planning_inspection/planning_inspection_ros/nodes
pub = rospy.Publisher('surface', Marker, queue_size=1)
rate = rospy.Rate(60)
while not rospy.is_shutdown():

Edit: Included rviz screenshot and frame information

image description

this is my tf frame:

#!/usr/bin/env python 
import roslib
import rospy
import tf
if __name__ == '__main__':
    br = tf.TransformBroadcaster()
    rate = rospy.Rate(10)
    while not rospy.is_shutdown():
        br.sendTransform((0.0,0.0,0.0), (0.0,0.0,0.0,1.0),,"map", "surface")
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by swethmandava
close date 2016-03-08 02:41:52.957403

1 Answer

Sort by ยป oldest newest most voted

answered 2016-03-07 01:30:30 -0500

ahendrix gravatar image

Your marker type is set to SPHERE. You should probably set it to MESH_RESOURCE.

edit flag offensive delete link more


Also: make sure you have the scaling right: RViz (ROS) uses meters, not millimeters.

gvdhoorn gravatar image gvdhoorn  ( 2016-03-07 01:50:42 -0500 )edit

@ahendrix I made the change, sorry I was trying everything. Originally it was mesh_resource but it doesn't seem to work either. @gvdhoorn yes ofcourse

swethmandava gravatar image swethmandava  ( 2016-03-07 02:23:16 -0500 )edit

I see two other potential issues here: (1) your publisher only publishes once, at startup. Subscribers may not be connected yet, and (2): do you have the correct fixed frame selected in rviz?

ahendrix gravatar image ahendrix  ( 2016-03-07 12:13:46 -0500 )edit

A screenshot of rviz would be very helpful in debugging.

ahendrix gravatar image ahendrix  ( 2016-03-07 12:14:03 -0500 )edit

Added the info @ahendrix

swethmandava gravatar image swethmandava  ( 2016-03-07 23:43:14 -0500 )edit

From your screenshot, my best guess is that rviz isn't receiving your message, because you publish immediately after you create the publisher, and the subscriber isn't connected yet. You may want to try publishing continuously or using a latched topic.

ahendrix gravatar image ahendrix  ( 2016-03-08 00:20:56 -0500 )edit

Thank you so much @ahendrix I think the problem seems to be with my sketchup file. I downloaded another collada file off the internet and that seems to work!

swethmandava gravatar image swethmandava  ( 2016-03-08 02:41:08 -0500 )edit

@swethmandava may i knonw where you download the dae file?? becos i am facing the same problem

ber gravatar image ber  ( 2021-01-31 01:33:47 -0500 )edit

Question Tools

1 follower


Asked: 2016-03-07 00:16:14 -0500

Seen: 533 times

Last updated: Mar 13 '16