Note that these objects are floating and just creating them does not mean that they will be rendered in the map. These floating objects are supposed to be used in other contexts like addPose and addStaticObject as below.
Adding a pose
r2d.addPoseWithTopic({
object:image,
topic:"/slam/pose"
});
constrobot=r2d.addPoseWithUpdater({
object:image,
topic:"/slam/pose"
});
...
robot.updatePose(pose);
...
Adding a static object
r2d.addStaticObject({
object:circle,
x:-10,
y:-10,
rotationInDegClockwise:90
});
Adding a path
r2d.addPath({
points:[
{x:0,y:0},
{x:-10,y:-10},
{x:-15,y:-5},
{x:-20,y:-15},
{x:-10,y:-20}
],
width:0.5,
color:"red",
tension:1
});
Removing objects
Each of addPose, addStaticObject, addPath return an object with a destroy function that can be called to remove them from the canvas.