ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

[RVIZ] MarkerArray Display

asked 2019-03-05 03:39:34 -0600

KinWah gravatar image

Hi. I am using: RVIZ 1.13.1 melodic ubuntu 18.04

I have a task to visualize sensor data on a map. In the image below, it can be saw that the blue MarkerArray able to display correctly according to the path that the robot has moved. However, suddenly the MarkerArray failed to display on the left hand side and bottom right of the map. It seems like it is unable to publish anything if the coordinate provided is a negative value.

image description

Can anyone suggest me what should i do to solve this issue ?

Below is my coding in python to generate marker array.

        triplePoints = []
        colorsGroup = []
        markerArray = MarkerArray()
        for (x,y,z,a) in gdm_mean_data:
            if not numpy.isnan(a) and a > 0.10000000149 :
                p = Point() 
                p.x = x
                p.y = y
                p.z = -5
                marker = Marker()
                marker.header.frame_id = "/map"
                marker.type = marker.POINTS
                marker.action = marker.ADD
                marker.scale.x = 0.1
                marker.scale.y = 0.1
                marker.scale.z = 0.1
                marker.pose.orientation.w = 1
                t = rospy.Duration()
                marker.lifetime = t
        marker.points = triplePoints
        marker.colors = colorsGroup
edit retag flag offensive close merge delete


and is there anyway to change the map position (bottom left) to start with (0,0) ?

KinWah gravatar image KinWah  ( 2019-03-05 03:42:24 -0600 )edit

I would test few things :

  1. If those values actually exist in gdm_mean_data
  2. Eventhough you find out that they exist, do they respect the if condition ?
  3. Check with rostopic echo /YOUR_MARKER_TOPIC if those values are published (if yes then there is something wrong with the marker)
Delb gravatar image Delb  ( 2019-03-05 07:12:38 -0600 )edit

Thanks @Delb! After review my own coding, it seems like it is my own algorithm problem xD Thanks for the hints !

KinWah gravatar image KinWah  ( 2019-03-05 09:02:30 -0600 )edit

Can you answer your own question detailling what you did to make things work and mark it as correct please ? It can help future readers encoutering similar issues.

Delb gravatar image Delb  ( 2019-03-05 09:16:04 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-03-05 23:48:14 -0600

KinWah gravatar image

This issue is solved.

There are two methods to solve this issue.

The first method is I realized the coding i use to generate the coordinate for marker arrays only work for coordinate from 0 to 10 m only. By modifying this setting, it solved the problem. However, modifying this parameter affect the coding performance. Hence, I am try method 2.

The second method is to reposition the map coordinate by changing the Map's Position at the Display Panel at the left to 0;0. Currently I am looking for a way to achieve this method 2 since the mapping is done via rosbag ^_^

edit flag offensive delete link more


Thanks for adding your detailled answer. Now I'm not sure your second method is the best solution (it could be a work-around but not a viable option) because you just trick the map position but it can be overwritten.

Delb gravatar image Delb  ( 2019-03-06 02:20:08 -0600 )edit

I think your first method is the right idea, a code should be able to deal with every coordinates so you can ask a new question providing your code and we might be able to find a more suitable solution for your issue :)

Delb gravatar image Delb  ( 2019-03-06 02:21:32 -0600 )edit

Thanks Delb for the advice ^_^ Currently I manage to solve the problem by using method 1. What you said is right as trick the map is not a good idea to be done. Will remember and practice it :)

KinWah gravatar image KinWah  ( 2019-03-07 09:03:50 -0600 )edit

Question Tools



Asked: 2019-03-05 03:39:34 -0600

Seen: 2,270 times

Last updated: Mar 05 '19