Skip to content

Instantly share code, notes, and snippets.

@ibrahiminfinite
Last active August 26, 2023 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ibrahiminfinite/0f60fcf0717ca87263c72c0fcf6bd3ff to your computer and use it in GitHub Desktop.
Save ibrahiminfinite/0f60fcf0717ca87263c72c0fcf6bd3ff to your computer and use it in GitHub Desktop.
This document provides an overview of the improvements to MoveIt Servo as part of Google Summer of Code 2023.

Abstract


The current MoveIt Servo has enabled users to utilize reactive control. However, in its current implementation MoveIt Servo only provides a ROS interface to users. While the ROS interface is very versatile, it can also be a bottleneck for users who need harder real-time performance guarantees. There were also many aspects of the software design of the package itself that could be improved.

Project Goals


  1. Improved readability/ introspectability
  2. Extensibility
  3. Performance
  4. Support for end-effector pose as input
  5. Improved C++ Interface support
  6. Migrate MoveIt Servo to generate_parameter_library (strech goal)

Original proposal can be found here. The IK solver goal has been pushed back in favour of other enhancements.

Summary of changes


Related PRs:

Notes on design


Some design considerations were:

  • Adherence to OOP and SOLD principles
  • Methods that could be free functions should be free functions
  • Functions and methods should only have a single point of return

MoveIt Servo will consist of mainly two parts Servo and ServoNode, with Servo providing the C++ API and ServoNode wrapping over it to provide the ROS API.

Servo will provide a unified API to the user which can accept JointJog, Twist and Pose commands. This API will return as result, the required kinematic state of the robot joints necessary to follow the given command.

ServoNode will accept commands through ROS messages via ROS topics and publish the reulting kinematic state information as specified by the provided parameters.

Implementation notes


The first thing that was tackled as part of the improvement was the migration of MoveIt Servo to generate_parameter_library, it provides a very convenient and reliable method of using parameters in ROS2. The reason for choosing this as the first item is that MoveIt Servo has a lot of parameters and there was a significant amount of code within the existing implementation that was dedicated to handling the use of these parameters. Outsourcing the parameter handling infrastructure helped reduce the amount of code that needed to be dealt with.

Next was the refactoring of MoveIt Servo,

The commands were unified under a single API KinematicState getNextJointState(const ServoInput& command), through the use of std::variant. The processing logic for each command type was abstracted away into separate overloaded free function utilities.

The different parts of MoveIt Sevo now are :

  • Servo
  • ServoNode
  • CollisionMonitor
  • Common utilities
  • Command Utilities
  • Datatypes

A detailed explanation of how to use the new MoveIt Servo can be found here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment