Slide 11
Slide 11 text
ଟ࣌ؒ͢ͳ͍ͩΖ͏͚Ͳ͜ΜͳΛͨ͠
w .POHPEC༻ͷϥΠϒϥϦͱͯ͠ɺNPOHPPTFΛར༻
w 5ZQFTDSJQUFTMJOUQSFUUJFSͷઃఆ ࠓͲ͖ͨΓલ͔Ͱ͕͢
w ωετͨ͠+TPOͷ4DIFNBఆٛؤுͬͨ ܕ࣮Ͱͳͯ͘μϛʔͰ͢
import mongoose from 'mongoose';
const Schema = mongoose.Schema;
const humanSchema = new Schema({
position: {
x: Schema.Types.Decimal128,
y: Schema.Types.Decimal128,
z: Schema.Types.Decimal128,
},
});
export const AtrSchema = new Schema({
topic: String,
body: {
info: {
time: {
secs: Number,
nano: Number,
},
robot_id: String,
seq: Number,
},
humans: [{ type: humanSchema }],
},
robot_id: String,
timestamp_msec: Schema.Types.Date,
humans: [{ type: humanSchema }],
});
w 4DIFNF5ZQFT%BUFʹಥͬࠐΉ࣌ʹNTFDͷਫ਼·Ͱ͔͠ରԠ͍ͯ͠ͳ͍ͷͰ
OBOPTFDΛ*OUʹͯ͠ಥͬࠐΜͩ
const timestampMsec = parseInt(
`${secs}${(nsecs / 1_000_000).toFixed().padStart(3, '0')}`,
);