How to modify Husarion packages for local use

Hello dear reader,

There are actually two questions in one:

we have a RosbotXL with a Jetson Orin Nano on Jetpack6.1

I noticed that RosbotXL, when going over an obstacle, keeps incrementing its odometry as long as the wheels are spinning. I realised, looking at the EKF param file /rosbot_xl_bringup/config/ekf.yaml that the IMU is only considered for orientation yaw, but the accelerometer is not considered at all for ddx, ddy. For which reasons? Did the IMU decrease the odometry accuracy significantly? Could it not prevent odom incrementation when wheels are spinning without moving the robot?

The main question, if we wanted to change the code,
let say we have a Lidar that is not in the middle but on an elevated platform, or we want to modify the ekf.yaml.
Working on existing docker image is not ideal.
So we could either launch it locally or modify the docker to consider local file change. I found the dockers in rosbot-xl-docker. haven’t tried it as I wanted to check the changes locally first. But, locally the launch file we can find in compose.yaml:

ros2 launch rosbot_xl_bringup bringup.launch.py lidar_model:='slamtec_rplidar_s2' mecanum:='True' -d

works in the docker but not directly on the rosbot_xl due to:
[ERROR] [launch]: Caught exception in launch (see debug for traceback): executable '[<launch.substitutions.text_substitution.TextSubstitution object at 0xffffbb580730>]' not found on the PATH (using the -d to have full debug doesn’t help much, unfortunately)

How to run Husarion modified codes in the rosbotXL?
I probably missed a tutorial on how to modify the files locally (such as rosbot_xl_description XML or the EKf.yaml if I were to add sensors) and how to run them either on a docker or locally.
Would you mind providing insight on the matter?

Thanks a real bunch for your work and attention! The documentation found online is great.
Best regards

Hello @daria,
1. EKF
I don’t quite remember why the accelerometer wasn’t included. The reason could be the potential risk of non-zero accelerometer readings during idle. Although most likely the problem won’t occur, because the speed information is still included.

If you achieve any more interesting results, you can create a PR for rosbot_ros (rosbot_xl_ros - has been merged into one common repo and will no longer be supported).

2. Modify rosbot files
Snaps/Dockers are used to hold specific versions of the robot sold, not their modifications. If you want to make changes to the code, the easiest way is to build the repo locally. For changing the lidar location in rosbot_ros you can edit these files. These files are able to change position of specific robot components. Alternatively, you can edit the URDF.

Dear Rafal,

Thanks for the quick reply, I had no idea rosbot_Xl repo was outdated.
I will try to re-install the new repo locally instead and start from there; maybe the launch error will disappear. Thanks for the link to the autonomy.yaml file, I hadn’t noticed it, it is more convenient (and clean) to use than modifying the URDF.

I will let you know here if:

  • odometry varies while idle (indeed, the IMU has small variations in idle mode, however, since it’s an acceleration, I expect the double integration to smooth it out)
  • odometry does not increment against an obstacle (I expect it to increment a little due to the wheels, but I hope it would be reduced)

Best to you all, Thanks for your work

1 Like

It might be unrelated, but it’s better to leave a trace for anyone else meeting the same issue.
I cloned the repo :GitHub - husarion/rosbot_ros at humble
followed the instructions. However, without considering humble packages missing and to install manually, there was an authorisation issue while flashing.
I had to modify the local rules adding MODE="0666",GROUP="plugdev" to 0403:6015 Future Technology Devices International, Ltd Bridge(I2C/SPI/UART/FIFO)

cat /etc/udev/rules.d/10-local.rules 

ACTION=="add", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", MODE="0666",GROUP="plugdev", SYMLINK+="ttyUSBDB"
ACTION=="add", ATTRS{idVendor}=="10c4", SYMLINK+="ttyRPLIDAR"

because the flashing failed due to permission errors (as a side note, I had to slightly modify flash_firmware_usb.py to see the error, due to an Exception e had no stderr. )

Now that the system has been flashed, the robot works as with rosbot_xl, actually the startup is cleaner and easier to use since everything is launched at once (Note: I haven’t checked the sensors and parameters of the launch yet).

By just modifying IMU config in ekf.yaml:

imu0_config:
 [false, false, false, # X , Y , Z
  false, false, true, # roll , pitch ,yaw
   false, false, false, # dX , dY , dZ
  false, false, true, # droll , dpitch ,dyaw
  true, true, false] # ddX , ddY , ddZ
Column 1 Column 2 Column 3
NO IMU IMU
IDLE 5min 0.0m 0.073m
6sec43 against obstacle 2.347m 2.224m

The test setting was not really strict. So there might be an error of about 2cm and 2s in the measurements.

But with this preliminary test, well… using the IMU acceleration does reduce the distance travelled when against an obstacle, but the wheels have much more weight in the result. The trade-off of using IMU while considering the displacement while Idle… not really worth it in my opinion, even if we could improve it by playing with the covariance and such.

1 Like

Thanks for sharing the test results.
I see that it would be possible to reduce the certainties of the imu readings to:
static_covariance_linear_acceleration: [1.6e-4, 0.0, 0.0, 0.0, 1.6e-4, 0.0, 0.0, 0.0, 1.6e-4]

Because the covariance has been greatly overestimated.