Skip to content

OST23 SW

Link to module repo: OST23 SW


Overview

The software to steer one or several of these wheels comprises two blocks: a receive block and a send block. The receive block handles the messages coming from the drives of the wheel modules and outputs a twist message for further processing by a rover. On the other hand, a rover will transmit steering commands via twist messages to the send block. The send block itself will transmit the necessary commands to the drives of the wheel modules.

Receive Block

This block includes a couple of other blocks. CANopenReceive handles the communication from the drives of the wheels. Each wheel has an electrical drive for turning and for driving. All drives send a PDO with angle or velocity information, respectively. The illustration below shows a rover with two wheels.

ReceiveBlock

The two velocities from wheel 1 and wheel 2 are scaled by CANopenReceive to output velocities in m/s and are packed into common vector with the aid of a multiplexer.

The two turn angles from both wheels must be handled separately because these drives can have offsets in order to set the zero point. Velocity and angle information is then fed into a Kinematic block which generates and outputs a general twist signal.

Use

A Receive block has a template parameter to configure the number of wheels it handles. When constructing such a block you have to pass

  • an instance of a CANopen object
  • a configuration object describing the individual wheels

Send Block

This block includes a couple of other blocks. Twist, velocity and angle information is fed into an Inverse Kinematic block which generates and outputs velocity and angle signals. The velocity vector is unpacked into two separate signals by a demultiplexer. The turn angles for both wheels must be handled separately because these drives can have offsets in order to set the zero point. CANopenSend transmits the velocity and angle information to the drives of the wheels. Each wheel has an electrical drive for turning and for driving. All drives receive a PDO with angle or velocity information, respectively. The illustration below shows a rover with two wheels.

SendBlock

The two velocities to wheel 1 and wheel 2 are scaled by CANopenSend to output velocities in m/s.

Use

A Send block has a template parameter to configure the number of wheels it handles. When constructing such a block you have to pass

  • an instance of a CANopen object
  • a configuration object describing the individual wheels

Sequences

Three sequences allow to configure the wheels

  • Configure: initializes the drives for CANopen operation, sets RPDO and TPDO transfers
  • Enable: enables the drives and brings them into operational state
  • Disable: brings the drives into pre-operational mode and disables them

Configuration

A configuration file is given as following

Click to expand
{
"driveModules": {
    "interface": "CAN",
    "canSocket": "can0",
    "turn_canId": 33,
    "drive_canId": 34,
    "turn_transmission": 1,
    "turn_inverted": false,
    "turn_EncCountOffset": 0,
    "turn_EncCountResolution": 131072,
    "turn_Range": [
        -2.35619449,
        2.35619449
    ],
    "turn_maxVelCount": 41721,
    "drive_transmission": 78.75,
    "drive_inverted": false,
    "drive_EncCountResolution": 0,
    "drive_maxVelCount": 0,
    "wheelDiameter": 0.596,
    "tfBase": {
        "name": "driveModuleBase0",
        "parent": "robotRef",
        "trans": [
            0.40,
            -0.44,
            0.0
        ],
        "rotRPY": [
            0.0,
            0.0,
            0.0
        ]
    },
    "tfAxis": {
        "name": "driveModuleAxis0",
        "parent": "driveModuleBase0",
        "trans": [
            0.0,
            0.0,
            -0.0
        ],
        "rotRPY": [
            0.0,
            0.0,
            0.0
        ]
    }
}
}

Each wheel has two drives with transmission and encoder settings according to the electrical and mechanical setup. The CAN identifiers together with the settings for the transformation matrix is given with any initial values. These nodes will later be overridden by the rover settings where the wheels are used.

TF Tree

The tf tree when using ROS can be extracted from the configuration above and looks like

flowchart TD
    A([Wheel Module <br> Reference Position]) --> R[robot] 
    C([Wheel <br> Axis Position]) --> A 

Scripts

You can find two scripts for setting the CAN interface 0 up and down.