Refactor from my_robot to raspbot-v2
This commit is contained in:
+3
-3
@@ -12,10 +12,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
WORKDIR /ws
|
||||
|
||||
# Copy the ROS package into the standard colcon src/ layout and build it
|
||||
COPY src/my_robot/ src/my_robot/
|
||||
COPY src/raspbot_v2/ src/raspbot_v2/
|
||||
|
||||
RUN source /opt/ros/${ROS_DISTRO}/setup.bash && \
|
||||
colcon build --packages-select my_robot
|
||||
colcon build --packages-select raspbot_v2
|
||||
|
||||
# ── Stage 2: runtime ──────────────────────────────────────────────────────────
|
||||
FROM ros:kilted-ros-core
|
||||
@@ -43,4 +43,4 @@ COPY docker-entrypoint.sh /docker-entrypoint.sh
|
||||
RUN chmod +x /docker-entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
CMD ["ros2", "launch", "my_robot", "robot.launch.py"]
|
||||
CMD ["ros2", "launch", "raspbot_v2", "robot.launch.py"]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# my_robot
|
||||
# raspbot_v2
|
||||
|
||||
ROS 2 package for the Yahboom Raspbot V2 platform — differential-drive motor control and pan/tilt camera orientation.
|
||||
|
||||
@@ -139,7 +139,7 @@ The [ansible/](ansible/) directory contains a playbook that handles the remainin
|
||||
The Raspberry Pi is `arm64`, so the image must be built for that platform. On an amd64 host use `docker buildx`:
|
||||
|
||||
```bash
|
||||
docker build --platform linux/arm64 -t my_robot:latest .
|
||||
docker build --platform linux/arm64 -t raspbot_v2:latest .
|
||||
```
|
||||
|
||||
`--load` exports the built image into the local Docker image store so it can be deployed with `docker save`.
|
||||
@@ -156,7 +156,7 @@ The build is split into two stages:
|
||||
Once the image is built, pipe it directly to the target over SSH — no intermediate file or registry needed:
|
||||
|
||||
```bash
|
||||
docker save my_robot:latest | ssh matt@raspbot-v2.local docker load
|
||||
docker save raspbot_v2:latest | ssh matt@raspbot-v2.local docker load
|
||||
```
|
||||
|
||||
Replace `matt` with the username configured in [ansible/inventory.ini](ansible/inventory.ini).
|
||||
@@ -172,7 +172,7 @@ docker run --rm \
|
||||
--network=host \
|
||||
--device /dev/i2c-1 \
|
||||
--env ROS_DOMAIN_ID=0 \
|
||||
my_robot:latest
|
||||
raspbot_v2:latest
|
||||
```
|
||||
|
||||
If your board exposes the controller on a different bus (check with `ls /dev/i2c-*` on the host), substitute the correct device node (e.g. `--device /dev/i2c-0`).
|
||||
@@ -186,8 +186,8 @@ docker run --rm \
|
||||
--network=host \
|
||||
--device /dev/i2c-1 \
|
||||
--env ROS_DOMAIN_ID=0 \
|
||||
my_robot:latest \
|
||||
ros2 launch my_robot robot.launch.py \
|
||||
raspbot_v2:latest \
|
||||
ros2 launch raspbot_v2 robot.launch.py \
|
||||
wheel_base:=0.25 max_speed:=0.8 tilt_center_deg:=45.0
|
||||
```
|
||||
|
||||
@@ -254,12 +254,12 @@ ros2 topic echo /joint_states
|
||||
├── Dockerfile # Two-stage production image
|
||||
├── docker-entrypoint.sh # Sources ROS overlays before exec
|
||||
├── src/
|
||||
│ └── my_robot/
|
||||
│ └── raspbot_v2/
|
||||
│ ├── package.xml # ROS package manifest
|
||||
│ ├── setup.py # ament_python build definition
|
||||
│ ├── launch/
|
||||
│ │ └── robot.launch.py # Starts both nodes together
|
||||
│ └── my_robot/
|
||||
│ └── raspbot_v2/
|
||||
│ ├── __init__.py
|
||||
│ ├── motor_controller_node.py # Differential-drive motor control
|
||||
│ └── camera_orientation_node.py # Pan/tilt servo control
|
||||
|
||||
@@ -21,7 +21,7 @@ def generate_launch_description():
|
||||
|
||||
# ── Nodes ─────────────────────────────────────────────────────────
|
||||
Node(
|
||||
package='my_robot',
|
||||
package='raspbot_v2',
|
||||
executable='motor_controller',
|
||||
name='motor_controller',
|
||||
parameters=[{
|
||||
@@ -32,7 +32,7 @@ def generate_launch_description():
|
||||
),
|
||||
|
||||
Node(
|
||||
package='my_robot',
|
||||
package='raspbot_v2',
|
||||
executable='camera_orientation',
|
||||
name='camera_orientation',
|
||||
parameters=[{
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0"?>
|
||||
<package format="3">
|
||||
<name>my_robot</name>
|
||||
<name>raspbot_v2</name>
|
||||
<version>0.0.1</version>
|
||||
<description>Four-wheel robot motor controller</description>
|
||||
<description>Yahboom Raspbot V2 motor and camera orientation controller</description>
|
||||
<maintainer email="you@example.com">Your Name</maintainer>
|
||||
<license>Apache-2.0</license>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[metadata]
|
||||
name = my_robot
|
||||
name = raspbot_v2
|
||||
version = 0.0.1
|
||||
|
||||
[options]
|
||||
@@ -8,6 +8,6 @@ install_requires =
|
||||
setuptools
|
||||
|
||||
[develop]
|
||||
script_dir=$base/lib/my_robot
|
||||
script_dir=$base/lib/raspbot_v2
|
||||
[install]
|
||||
install_scripts=$base/lib/my_robot
|
||||
install_scripts=$base/lib/raspbot_v2
|
||||
@@ -1,6 +1,6 @@
|
||||
from setuptools import setup
|
||||
|
||||
package_name = 'my_robot'
|
||||
package_name = 'raspbot_v2'
|
||||
|
||||
setup(
|
||||
name=package_name,
|
||||
@@ -15,8 +15,8 @@ setup(
|
||||
zip_safe=True,
|
||||
entry_points={
|
||||
'console_scripts': [
|
||||
'motor_controller = my_robot.motor_controller_node:main',
|
||||
'camera_orientation = my_robot.camera_orientation_node:main',
|
||||
'motor_controller = raspbot_v2.motor_controller_node:main',
|
||||
'camera_orientation = raspbot_v2.camera_orientation_node:main',
|
||||
],
|
||||
},
|
||||
)
|
||||
Reference in New Issue
Block a user