# Linux for Robotics - robot\_statistics is not working

**URL:** <https://get-help.theconstruct.ai/t/linux-for-robotics-robot-statistics-is-not-working/41414>\
**Category:** Linux for Robotics\
**Tags:** error\
**Created:** [June 16, 2026, 12:22pm UTC](https://get-help.theconstruct.ai/t/linux-for-robotics-robot-statistics-is-not-working/41414 "2026-06-16T12:22:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![furkanyildiz2557](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/f/8baadc/32.png) [@furkanyildiz2557](https://get-help.theconstruct.ai/u/furkanyildiz2557)\
**Post date:** [June 16, 2026, 12:22pm UTC](https://get-help.theconstruct.ai/t/linux-for-robotics-robot-statistics-is-not-working/41414/1 "2026-06-16T12:22:20Z")

</div>

Obstacle avoider is working for me but Robot statistics is not working. Please see my code below,

```auto
#! /usr/bin/bash

# include the functions library
source ./robot_functions.bash

# robot statistics

# this is an infinite while loop - use ctrl+c to break
echo "Running Robot Statistics with Bash Script..."
echo "Press Ctrl+C to Terminate..."

# main while loop for naive obstacle avoider
echo " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
while :
do
  # print distance covered since start
  distance_covered=$(odom_distance)
  echo "Distance covered: $distance_covered"
  # print current direction of robot
  direction_robot=$(odom_direction)
  echo "Current Direction: $direction_robot"
  # print odom position x, y, z
  position_x=$(odom_position_x)
  position_y=$(odom_position_y)
  position_z=$(odom_position_z)
  echo "Odom position x,y,z $position_x, $position_y, $position_z"
  # print odom orientation r, p, y
  orientation_r=$(odom_orientation_r)
  orientation_p=$(odom_orientation_p)
  orientation_y=$(odom_orientation_y)
  echo "Orientation r,p,y $odom_orientation_r, $odom_orientation_p, $odom_orientation_y"
  # print imu angular velocity x, y, z
  # ...
  # print imu linear acceleration x, y, z
  # ...

  # print a divider line to show iteration is complete
  echo " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
done

# End of Code

```

---

<div class="post-metadata">

**Author:** ![girishkumar.kannan](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/girishkumar.kannan/32/6994_2.png) [@girishkumar.kannan](https://get-help.theconstruct.ai/u/girishkumar.kannan)\
**Post date:** [June 16, 2026, 1:08pm UTC](https://get-help.theconstruct.ai/t/linux-for-robotics-robot-statistics-is-not-working/41414/2 "2026-06-16T13:08:54Z")

</div>

Hi @furkanyildiz2557 ,

Welcome to this Community!

There is high chance that the `/odom` topic is not providing the data, which could be the main reason why the `robot_statistics` program is not working.  
If you have the simulation running, then try to run the following command:

```bash
ros2 topic list

```

The above command should enlist `/odom` as one of the topics.  
Then execute the following command on the same terminal:

```bash
ros2 topic echo /odom --once --full-length

```

If you get a bunch of data containing x, y and z positions of the robot along with x, y, z and w quaternion for robot orientation, then the `/odom` topic is working, and probably the `robot_statistics` program is not working as intended.

If either the `/odom` topic is not listed or if there is no data published on `/odom` topic, then the robot odometry is not working.

Please try the above commands and inform the results.

Regards,  
Girish

---

<div class="post-metadata">

**Author:** ![furkanyildiz2557](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/f/8baadc/32.png) [@furkanyildiz2557](https://get-help.theconstruct.ai/u/furkanyildiz2557)\
**Post date:** [June 17, 2026, 4:03pm UTC](https://get-help.theconstruct.ai/t/linux-for-robotics-robot-statistics-is-not-working/41414/3 "2026-06-17T16:03:54Z")

</div>

Thank you Girish for your comment!

Here are the results,

```auto
user:~/ros2_ws/src/linux_basics_project/linux_basics_project$ ros2 topic list
/clicked_point
/clock
/cmd_vel
/goal_pose
/imu
/initialpose
/joint_states
/odom
/parameter_events
/performance_metrics
/robot_description
/rosout
/scan
/tf
/tf_static

```

Also the second command,

```auto
user:~/ros2_ws/src/linux_basics_project/linux_basics_project$ ros2 topic echo /odom --once --full-length
header:
  stamp:
    sec: 378
    nanosec: 591000000
  frame_id: odom
child_frame_id: base_footprint
pose:
  pose:
    position:
      x: 0.8495579728723683
      y: 0.5080588787600072
      z: 0.008504622038884455
    orientation:
      x: 0.001277350481095016
      y: 0.001146300647024526
      z: -0.7513411555651985
      w: 0.6599117534371755
  covariance:
  - 1.0e-05
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 1.0e-05
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 1000000000000.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 1000000000000.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 1000000000000.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.001
twist:
  twist:
    linear:
      x: 0.00039511859924740904
      y: 2.9074025718229548e-06
      z: 0.0
    angular:
      x: 0.0
      y: 0.0
      z: -5.7317491025122296e-05
  covariance:
  - 1.0e-05
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 1.0e-05
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 1000000000000.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 1000000000000.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 1000000000000.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.0
  - 0.001
---

```

From this, I assume that my robot\_statistics is not working as i intended. How can I resolve this ?

Kindly,  
Furkan

---

<div class="post-metadata">

**Author:** ![girishkumar.kannan](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/girishkumar.kannan/32/6994_2.png) [@girishkumar.kannan](https://get-help.theconstruct.ai/u/girishkumar.kannan)\
**Post date:** [June 22, 2026, 8:20am UTC](https://get-help.theconstruct.ai/t/linux-for-robotics-robot-statistics-is-not-working/41414/4 "2026-06-22T08:20:35Z")

</div>

Hi @furkanyildiz2557 ,

Thanks for your reply.

I forgot to ask you one major question: Was the `robot_statistics` program not working on the simulation or on the real robot or on both?

I recently tested the provided `robot_statistics` program on the simulation and it worked quite well, without any issues. Although I did not get a chance to test it on the real robot as of writing this post.

Please let me know in which environment, was the `robot_statistics` program not working for you.

Regards,  
Girish

---

<div class="post-metadata">

**Author:** ![system](https://get-help.theconstruct.ai/uploads/default/original/2X/9/9d3ce8305cc0d0d9b6e07d15767a6f245c526f1b.jpeg) [@system](https://get-help.theconstruct.ai/u/system)\
**Post date:** [June 27, 2026, 8:21am UTC](https://get-help.theconstruct.ai/t/linux-for-robotics-robot-statistics-is-not-working/41414/5 "2026-06-27T08:21:15Z")

</div>

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
