def ros_subscribe_cmd(topic, _id=None, _type=None):
    """
    create a rosbridge subscribe command object

    messages on subscribed topics will be sent like this:
    outgoing_msg = {"op": "publish", "topic": topic, "msg": message}
    see rosbridge_library capabilities/subscribe.py

    :param topic: the string name of the topic to subscribe to
    :param _id: optional id to identify subscription for later unsubscribe calls
    :param _type: ROS msg type as string

    not passed on:
    (optional) "throttle_rate": <int>,
    (optional) "queue_length": <int>,
    (optional) "fragment_size": <int>,
    (optional) "compression": <string>
    """
    command = {
        "op": "subscribe",
        "topic": topic
    }

    if _id:
        command["id"] = _id

    if _type:
        command["type"] = _type

    return command