No project description provided
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file artefacts_utils-0.3.8-py3-none-any.whl.
File metadata
- Download URL: artefacts_utils-0.3.8-py3-none-any.whl
- Upload date:
- Size: 12.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a68a46327e3e162e657a76e5d174b9dca31ff842140b23f732d374f274045362
|
|
| MD5 |
e88c4260a2c607f5a936176a1eef60dc
|
|
| BLAKE2b-256 |
312e9ef312bf279e821d79c901dc91c1f5aad289003ae1f1caca83c500a1466f
|