NESTLab / 2122_MultiDroneIndoorSLAM

Code for 21/22 MQP and DRs on Multi Drone Indoor SLAM
0 stars 0 forks source link

Ros / ARGoS Sync #35

Open tylerferrara opened 2 years ago

tylerferrara commented 2 years ago

There are two problems at hand:

  1. Synchronization between the argos simulation time and ros time
    • Some modules have their own clocks, which need to all be incremented via argos time
  2. Odometer scaling
    • Robot pose isn't correctly estimated, causing mapping inconsistencies
    • this could be from some custom odometry math may be incorrect
    • Khephera measures (header file) may be incorrect or measured in different units
    • Proof: Encoder values for teleop control are not consistent between argos and ros
    • AKA: The argos robot thinks its moving at one rate, while the ros robot is in a different measure
    • Also, if the scale of our map is incorrect, we are not correctly estimating how the robot moves in its environment

Within Branch: SM_add_merge_service

nikopoulospet commented 2 years ago

To elaborate more on this. The root cause of the concern is the inability of robots to correctly build a map from Gmapping in rviz. This could be caused by a number of issues that Tyler mentioned above.

Find all the current Argos bridge info in the latest branch of SM_add_merge_service.

The issue: image

Some issue with the robot odometry transform is causing this problem.

Potential reasons:

tylerferrara commented 2 years ago

Currently taking a look at how we approach time synchronization. As mentioned in the ROS Wiki on Clocks, programs which use a computer's wall time will fall out of sync with the rest of the system. Specifically, failure to synchronize wall clocks causes discrepancies in temporal calculations used in tf.

In order for a ROS node to use simulation time according to the /clock topic, the /use_sim_time parameter must be set to true before the node is initialized. This can be done in a launchfile or from the command line.

We must also control this /clock topic. ROS docs call this a "Clock Server".

Clock Server is any node that publishes to the /clock topic, and there should never be more than one running in a single ROS network.

nikopoulospet commented 2 years ago

clock server is handled by an argos loop function. /use sim time is set in the roslaunch file named "test_argos.launch"

nikopoulospet commented 2 years ago

See the most recent work on Argos bridge, fixes odometer estimates, currently testing a single robot explore stack in Argos.

I am still concerned about the clock server method, seems like this is a hacky fix which won't work in the long run, a more long term solution is to let Argos run in sync with ros.

tylerferrara commented 2 years ago

Two Options: