Artefacts Utilities
This package is designed to be used together with the Artefacts CLI and contains a number of utlity functions to assist when testing robotic applications, as well as with paramerterization. In particular, may of these functions are designed to be used with Ros, rosbag, and Gazebo.
This package can be used without the Artefacts CLI, and indeed without Artefacts itself, though there will be some limitations, which will be noted in this readme.
The utilities have been divided into the following categories:
Rosbag
from artefacts_utils.rosbag import (
get_bag_recorder,
extract_video_from_rosbag,
convert_to_webm,
extract_image
)
get_bag_recorder(topic_names, use_sim_time=False) -> bag_recorder, rosbag_filepath
- Creates a rosbag2 recorder for a given list of topic names, returns the node and the filepath
extract_video(rosbag_filepath, topic_name, output_filepath, fps=20)
- Create an mp4 video from the provided rosbag.
convert_to_webm(video_name)
- Converts a given video to the webm format.
extract_image(flag, rosbag_filepath, camera_topic)
Takes and saves the final image from the rosbag to an output directory (typicall output). Primarily used for uploading to the Artefacts Dashboard
Gazebo
from artefacts_utils.gazebo import (
get_sim_objects,
get_model_location,
kill_gazebo,
get_camera_bridge
)
get_sim_objects(world_file) -> objects, object_positions
Get the included objects names and poses in the simulation. Returns a list of dicts in this format (objects):
{
"name": "green_apple"
"pose": "0.20 0 1.0 0 0 0"
}
as well as a dict in this format (object_positions):
{
"green_apple": "0.20 0 1.0 0 0 0",
}
get_model_location(model_name) -> x, y, z
- Gets the location of a given model. Returns its xyz in that order
kill_gazebo()
- Does exactly that
get_camera_bridge(topic_name, condition=None) -> camera_bridge (Node)
- Creates a gazebo ros2 topic bridge for a given camera topic. Returns the camera_bridge Node.
Config
from artefacts_utils.config import get_artefacts_param(param_type, param_name) -> parameter
get_artefacts_param(param_type, param_name) -> parameter
- Gets the value of a provided parameter either from the
artefacts.yamlfile, or ascenario_params.yamlfile if artefacts is not being used (e.g when usinglaunch_testorros2 run)
Charts
from artefacts_utils.charts import make_chart
make_chart(rosbag_filepath, topic, sub_topic, field_name, field_unit=None, output_dir="output")
- Plots data of a given field (y) against time (x) and saves in html format. Primarily for visualization on the artefacts dashboard
Metadata
Release files for artefacts-utils 0.3.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| artefacts_utils-0.3.8-py3-none-any.whl | Python 3 | none | any | Details |
Release files / artefacts_utils-0.3.8-py3-none-any.whl
| Download URL | artefacts_utils-0.3.8-py3-none-any.whl |
|---|---|
| Size | 12.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a68a46327e3e162e657a76e5d174b9dca31ff842140b23f732d374f274045362
|
|
BLAKE2b-256 checksum How to use checksums |
312e9ef312bf279e821d79c901dc91c1f5aad289003ae1f1caca83c500a1466f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.11
|