Update: ROS2 on GoPiGo3

Progress continues:

  • added odometry reset batch file to demonstrate publish to ros2_gopigo3_node service listener from command line (Update: 10/28/22)
  • Headless networking config of image looks promising - “v3 Basic ROS2 GoPiGo3” up for testing
  • "v4 Dev:
    • Running robot_state and joint_state publishers from URDF file as part of ros2_gopigo3_node package (GoPiGo3 takes its wheels when moving in the visualized “world” by rviz2 tool)
    • Building maps, saving maps, converting pgm maps to jpg format for convenience
    • Full Up Steady State Statistics:
      • CPU: ~25% Temp: 60degC (no where near throttling)
      • Memory: 600MB used of 1.8GB (no swap used)
      • Disk Used: 6GB of 30GB - seems to suggest 8GB minimum, 16GB recommended

Immediate Goals:

  • add features to teleop_gopigo3_key node:
    • “Pose Estimation From GoPiGo3” /odom topic subscription (x,y, heading)
    • map three keys to publish Servo center, left 45, right 45
    • add ultrasonic ranger reading subscriber to display current reading
    • add distance sensor reading subscriber to display distance sensor reading
    • add imu subscriber to display IMU heading reading and room temperature
    • add odometry reset key (reset x,y,heading to 0) (/odom/reset srv client)

Gaping Hole In Features

  • PiCam image topic publisher

 
 

WIBNIs:

  • add scan subscriber to teleop_gopigo3_key to display forward, backward, left, right distances

  • nav2 example with LIDAR (demonstrate localization? and obstacle avoidance)

    • drive forward 1 meter
    • turn 180
    • drive forward 1 meter
    • turn 180
  • Odom fusion of encoders with IMU for more accurate turns

  • Make ros2_gopigo3_node a “LifeCycle node”

  • Pass URDF file name as a launch parameter

  • Add IMU reset service to /imu_sensor node

  • Understand why ROS2 IMU heading is drifting quickly (~1deg / minute)
    but Euler Heading from “readIMU” command does not drift.

 
 

Frames Published By Robot State and Joint Nodes

 
The RQT Graph of nodes/publishers/subscribers

 
The wheels don’t get left behind now! (Robot State and Robot Joint Publishers at work)

Visualization shows GoPiGo3 estimated:

  • map
  • localization in map
  • ultrasonic ranger reading is approximately where the robot thinks wall exists confirms URDF info matches the robot physical measurement.
  • odometry error building up - robot started aligned with the white grid, so map walls should also be aligned with the grid, but odometry heading or localization heading errors or both are causing the robot to think the wall is no longer aligned with the grid, (but it was).
2 Likes

Wow - fantastic progress.
/K

2 Likes

What a can of worms?

Or better - what a bucket of baby rattlesnakes?

Why am I always finding out I’m the one bleeding at the proverbial bleeding edge?

2 Likes

Bleeding edge? Heck - I think you’re beyond that. I’m thinking of a metaphorical wing leading edge as it transitions past the sound barrier. That ringing in your ears you hear is from your bleeding edge sonic boom :slight_smile:

/K

2 Likes

They used to think a little bleeding was healthy, no?

I bled today but I think I’m going to survive this one. Party soon.

I tried video for linux, libcamera from apt, opencv, picamera2, gstreamer, and finally built a personal copy of libcamera and libcamera-apps from sources.

My Ubuntu 22.04 Server can now, finally, successfully snap a jpeg (in 6 seconds) using the libcamera-jpeg app.

I found an example ROS 2 “single frame” publisher that I hope can pub the jpeg. It won’t give remote video, but it should at least allow remote viewing at 5-10 frames a minute!

UPDATE!! “It’s alive!”

Of course that’s “Carl in the dark about what’s going on”

The ros2_libcamera_pub is publishing a new image about every 10-12 seconds.

Adding this image publishing node (with 1Mpx 1296x730 images…) to the running nodes:

$ ./list_running_nodes.sh
List running ROS2 nodes
ros2 node list
/gopigo3_node
/imu_sensor
/joint_state_publisher
/joy_node
/launch_ros_5506
/robot_state_publisher
/static_tf_pub_laser
/teleop_gopigo3_keyboard
/teleop_twist_joy_node
/ultrasonic_ranger
/ydlidar_ros2_driver_node
/slam_toolbox
/libcamera_jpg_pub

Ups the memory usage to 800GB memory,
and is banging the Pi4 CPU at 30-40% and 55degC

With the Pi4, there’s still some memory, cpu, and temperature headroom for onboard navigation. Don’t know what the situation would look like on a 1GB Pi3B+ though. My Pi3B+ burned out so someone else will have to test that when “image 4” comes out.

Is there anything more a ROS2 GoPiGo3 could want for?

Oh, oh … load just shot up to 100% for a little while, headed back down now, passing 75% on the way back down.

2 Likes

Was this supposed to be a link?

2 Likes

No, missing from the list of what was working in my ROS 2 GoPiGo3 features was the usual handling a camera sensor as a basic remote baby room monitor ( publishing video as a ROS message packet called a “topic” ).

When PiOS went 64-bit it left the PiCamera without a working driver. Eventually they introduced “Legacy Camera” while they got their act together to support it the way other Linux distros were.

Traditional Linux distros were in transition themselves in both the audio stack, and the Video for Linux stack which made the change on the Raspberry Pi even more difficult.

The PiOS eventually published new “libcamera” based replacements for the Raspbian raspistill and raspivid command line applications, and the user community scrambled to figure out how to update the heavily relied on PiCamera Python bindings. The Pi Foundation called libcamera-still and libcamera-vid “demo applications” for developers to understand how to write applications for the Pi using the new 64-bit stack.

The GoPiGo3 software development/maintenance was turned upside down.

The OpenCV on Raspberry Pi was thrown to the dogs for a while with all their RPi example programs no longer working.

The ROS community was in the midst of a transition from ROS 1 on 32-bit to ROS2 on 64-bit operating systems, so not only were they completely rewriting how to do ROS things they could not offer how to support video cameras either PiCamera or USB web cameras on the Raspberry Pi.

The “certified” release of Ubuntu for Raspberry Pi has been a big deal, bigger than most Raspberry Pi users understood, but as this little educational computer has grown into a basis for commercial products every change has become more complicated and more critical to get right.

ROS 2 recently moved from Ubuntu 20.04 to Ubuntu 22.04, and with the Raspberry Pi release of a certified Ubuntu version, the Raspberry Pi joined the Ubuntu “Tier 1 Platforms” and the ROS 2 Tier 1 platforms. The means that if you can managed to put Ubuntu 20.04 or 22.04 on your Raspberry Pi, installing ROS 2 on Raspberry PI is as simple as sudo apt install ros-humble-base.

The GoPiGo3 doesn’t need ROS, and doesn’t need a general purpose computing operating system. I have felt that the ROS community needs the GoPiGo3. People around the world are “discovering ROS” and needing an educational platform. The ROS community has been big on simulation, and for a long time the TurtleBot was the primary hardware embodiment of an educational platform for mobile robots. TurtleBot has been evolving and going up in price, leaving an opportunity for the $300 ROS GoPiGo3 to play in making robotics education fun and more affordable. That “opportunity”, amidst OS changes and the GoPiGo3 product maturity (limited investor enthusiasm) as well as some souring of investors on the hype of robotics, did not have any takers.

Back when the “Hands On ROS with GoPiGo3” book came out I hoped we would see more ROS learners appear here on the GoPiGo3. I think out of the whole world, there were less than 10 ROS GoPiGo3 robots created, so I have to remind myself that the “opportunity” might be a total phantom.

In my usual curiosity, I wanted to prove it possible to make a self-contained ROS2 GoPiGo3. Publishing video turned out to be beyond my abilities, but my sequence of /Image topic publisher will enable learning basic off-board image processing on a budget for the audience of zero.

Eventually the stock ROS 2 v4l2_camera_node will work with Ubuntu 22.04 - Video-For-Linux2 - libcamera - Raspberry PI - PiCamera stack and I have included that node in my image already.

Two years ago, ROSbot Dave did not have a remote image capability. Today he does - sort of.

2 Likes

Agree - the current platforms are very pricy. OK for some universities maybe, but out of range for high schools and a lot of state colleges.

Also agree. That’s what brought me to the GoPiGo3, and I had posted in the hopes of sharing my experiences with other new users - but those new users never materialized. You and @jimrh were already well established. I’ve certainly enjoyed it here, but not in the way I expected.

I will give the ROS2 stack a go on my 3B+ based GoPiGo3 once I know it’s working OK in base state.
/K

2 Likes

Progress continues:

  • added ip_feedback service (announces WiFi IP address at boot) (Update 10/31/22)
  • added 10 frames per minute PiCamera /Image topic publisher (Update 10/30/22)
  • added odometry reset batch file to demonstrate publish to ros2_gopigo3_node service listener from command line
  • Headless networking config of image looks promising - “v3 Basic ROS2 GoPiGo3” up for testing
  • "v4 Dev:
    • Running robot_state and joint_state publishers from URDF file as part of ros2_gopigo3_node package (GoPiGo3 takes its wheels when moving in the visualized “world” by rviz2 tool)
    • Building maps, saving maps, converting pgm maps to jpg format for convenience
    • Full Up Steady State Statistics:
      • CPU: ~35% Temp: 60degC (no where near throttling)
      • Memory: 700MB used of 1.8GB (no swap used)
      • Disk Used: 6GB of 30GB - seems to suggest 8GB minimum, 16GB recommended

Immediate Goals:

  • Dev GoPiGo3 Minimal URDF and Test Finmark URDF for the ROS2 GoPiGo3 and LIDAR nodes
  • add features to teleop_gopigo3_key node:
    • “Pose Estimation From GoPiGo3” /odom topic subscription (x,y, heading)
    • map three keys to publish Servo center, left 45, right 45
    • add ultrasonic ranger reading subscriber to display current reading
    • add distance sensor reading subscriber to display distance sensor reading
    • add imu subscriber to display IMU heading reading and room temperature
    • add odometry reset key (reset x,y,heading to 0) (/odom/reset srv client)

WIBNIs:

  • add scan subscriber to teleop_gopigo3_key to display forward, backward, left, right distances
  • nav2 example with LIDAR (demonstrate localization? and obstacle avoidance)
    • drive forward 1 meter
    • turn 180
    • drive forward 1 meter
    • turn 180
  • Odom fusion of encoders with IMU for more accurate turns
  • Make ros2_gopigo3_node a “LifeCycle node”
  • Pass URDF file name as a launch parameter
  • Add IMU reset service to /imu_sensor node (actually might be there I haven’t looked recently)
  • Understand why ROS2 IMU heading is drifting quickly (~1deg / minute)
    but Euler Heading from “readIMU” command does not drift.
2 Likes

Progress continues:

Finmark URDF (not the real one but it works with the coming image)

 

Dave URDF

 

gpgMin URDF - Basic GoPiGo3 (with or without LIDAR )

  • URDF files for dave, finmark, and gpgMin (Update 11-01-2022)
  • added ip_feedback service (announces WiFi IP address at boot
  • added 10 frames per minute PiCamera /Image topic publisher
  • added odometry reset batch file to demonstrate publish to ros2_gopigo3_node service listener from command line
  • Headless networking config of image looks promising - “v3 Basic ROS2 GoPiGo3” up for testing
  • "v4 Dev:
    • Running robot_state and joint_state publishers from URDF file as part of ros2_gopigo3_node package (GoPiGo3 takes its wheels when moving in the visualized “world” by rviz2 tool)
    • Building maps, saving maps, converting pgm maps to jpg format for convenience
    • Full Up Steady State Statistics:
      • CPU: ~35% Temp: 60degC (no where near throttling)
      • Memory: 700MB used of 1.8GB (no swap used)
      • Disk Used: 6GB of 30GB - seems to suggest 8GB minimum, 16GB recommended

Immediate Goals:

  • Document everything for release
  • Check it all in to github

WIBNIs:

  • add features to teleop_gopigo3_key node:

    • “Pose Estimation From GoPiGo3” /odom topic subscription (x,y, heading)
    • map three keys to publish Servo center, left 45, right 45
    • add ultrasonic ranger reading subscriber to display current reading
    • add distance sensor reading subscriber to display distance sensor reading
    • add imu subscriber to display IMU heading reading and room temperature
    • add odometry reset key (reset x,y,heading to 0) (/odom/reset srv client)
  • add scan subscriber to teleop_gopigo3_key to display forward, backward, left, right distances

  • nav2 example with LIDAR (demonstrate localization? and obstacle avoidance)

    • drive forward 1 meter
    • turn 180
    • drive forward 1 meter
    • turn 180
  • Odom fusion of encoders with IMU for more accurate turns

  • Make ros2_gopigo3_node a “LifeCycle node”

  • Pass URDF file name as a launch parameter

  • Add IMU reset service to /imu_sensor node (actually might be there I haven’t looked recently)

  • Understand why ROS2 IMU heading is drifting quickly (~1deg / minute)
    but Euler Heading from “readIMU” command does not drift.

2 Likes

Progress continues (11-03-22):

  • Testing first v4 shrunk image started
  • Work around found to eliminate shutdown errors in all the ROS2 GoPiGo3 code
    (The code I wrote. One last shutdown error from joint_state_publisher I can’t figure out.)
  • URDF files for dave, finmark, and gpgMin
  • added ip_feedback service (announces WiFi IP address at boot
  • added 10 frames per minute PiCamera /Image topic publisher
  • added odometry reset batch file to demonstrate publish to ros2_gopigo3_node service listener from command line
  • Headless networking config of image looks promising - “v3 Basic ROS2 GoPiGo3” up for testing
  • "v4 Dev:
    • Running robot_state and joint_state publishers from URDF file as part of ros2_gopigo3_node package (GoPiGo3 takes its wheels when moving in the visualized “world” by rviz2 tool)
    • Building maps, saving maps, converting pgm maps to jpg format for convenience
    • Full Up Steady State Statistics:
      • CPU: ~35% Temp: 60degC (no where near throttling)
      • Memory: 700MB used of 1.8GB (no swap used)
      • Disk Used: 6GB of 30GB - seems to suggest 8GB minimum, 16GB recommended

Immediate Goals:

  • Document everything for release
  • Check it all in to github

WIBNIs:

  • add features to teleop_gopigo3_key node:
    • “Pose Estimation From GoPiGo3” /odom topic subscription (x,y, heading)
    • map three keys to publish Servo center, left 45, right 45
    • add ultrasonic ranger reading subscriber to display current reading
    • add distance sensor reading subscriber to display distance sensor reading
    • add imu subscriber to display IMU heading reading and room temperature
    • add odometry reset key (reset x,y,heading to 0) (/odom/reset srv client)
  • add scan subscriber to teleop_gopigo3_key to display forward, backward, left, right distances
  • nav2 example with LIDAR (demonstrate localization? and obstacle avoidance)
    • drive forward 1 meter
    • turn 180
    • drive forward 1 meter
    • turn 180
  • Odom fusion of encoders with IMU for more accurate turns
  • Make ros2_gopigo3_node a “LifeCycle node”
  • Pass URDF file name as a launch parameter
  • Add IMU reset service to /imu_sensor node (actually might be there I haven’t looked recently)
  • Understand why ROS2 IMU heading is drifting quickly (~1deg / minute)
    but Euler Heading from “readIMU” command does not drift.
2 Likes

Wow - a lot of progress!
/K

1 Like

Probably will put v4 up tonight. It looks good for the tests I have put to it.

Does finmark have a speaker? It really helps to hear the wifi address on the first boot.

I have the install and first tests/first look at ROS2 GoPiGo3 almost ready, but need to take a nap now. I only got 4 hours sleep last night.

I’ll work on documentation for the next month probably.

No, not right now.

Holy $#!+ - take care of yourself

I’m hoping to test on Finmark tonight (v3) - we’ll see if it runs on the RPi 3B+.
I did dig out a Raspberry Pi 4 I had forgotten I had. It’s only 2GB though. I tried looking through old posts, but can’t find what memory size Dave has. I might try to swap it out though to give it a try. I’ve got notifications on for Adafruit and Sparkfun for an RPi4 with more memory; who knows when/if I’ll be able to grab one. There are some 8GB models on Amazon, but I refuse to pay scalpers the premium they’re asking.
/K

Dave has a Pi4B 2GB and full up seems to use 800MB to 900MB, but on the v3 image the usage without mapping and the camera was only 500MB to 600MB.

Finmark should be ok with the Pi3B+ - I am very much interested to see that test since the GoPiGo3 robots (use to) ship with the Pi3B+.

The V4 start_robot_gpgMin.sh which is a basic GoPiGo3 with no LIDAR, no added sensors, with the run_teleop_gopigo3_keyboard.sh only uses 500MB so I think it will run just fine on the Pi3B+:

********** ROS2 GoPiGo3 MONITOR ******************************
Thursday 11/03/22
 17:59:20 up 6 min,  3 users,  load average: 0.49, 0.44, 0.22
temp=44.8'C
frequency(48)=1300324224
throttled=0x0
               total        used        free      shared  buff/cache   available
Mem:           1.8Gi       308Mi       1.2Gi        10Mi       300Mi       1.3Gi
Swap:             0B          0B          0B
GoPiGo3 Battery Voltage: 11.3 volts
1 Like