Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

The fuse stack provides a general architecture for performing sensor fusion live on a robot. Some possible applications include state estimation, localization, mapping, and calibration.

License

NotificationsYou must be signed in to change notification settings

locusrobotics/fuse

Repository files navigation

The fuse stack provides a general architecture for performing sensor fusion live on a robot. Some possible applicationsinclude state estimation, localization, mapping, and calibration.

Overview

fuse is a ROS framework for performing sensor fusion using nonlinear least squares optimization techniques. Inparticular, fuse provides:

  • a plugin-based system for modeling sensor measurements
  • a similar plugin-based system for motion models
  • a plugin-based system for publishing optimized state values
  • an extensible state variable definition
  • a "contract" on how an optimizer will interact with the above components
  • and some common implementations to get everyone started

(unpresented) ROSCon 2018 Lightning Talkslides

Data flows through the system approximately like this:

  • A sensor model receives raw sensor data. The sensor model generates a constraint and sends it to the optimizer.
  • The optimizer receives the new sensor constraint. A request is sent to each configured motion model to generatea constraint between the previous state and the new state involved in the sensor constraint.
  • The motion model receives the request and generates the required constraints to connect the new state to thepreviously generated motion model chain. The motion model constraints are sent to the optimizer.
  • The optimizer adds the new sensor model and motion model constraints and variables to the graph andcomputes the optimal values for each state variable.
  • The optimal state values are sent to each configured publisher (as well as the sensor models and motion models).
  • The publishers receive the optimized state values and publish any derived quantities on ROS topics.
  • Repeat

It is important to note that much of this flow happens asynchronously in practice. Sensors are expected to operateindependently from each other, so each sensor will be sending constraints to the optimizer at its own frequency. Theoptimizer will cache the constraints and process them in small batches on some schedule. The publishers mayrequire considerable processing time, introducing a delay between the completion of the optimization cycle and thepublishing of data to the ROS topic.

fuse sequence diagram

Example

Let's consider a simple robotics example to illustrate this. Assume we have a typical indoor differential-drive robot.This robot has wheel encoders and a horizontal laser.

The first thing we must do is define our state variables. At a minimum, we want the robot pose at each timestamp.We model the pose using a 2D position and an orientation. Each 2D poseat a specific time gets a unique variablename. For ease of notation, let's call the pose variablesX1,X2,X3, etc. (In reality, each variable getsa UUID, but those are much harder to write down.) Each 2D pose is instantiated as aexample_robot::Pose2D which isderived from thefuse_core::Variable base class. (fuse ships with several basic variables, such as 2D and 3Dversions of position, orientation, and velocity variables, but you can derive your own variable types as you need them.)

Next we need to decide how to model our sensors. We can model the wheel encoders as providing an incrementalpose measurement. Given a starting pose,X1, and a wheel encoder delta,z, we predict the poseX2' using somemeasurement functionf.

X2' = f(X1, z)

The error term for our constraint is the difference between the predicted poseX2' and the actual poseX2

error = X2'^-1 * X2

whereX2'^-1 is the inverse of the poseX2'

We derive afuse_core::Constraint that implements that error function. Similarly, we perform scan-to-scan matchingusing out laser data and create an incremental pose constraint between consecutive scans.

In the simplest example, the sensors are synchronized, i.e. the laser and the wheel encoders are sampled at the sametime. This is enough to construct our firstfuse system. Below is the constraint graph generated from this firstsystem. The large circles represent state variables at a given time, while the small squares represent measurements.The graph connectivity indicates which variables are involved in what measurements.

fuse graph

The two sensor models are configured as plugins to an optimizer implementation. The optimizer performs the requiredcomputation to generate the optimal state variable values based on the provided sensor constraints. We will never beable to exactly satisfy both the wheel encoder constraints and the laserscan constraints. Instead we minimize the errorof all the constraints using nonlinear least squares optimization.

fuse optimizer

While ourfuse system is optimizing constraints from two different sensors, it is not yet publishing any data backout to ROS. In order to publish data to ROS, we derive afuse_core::Publisher class and add it to theoptimizer. Derived publishers have access to the optimized values of all state variables. The specific publisherimplementation determines what type of messages are published and at what frequency. For our example system,we would like visualize the current pose of the robot in RViz, so we create afuse publisher that finds the mostrecent pose and converts it into ageometry_msgs::PoseStamped message, then publishes the message to a topic.

fuse optimizer

We finally have something that is starting to be useful.

Adaptation #1: Asynchronous sensors

Typically the laser measurements and the wheel encoder measurements are not synchronized. The encoder measurements aresampled faster than the laser, and are sampled at different times using a different clock. If we do not do anythingdifferent in this situation, the constraint graph becomes disconnected.

fuse graph

This is where motion models come into play. A motion model differs from a sensor model in that constraints can begenerated between any two requested timestamps. Motion model constraints are generated upon request, not due to theirown internal clock. We use the motion model to connect the states introduced by the other sensor measurements. Wederive a class from thefuse_core::MotionModel base class and implement a differential drive kinematicconstraint for our robot.

fuse optimizer

The motion models are also configured as plugins to the optimizer. The optimizer requests motion models constraintsfrom the configured plugins whenever new states are created by the sensor models.

fuse graph

Adaptation #2: Full path publishing

Nothing about thefuse framework limits you to having a single publisher. What if you want to visualize the entirerobot trajectory, instead of just the most recent pose? Well, we can create a new derivedfuse_core::Publisher classthat publishes all of the robot poses using anav_msgs::Path message.

fuse optimizer

Adaptation #3: Changing kinematics

In your spare time, you also buildautonomous power wheels racers. But race carsdon't use differential drive; you need a different motion model. Easy enough. We simply derive a newfuse_core::MotionModel class that implements an Ackermann steering model. Everything else can be reused.

fuse optimizer

fuse graph

Adaptation #4: Online calibration

Over time you notice that the accuracy of the odometry measurements is decreasing. After some investigation you realizethat the soft rubber racing tires are wearing, decreasing the diameter of the wheels over time. It sure would be niceif the odometry system could compensate for that automatically. To do that, we derive a new variable type fromfuse_core::Variable that holds a single scalar value representing a wheel diameter at a specific point in time. Forease of notation, we refer to this new variable asD1, D2, ..., etc. We also need to derive a new wheel encoder sensormodel from thefuse_core::SensorModel base class. This new sensor model involves the previous pose and next pose asbefore, but it also involves the previous wheel diameter. Finally, we need afuse_core::MotionModel that describeshow the wheel diameter is expected to change over time. Maybe some sort of exponential decay? And for good measure, wederive a new publisher plugin fromfuse_core::Publisher that publishes the current wheel diameter. This allows us toplot how the wheel diameter changes over the length of the race.

fuse optimizer

fuse graph

Now our system estimates the wheel diameters at each time step as well as the robot's pose.

The Math

Internallyfuse uses Google'sCeres Solver to perform the nonlinear least squaresoptimization, which produces the optimal state variable values. I direct any interested parties to the Ceres Solver"Non-linear Least Squares" tutorial for an excellent primer on the coreconcepts and involved math.

Summary

The purpose offuse is to provide a framework for performing sensor fusion tasks, allowing common components to bereused between systems, while also allowing components to be customized for different use cases. The goal is to allowend users to concentrate on modeling the robot, sensor, system, etc. and spend less time wiring the differentsensor models together into runable code. And since all of the models are implemented as plugins, separate pluginlibraries can be shared or kept private at the discretion of their authors.

API Concepts

  • Variables
  • Constraints
  • Sensor Models -- coming soon
  • Motion Models -- coming soon
  • Publishers -- coming soon
  • Optimizers -- coming soon

About

The fuse stack provides a general architecture for performing sensor fusion live on a robot. Some possible applications include state estimation, localization, mapping, and calibration.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors16

Languages


[8]ページ先頭

©2009-2025 Movatter.jp