Skip to content

Commit 0fff466

Browse files
authored
Merge branch 'main' into feature/supertone_tts
2 parents 516993c + c143e7e commit 0fff466

11 files changed

Lines changed: 116 additions & 10 deletions

.rsyncignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ src/bitbots_misc/bitbots_parameter_blackboard/config/game_settings.yaml
1717
*.idea
1818
*.pyc
1919
*.vscode
20+
*.devcontainer
2021

2122
__pycache__
2223

pixi.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,17 @@ pyamdgpuinfo = ">=2.1.7, <3"
229229
[feature.ros.activation.env]
230230
ROS_AUTOMATIC_DISCOVERY_RANGE = "LOCALHOST"
231231
RCUTILS_COLORIZED_OUTPUT = "1"
232+
RCUTILS_CONSOLE_OUTPUT_FORMAT="[{severity}] [{name}]: {message} ({function_name}() at {file_name}:{line_number})"
232233
RMW_IMPLEMENTATION = "rmw_cyclonedds_cpp"
233234
COLCON_LOG_LEVEL = "30"
234235
PYTHONWARNINGS="ignore:::setuptools.command.install,ignore:::setuptools.command.easy_install,ignore:::pkg_resources,ignore:easy_install command is deprecated,ignore:setup.py install is deprecated"
235236
WEBOTS_HOME = "$CONDA_PREFIX/share/webots"
236237

237238
[feature.ros.activation]
238-
scripts = ["install/setup.sh"]
239+
scripts = [
240+
"install/setup.sh",
241+
"scripts/ros.plugin.sh",
242+
]
239243

240244
[environments]
241245
default = ["ros", "format"] # Full development environment (excluding robot-only deps)

scripts/deploy/deploy_robots.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ def _parse_arguments(self) -> argparse.Namespace:
118118
parser.add_argument(
119119
"-w",
120120
"--workspace",
121-
default=".",
122-
help="Path to the workspace directory to deploy to. Defaults to the current directory.",
121+
default="~/bitbots_main",
122+
help="Path to the workspace directory to deploy to. Defaults to 'bitbots_main' in $HOME dir.",
123123
)
124124
parser.add_argument("--skip-local-repo-check", action="store_true", help="Skip the local repository check.")
125125

scripts/ros.plugin.sh

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
### Aliases and functions for ROS 2 and colcon usage.
2+
3+
rid() {
4+
export ROS_DOMAIN_ID="$1"
5+
echo "ROS_DOMAIN_ID set to $ROS_DOMAIN_ID"
6+
}
7+
8+
# Create a function to update the argcomplete and generate the completion
9+
# scripts so that tab completion works within `pixi shell` environments.
10+
update_argcompletes() {
11+
local tools=(
12+
ros2
13+
colcon
14+
)
15+
16+
if [[ -n "${CONDA_PREFIX:-}" ]]; then
17+
local completions_path="$CONDA_PREFIX/share/zsh/site-functions"
18+
19+
if ! [[ -d "$completions_path" ]]; then
20+
mkdir -p "$completions_path"
21+
fi
22+
23+
for tool in "${tools[@]}"; do
24+
if type "$tool" &> /dev/null; then
25+
local _completion="$(register-python-argcomplete "$tool")"
26+
27+
if ! [[ -f "$completions_path/_$tool" ]]; then
28+
echo "_completion" > "$completions_path/_$tool"
29+
fi
30+
fi
31+
done
32+
fi
33+
}
34+
35+
setup_alises() {
36+
# check if we are in subdir of $ROS_WORKSPACE and switch to it otherwise
37+
alias cdc='[[ "$PWD" = "$ROS_WORKSPACE"* ]] || cd "$ROS_WORKSPACE"'
38+
39+
alias psh='cdc && pixi shell'
40+
41+
# ros aliases
42+
alias ros2='cdc && pixi run ros2'
43+
alias rr='ros2 run'
44+
alias rl='ros2 launch'
45+
46+
alias rte='ros2 topic echo'
47+
alias rtl='ros2 topic list'
48+
alias rth='ros2 topic hz'
49+
alias rtp='ros2 topic pub'
50+
51+
alias rpl='ros2 param list'
52+
alias rpg='ros2 param get'
53+
54+
# colcon aliases
55+
alias colcon='cdc && pixi run colcon'
56+
alias cba='cdc && pixi run build'
57+
alias cbs='cba --packages-select'
58+
alias cb='cba --packages-up-to'
59+
60+
alias ct='pixi run test'
61+
alias cts='ct --packages-select'
62+
63+
alias cca='pixi run clean'
64+
65+
# deploy_robots tool aliases
66+
alias dp='pixi run deploy --sync --build --print-bit-bot'
67+
alias dpfull='dp --install --configure'
68+
alias dpclean='dp --clean'
69+
alias dplo='dp --skip-local-repo-check'
70+
71+
# Overwrite some aliases in pixi shell to allow for tab completion
72+
# by directly using ros2/colcon instead of the pixi tasks
73+
if [[ "$(ps -o comm= -p "$PPID")" == "pixi" ]]; then
74+
alias cdc='cd $PIXI_PROJECT_ROOT'
75+
76+
# ros aliases
77+
unalias ros2
78+
alias rr='ros2 run'
79+
alias rl='ros2 launch'
80+
81+
alias rte='ros2 topic echo'
82+
alias rtl='ros2 topic list'
83+
alias rth='ros2 topic hz'
84+
alias rtp='ros2 topic pub'
85+
86+
alias rpl='ros2 param list'
87+
alias rpg='ros2 param get'
88+
89+
# colcon aliases
90+
unalias colcon
91+
alias cba='cdc && colcon build --symlink-install --cmake-args -G "Unix Makefiles" --continue-on-error'
92+
alias cbs='cba --packages-select'
93+
alias cb='cba --packages-up-to'
94+
95+
alias ct='cdc && colcon test --event-handlers console_direct+ --return-code-on-test-failure'
96+
alias cts='ct --packages-select'
97+
fi
98+
}
99+
100+
update_argcompletes
101+
setup_alises

src/bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/bitfoot_hardware_interface.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef BITBOTS_ROS_CONTROL_INCLUDE_BITBOTS_ROS_CONTROL_BITFOOT_HARDWARE_INTERFACE_H_
22
#define BITBOTS_ROS_CONTROL_INCLUDE_BITBOTS_ROS_CONTROL_BITFOOT_HARDWARE_INTERFACE_H_
33

4-
#include <dynamixel_driver.h>
4+
#include <dynamixel_workbench_toolbox/dynamixel_driver.h>
55

66
#include <bitbots_msgs/msg/foot_pressure.hpp>
77
#include <bitbots_ros_control/hardware_interface.hpp>

src/bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/button_hardware_interface.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef BITBOTS_ROS_CONTROL_INCLUDE_BITBOTS_ROS_CONTROL_BUTTON_HARDWARE_INTERFACE_H_
22
#define BITBOTS_ROS_CONTROL_INCLUDE_BITBOTS_ROS_CONTROL_BUTTON_HARDWARE_INTERFACE_H_
33

4-
#include <dynamixel_driver.h>
4+
#include <dynamixel_workbench_toolbox/dynamixel_driver.h>
55

66
#include <bitbots_msgs/msg/buttons.hpp>
77
#include <bitbots_ros_control/hardware_interface.hpp>

src/bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/core_hardware_interface.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef BITBOTS_ROS_CONTROL_INCLUDE_BITBOTS_ROS_CONTROL_CORE_HARDWARE_INTERFACE_H_
22
#define BITBOTS_ROS_CONTROL_INCLUDE_BITBOTS_ROS_CONTROL_CORE_HARDWARE_INTERFACE_H_
33

4-
#include <dynamixel_driver.h>
4+
#include <dynamixel_workbench_toolbox/dynamixel_driver.h>
55

66
#include <bitbots_ros_control/hardware_interface.hpp>
77
#include <bitbots_ros_control/utils.hpp>

src/bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/dynamixel_servo_hardware_interface.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef BITBOTS_ROS_CONTROL_INCLUDE_BITBOTS_ROS_CONTROL_DYNAMIXEL_SERVO_HARDWARE_INTERFACE_H_
22
#define BITBOTS_ROS_CONTROL_INCLUDE_BITBOTS_ROS_CONTROL_DYNAMIXEL_SERVO_HARDWARE_INTERFACE_H_
33

4-
#include <dynamixel_driver.h>
4+
#include <dynamixel_workbench_toolbox/dynamixel_driver.h>
55

66
#include <bitbots_msgs/msg/joint_command.hpp>
77
#include <bitbots_msgs/msg/joint_torque.hpp>

src/bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/imu_hardware_interface.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef BITBOTS_ROS_CONTROL_INCLUDE_BITBOTS_ROS_CONTROL_IMU_HARDWARE_INTERFACE_H_
22
#define BITBOTS_ROS_CONTROL_INCLUDE_BITBOTS_ROS_CONTROL_IMU_HARDWARE_INTERFACE_H_
33

4-
#include <dynamixel_driver.h>
4+
#include <dynamixel_workbench_toolbox/dynamixel_driver.h>
55

66
#include <bitbots_msgs/srv/accelerometer_calibration.hpp>
77
#include <bitbots_msgs/srv/complementary_filter_params.hpp>

src/bitbots_lowlevel/bitbots_ros_control/include/bitbots_ros_control/leds_hardware_interface.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef BITBOTS_ROS_CONTROL_INCLUDE_BITBOTS_ROS_CONTROL_LEDS_HARDWARE_INTERFACE_H_
22
#define BITBOTS_ROS_CONTROL_INCLUDE_BITBOTS_ROS_CONTROL_LEDS_HARDWARE_INTERFACE_H_
33

4-
#include <dynamixel_driver.h>
4+
#include <dynamixel_workbench_toolbox/dynamixel_driver.h>
55

66
#include <bitbots_msgs/srv/leds.hpp>
77
#include <bitbots_ros_control/hardware_interface.hpp>

0 commit comments

Comments
 (0)