This resource demonstrates the interaction with algo node configurations in SENSR.
A node configuration has configs related to algo node setup. (e.g. username
, bin
...)
GET§
-
/[SENSR version]/settings/node/list§
Get the list of available config-ids and config data types of an algo node.
- Parameters
- Return code
- 200 OK
- List of the types that SENSR API supports natively
Example§
$ curl -X GET 'http://localhost:9080/[SENSR version]/settings/node/list' ** Respond ** [ { "uid": "String", "ip": "String", "master_ip": "String", "port": "String", "name": "String", "bin": "String", "rosbag_path": "String", "username": "String", "preset": "String", "enable_gpu: "Bool" } ]
-
/[SENSR version]/settings/node§
Get an actual config of the desired algo node
- Parameters
- node-uri : ID of algo node.
- Return code
- 200 OK
- 400 BAD REQ
Example§
$ curl -X GET 'http://localhost:9080/[SENSR version]/settings/node?node-uri=algo_0000' ** Respond ** { "uid": "algo_0000", "ip": "127.0.0.1", "master_ip" : "127.0.0.1", "port": "5055", "name": "algo", "bin": "", "rosbag_path": "/home/seoulrobotics/Downloads/data_out.bag", "username": "", "preset": "outdoor", "enable_gpu": false }
- Parameters
-
/[SENSR version]/settings/node-transform§
Get the transform (position and rotation) of the algo node
- Parameters
- node-uri : ID of algo node.
- Return code
- 200 OK
- 400 BAD REQ
Example§
$ curl -X GET 'http://localhost:9080/[SENSR version]/settings/node-transform?node-uri=algo_0000' ** Respond ** { "base_to_origin": { "tx": 0.0, "ty": 0.0 }, "sensor_to_base": { "tz": 0.0, "qw": 1.0, "qx": 0.0, "qy": 0.0, "qz": 0.0 } }
- Parameters
-
/[SENSR version]/settings/node-detection-range§
Get the detection range of the algo node
- Parameters
- node-uri : ID of algo node.
- Return code
- 200 OK
- 400 BAD REQ
Example§
$ curl -X GET 'http://localhost:9080/[SENSR version]/settings/node-detection-range?node-uri=algo_0000' ** Respond ** { "x_range": [ -50.0, 50.0 ], "y_range": [ -10.0, 50.0 ], "z_range": [ -1.5, 3.5 ] }
- Parameters
PUT§
-
/[SENSR version]/settings/node§
This command adds a new algo node to the project.
The command takes in the algo node data as can be seen in the example below. Please refer to the POST command section for details about the format of the data as it is almost identical. The only difference is that you can skip the "uid" here, since it will be ignored.
If this command was successful, the uid of the new algo node is returned.You should also call /commands/apply-change to save your changes. * Parameters * Return code * 200 OK * 400 BAD REQ
Example§
$ curl -X PUT 'http://localhost:9080/[SENSR version]/settings/node' --data '{ "ip": "192.168.0.100", "master_ip": "127.0.0.1", "port": "5055", "name": "localhost", "bin": "", "rosbag_path": "", "username": "", "preset": "outdoor", "enable_gpu": false }' ** Respond ** "algo_0001"
POST§
-
/settings/node§
Update the config of the algo node specified by the "uid"-field in the request body. Note that the IP address should be unique.
If you updaterosbag_path
through this API,rosbag_path
in each sensor config will be updated too. To avoid unsynced configuration, Please read the newrosbag_path
again through /settings/sensor.
You should also call /commands/apply-change to save your changes.- Parameters
- Return code
- 200 OK
- 400 BAD REQ
Example§
$ curl -X POST 'http://localhost:9080/[SENSR version]/settings/node' --data '{ "uid": "algo_0000", "ip": "127.0.0.1", "master_ip": "127.0.0.1", "name": "localhost", "bin": "", "rosbag_path": "", "username": "", "preset": "outdoor", "enable_gpu": false }' ** Respond ** 200 OK
-
/[SENSR version]/settings/node-transform§
Update the transform (position and rotation) of the algo node specified by the "uid"-parameter. Note that for the algo node the height should always be ground-level, so keep "tz" as zero. The fields "qw", "qx", "qy", and "qz" are the components of the quaternion rotation. The rotation of the algo node is also limited to the z-axis, so "qx" and "qy" should be kept as zero. Additionally the norm of the quaternion should be 1.0 for it to be considered valid.
You should also call /commands/apply-change to save your changes. * Parameters * node-uri : ID of algo node. * Return code * 200 OK * 400 BAD REQ
Example§
$ curl -X POST 'http://localhost:9080/[SENSR version]/settings/node-transform?node-uri=algo_0000'' --data '{ "base_to_origin": { "tx": 1.0, "ty": 2.0 }, "sensor_to_base": { "tz": 0.0, "qw": 1.0, "qx": 0.0, "qy": 0.0, "qz": 0.0 } }' ** Respond ** 200 OK
-
/[SENSR version]/settings/node-detection-range§
Update the detection range of the algo node specified by the "uid"-parameter.
You should also call /commands/apply-change to save your changes. * Parameters * node-uri : ID of algo node. * Return code * 200 OK * 400 BAD REQ
Example§
$ curl -X POST 'http://localhost:9080/[SENSR version]/settings/node-detection-range?node-uri=algo_0000'' --data '{ "x_range": [ -20.0, 10.0 ], "y_range": [ -10.0, 50.0 ], "z_range": [ -1.5, 3.5 ] }' ** Respond ** 200 OK