Search code examples
collisionrosroboticsmoveit

No visualization in Rviz when publishing on (collision_object) topic?


I am trying to add a collision object using another way than

planning_scene.addCollisionObjects(std::vector<moveit_msgs::CollisionObject>)

so I am trying to publish on (collision_object) and (attached_collision_object) topics using

ros::Publisher pub_co = nh2.advertise<moveit_msgs::CollisionObject>("collision_object", 10);
ros::Publisher pub_aco = nh2.advertise<moveit_msgs::AttachedCollisionObject>("attached_collision_object", 10);

However nothing shows in Rviz, when i echo the topic the msg is shown but nothing in Rviz I also tried using moveit_visual_tools method

visual_tools_->publishCollisionBlock(------)

but also i get nothing !

any ideas why ?


Solution

  • The Problem was just simply not listening to the correct planning scene Topic, the strange thing is that the topic name was the .cpp file name (does moveit_visual_tools publish the .cpp as a topic name?) After the correct planning scene topic was chosen visualization in Rviz was perfect.