Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.
/ operator_node Public archive

Tools for mapping interface commands to operator signals.

License

Notifications You must be signed in to change notification settings

cmower/operator_node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

operator_node

The operator_node package provides tools for mapping raw interface commands to operator signals.

Nodes

joy_remap

Recieves joy messages from a joy_node and republishes at a given sampling frequency. Sometimes I have noticed the sampling frequency of a joy_node does not always match the observed frequency (the difference is typically fairly small but significant).

Parameters

  • ~hz (int, default: 100)

    Sampling frequency.

Subscribed topics

Published topics

  • joy_out (sensor_msgs/Joy)

    Raw signals from interface driver published at given sampling frequency.

operator_interface_logger

This node collects a log of the previous N operator signals and publishes this including timestamps as a flattened std_msgs/Float64MultiArray message. The window duration is given in time (seconds).

You can think of the log as being a (1+Nd)-by-N array that has been flattened by columns. N is the number of signals in the current buffer. Nd is the number of dimensions of the operator signal, and the 1 is for the time stamp.

Parameters

  • ~window_duration (float)

    The operator signals recieved within this window of time will be published on each topic.

Subscribed topics

Published topics

  • operator_node/window (std_msgs/Float64MultiArray)

    A list of operator signals recieved in the previous window of time. Note, a helper function in Python is provided named reconstruct_interface_log_msg, see example:

    import rospy
    import operator_node
    from std_msgs.msg import Float64MultiArray
    
    Nd = 2  # number of dims for operator signal
    
    def callback(msg):
        t, h = operator_node.parser.reconstruct_interface_log_msg(msg, Nd)
        print("-"*70)
        print(f"{t = }")
        print(f"{h = }")
    
    rospy.init_node('test')
    rospy.Subscriber('operator_node/window', Float64MultiArray, callback)
    rospy.spin()

isometric_node.py

Scale the interface axes but ensure isometric.

Parameters

  • ~config/axes_idx (list[int])

    Indicices of the axes to be used to generate operator signal.

  • ~config/scale (float, min: 0.0, max: inf, default: 1.0)

    Maximum operator signal magnitude.

  • ~start_on_init (bool, default: False)

    Start the subscriber on initialization. Otherwise use a service to toggle subscriber on/off.

Subscribed topics

Published topics

Services

scale_node.py

Simply scale each interface axes.

Parameters

  • ~config/axes_idx (list[int])

    Indicices of the axes to be used to generate operator signal.

  • ~config/scale (either: list[float], float, default: 1.0)

    Maximum operator signal magnitude along each dimension.

  • ~start_on_init (bool, default: False)

    Start the subscriber on initialization. Otherwise use a service to toggle subscriber on/off.

Subscribed topics

Published topics

Services

keyboard_to_joy.py

Map keyboard events to sensor_msgs/Joy messages.

Parameters

  • ~config (dict)

    Configuration file, see example in configs/.

  • ~hz (int, default: 100)

    Sampling frequency.

Subscribed topics

  • keyboard/keyup (keyboard/Key)

    Keyboard key-up events.

  • keyboard/keydown (keyboard/Key)

    Keyboard key-down events.

Published topics

About

Tools for mapping interface commands to operator signals.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published