How to create colored objects in moveit or Rviz in robot's frame
I have been making collision objects just to use them as regular grasping object in moveit, I keep a distance between the robot's gripper and the object so that I can plan the gripper. This is the code that I have been using so far:
p = PoseStamped()
p.header.frame_id = robot.get_planning_frame()
p.pose.position.x = 0.82
p.pose.position.y = 0.30
p.pose.position.z = 1.20
p.pose.orientation.x = 0.0
p.pose.orientation.y = 0.0
p.pose.orientation.z = 0.0
p.pose.orientation.w = 1.0
scene.add_box("object1", p, (0.1, 0.5, 0.1))
What I need now, is to create objects of various types and set pose for them, or I may also create regular objects as I created before and set different colors for different endpoints of the objects to distinguish them. I need to know if I can do that and how to do that.