Skip to content
Agor Maxime edited this page Aug 11, 2017 · 14 revisions

Welcome to the crazyflie-osc wiki!

Here, you will find the OSC API documentation of the project.

Listening routes

Client Module

routes prefix : /client

  • /add HOST PORT

    • Asks the server to publish to a new OSC client.
    • HOST -> The IP address of the client.
    • PORT -> The port of the client.
  • /remove HOST PORT

    • Removes an OSC client precedently added on the server.
    • HOST -> The IP address of the client.
    • PORT -> The port of the client.

Crazyflie Module

routes prefix : /crazyflie

  • /{drone_id}/add RADIO_URI

    • Connect to a drone through 2.4GHz radio.
    • {drone_id} -> The ID of the drone to create. (Used later to access it)
    • RADIO_URI -> the radio URI of the drone.
  • /{drone_id}/remove

    • Disconnect and remove a drone.
    • {drone_id} -> The ID of the drone to delete.
  • /{drone_id}/goal X Y Z YAW

    • Sends a 3D waypoint to a drone.
    • {drone_id} -> The ID of the drone to control.
    • X Y Z -> The position, in meter, to go to.
    • YAW -> The YAW rotation to achieve, in degrees.
  • /{drone_id}/goal/stop

    • Stop sending goals to the drone.
    • {drone_id} -> The ID of the drone.
  • /{drones}/emergency

    • Sends an emergency signal to one/multiple drones. Cuts the engines and need a full restart (disconnect/reconnect) before working again
    • {drones} -> MULTIPLE (see path_arg appendix). Drones IDs to send emergencies to.
  • /{drones}/lps/{nodes}/update_pos

    • Refreshes the LPS nodes positions for one/multiple given drone(s)
    • Should not be useful
    • {drones} -> MULTIPLE (see path_arg appendix). Drones IDs to which we will refresh the LPS nodes positions.
    • {nodes} -> MULTIPLE (see path_arg appendix). Nodes IDs of which we refresh positions.

Lps Module

routes prefix : /lps

  • /set_node_number NODE_NUMBER

    • Set the number of LPS nodes in the current setup.
    • NODE_NUMBER -> The number of LPS nodes.
  • /{node_id}/set_position X Y Z

    • Set the position of a LPS node.
    • WARNING : Needs a connected drone.
    • {node_id} -> The ID of the LPS node of which we change the position. Starts at 0.
    • X Y Z -> The 3D position, in meters.
  • /{node_id}/reboot

    • Reboot a LPS node.
    • {node_id} -> The ID of the LPS node to reboot.

Log Module

routes prefix : /log

NOTE : See crazyflie2 documentation for logging.
NOTE : every {drones} is a multiple path argument. See path_arg appendix.
  • /{drones}/add LOG_NAME LOG_MILLIS_PERIOD

    • Add a log configuration to one/multiple drone(s).
    • {drones} -> The drone ID(s) of which we add the log config to.
    • LOG_NAME -> The name of the log config to add.
    • LOG_MILLIS_PERIOD -> The period (in milliseconds) of the logging configuration. Must be a multiple of 10.
  • /{drones}/{log_name}/add_variable VARIABLE_NAME VARIABLE_TYPE

    • Add a variable to the log configuration.
    • {drones} -> Drone ID(s).
    • {log_name} -> The log configuration name.
    • VARIABLE_NAME -> The name of the variable to add (Warning: full name. example: kalman.stateX).
    • VARIABLE_TYPE -> The type of the variable to add.
  • /{drones}/{log_name}/start

    • Start a log configuration.
    • {drones} -> Drone ID(s).
    • {log_name} -> The log configuration name.
  • /{drones}/send_toc

    • Request the LOG TOC (Table of Content) as a JSON string
    • {drones} -> Drone ID(s).
  • /{drones}/send_toc/{toc_group}

    • Request one group of the LOG TOC (Table of Content) as an array of (incomplete) variable name.
    • {drones} -> Drone ID(s).
    • {toc_group} -> The toc group to retreive.

Param Module

routes prefix : /param

NOTE : See crazyflie2 documentation for parameters.
NOTE : every {drones} is a multiple path argument. See path_arg appendix.
  • /{drones}/{param_group}/{param_name}/set VALUE

    • Set the value of a parameter
    • {drones} -> Drone ID(s) of which we send the parameters.
    • {param_group} -> The name of the group of the parameter.
    • {param_name} -> The name of the parameter.
    • VALUE -> The value to set the parameter to.
  • /{drones}/send_toc

    • Request the PARAM TOC (Table of Content) as a JSON string
    • {drones} -> Drone ID(s)
  • /{drones}/send_toc/{toc_variable}

    • Request one group of the PARAM TOC (Table of Content) as an array of (incomplete) variable name.
    • {drones} -> Drone ID(s)
    • {toc_group} -> The toc group to retrieve.
  • /{drones}/get_all_values

    • Request the server to send every param variables and their values.
    • {drones} -> Drone ID(s)

PATH_ARG APPENDIX

When a variable is given with theses characters surrounding it : { }, it is a path argument. In order to set it, change the path you send the message to. For example, with the path /test/{test_id}/hello, sending to /test/42/hello will set the test_id variable to 42.

Multiple path_arg arguments

Some path arguments are described as multiple. This means you can pass an array of values to it. Examples below, for the path /test/{multiple_arg_test_id}/bye :

  • Sending to /test/42/bye will set the multiple_arg_test_id variable to [42]
  • Sending to /test/42;5;3/bye will set the multiple_arg_test_id variable to [42, 5, 3]
  • Sending to /test/*/bye will set the multiple_arg_test_id variable to an array containing every possible correct values for this argument.

Publishing routes :

Every OSC client subscribed to the server will receive theses messages.

Crazyflie Module

routes prefix : /crazyflie

  • /{drone_id}/connection SUCCESS

    • Send this message on drone connection
    • SUCCESS -> Wether the connection succeeded or failed (boolean)
  • /{drone_id}/disconnection

    • Send this message on drone disconnection
    • No payload
  • /{drone_id}/link_quality QUALITY

    • Send the current link quality
    • QUALITY -> the quality of the radio link in percentage of ping successes. (float, 0-100)

Log Module

routes prefix : /log

Default publishes :

  • /{drone_id}/position X Y Z

    • Send the real position of the drone.
    • X Y Z -> Position in meters
  • /{drone_id}/rpy ROLL PITCH YAW

    • Send the real rotation of the drone as a Roll/Pitch/Yaw combination.
    • ROLL PITCH YAW -> Angles in degrees (float)
  • /{drone_id}/battery BATTERY_VOLTAGE

    • Send the current voltage of the battery. Can be used to get battery percentage left.
    • BATTERY_VOLTAGE -> Battery voltage, in Volts

Other publishes :

  • /{drone_id}/toc JSON_VALUE

    • Send the LOG TOC, if requested by a client.
    • JSON_VALUE -> The JSON representation of the TOC.
  • /{drone_id}/{toc_group} NAMES[]

    • Send the LOG TOC variable, if requested by a client.
    • NAMES[] -> Names of the variables in the group.
  • /{drone_id}/{log_name} VALUES[]

    • Send the content of a log configuration started by a client, at a given rate (period).
    • VALUES[] -> Values of the variables in the log configuration, in the given order.
  • /{drone_id}/{log_name}/{variable_name} VALUE

    • Send the content of a given variable in a log configuration started by a client, at a given rate (period).
    • VALUE -> The value of the given variable.

Param Module

routes prefix : /param

  • /{drone_id}/toc JSON_VALUE

    • Send the PARAM TOC, if requested by a client.
    • JSON_VALUE -> The JSON representation of the TOC.
  • /{drone_id}/{toc_group} NAMES[]

    • Send the PARAM TOC variable, if requested by a client.
    • NAMES[] -> Names of the variables in the group.
  • /{drone_id}/{param_group}/{param_name} VALUE

    • Send the new value of a parameter when it is changed
    • VALUE -> The new value of the given parameter