@@ -2,6 +2,7 @@ use dora_node_api::{DoraNode, Event, arrow::array::Float64Array, dora_core::conf
22
33pub fn main ( ) -> eyre:: Result < ( ) > {
44 let output_joints_speed = DataId :: from ( "joints_speed_cmd" . to_owned ( ) ) ;
5+ let output_odom = DataId :: from ( "odom" . to_owned ( ) ) ;
56
67 let ( mut node, mut events) = DoraNode :: init_from_env ( ) ?;
78
@@ -68,11 +69,22 @@ pub fn main() -> eyre::Result<()> {
6869 ) ;
6970 continue ;
7071 }
72+ let timestamp = values. value ( 2 ) ;
7173 diff_drive_odometry. update (
7274 values. value ( 0 ) , // left wheel position
7375 values. value ( 1 ) , // right wheel position
74- values . value ( 2 ) , // timestamp
76+ timestamp , // timestamp
7577 ) ;
78+
79+ let odom_array = Float64Array :: from ( vec ! [
80+ diff_drive_odometry. current_pose. x,
81+ diff_drive_odometry. current_pose. y,
82+ diff_drive_odometry. current_pose. heading,
83+ diff_drive_odometry. linear,
84+ diff_drive_odometry. angular,
85+ timestamp,
86+ ] ) ;
87+ node. send_output ( output_odom. clone ( ) , metadata. parameters , odom_array) ?;
7688 // Process wheel joint positions if needed
7789 }
7890 _ => {
0 commit comments