$search
00001 package edu.tum.cs.ias.knowrob.utils.owl; 00002 00003 import java.util.ArrayList; 00004 import java.util.TreeSet; 00005 00006 import javax.vecmath.Matrix4d; 00007 import javax.vecmath.Quat4d; 00008 import javax.vecmath.Vector3d; 00009 00010 00017 public class MapObject implements Comparable<MapObject>{ 00018 00023 public String id; 00024 00028 public ArrayList<String> types; 00029 00033 public Vector3d dimensions; 00034 00038 public Matrix4d pose_matrix; 00039 00043 public TreeSet<MapObject> physicalParts; 00044 00045 00046 public MapObject () { 00047 00048 this.types = new ArrayList<String>(); 00049 00050 this.dimensions = new Vector3d(); 00051 this.pose_matrix = new Matrix4d(); 00052 this.pose_matrix.setIdentity(); 00053 00054 this.physicalParts = new TreeSet<MapObject>(); 00055 } 00056 00057 00058 public String getId() { 00059 return id; 00060 } 00061 00062 00063 public void setId(String id) { 00064 this.id = id; 00065 } 00066 00067 00068 public ArrayList<String> getTypes() { 00069 return types; 00070 } 00071 00072 00073 public void setTypes(ArrayList<String> types) { 00074 this.types = types; 00075 } 00076 00077 00078 public Vector3d getDimensions() { 00079 return dimensions; 00080 } 00081 00082 00083 public void setDimensions(Vector3d dimensions) { 00084 this.dimensions = dimensions; 00085 } 00086 00087 00088 public Matrix4d getPoseMatrix() { 00089 return pose_matrix; 00090 } 00091 00092 00093 public void setPoseMatrix(Matrix4d poseMatrix) { 00094 pose_matrix = poseMatrix; 00095 } 00096 00101 public Vector3d getPosition() { 00102 return new Vector3d(pose_matrix.m03, 00103 pose_matrix.m13, 00104 pose_matrix.m23); 00105 } 00106 00107 00111 public void setPosition(Vector3d position) { 00112 // pose_matrix.setIdentity(); 00113 pose_matrix.setM03(position.x); 00114 pose_matrix.setM13(position.y); 00115 pose_matrix.setM23(position.z); 00116 } 00117 00118 00119 00120 // interface for setting/getting quaternion pose 00121 public Quat4d getPoseQuat() { 00122 Quat4d res = new Quat4d(); 00123 res.set(this.pose_matrix); 00124 return res; 00125 } 00126 00127 public void setPoseQuat(Vector3d translation, Quat4d orientation, double scale) { 00128 pose_matrix = new Matrix4d(orientation, translation, scale); 00129 } 00130 00131 00132 @Override 00133 public int compareTo(MapObject o) { 00134 return (this.id.compareTo(o.id)); 00135 } 00136 00137 }