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

Revision history [back]

click to hide/show revision 1
initial version
  1. In your class marker, self.pt_x is not an array. It is a single float. So your for loop in the point_cloud() callback does nothing useful.
  2. Currently the code in main() executes only once, then execution sits in rospy.spin() forever. So you are calling self.pub.publish() either once or never (probably never.)
  3. Once you fix item (1), you could invoke the Marker message create & publish after the for loop in point_cloud() callback. Whether you should publish every time the callback executes depends on how often you think the point_cloud() callback is going to be called.