M-File Help: plot_vehicle | View code for plot_vehicle |
Draw mobile robot pose
plot_vehicle(x,options) draws an oriented triangle to represent the pose of a mobile robot moving in a planar world. The pose x (1x3) = [x,y,theta]. If x is a matrix (Nx3) then an animation of the robot motion is shown and animated at the specified frame rate.
H = plot_vehicle(x,options) as above draws the robot and returns a handle.
plot_vehicle(x, 'handle', H) updates the pose x (1x3) of the previously drawn robot.
plot_vehicle(x, 'image', IMG) where IMG is an RGB image that is scaled and centered on the robot's position. The vertical axis of the image becomes the x-axi in the plot, ie. it is rotated. If you wish to specify the rotation then use
plot_vehicle(x, 'image', {IMG,R}) where R is the counterclockwise rotation angle in degrees.
'scale', S | draw vehicle with length S x maximum axis dimension (default 1/60) |
'size', S | draw vehicle with length S |
'fillcolor', F | the color of the circle's interior, MATLAB color spec |
'alpha', A | transparency of the filled circle: 0=transparent, 1=solid |
'box' | draw a box shape (default is triangle) |
'fps', F | animate at F frames per second (default 10) |
'image', I | use an image to represent the robot pose |
'retain' | when X (Nx3) then retain the robots, leaving a trail |
'model', M | animate an image of the vehicle. M is a structure with elements: image, alpha, rotation (deg), centre (pix), length (m). |
© 1990-2014 Peter Corke.