diff --git a/Makefile b/Makefile index a90d119..1d99bd8 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,12 @@ docker: @docker build --no-cache --tag go2py:latest . + +docker_install: + @cp deploy/scripts/go2py-hw-nodes.service /etc/systemd/system/ + @systemctl enable go2py-hw-nodes.service + @systemctl start go2py-hw-nodes.service + +docker_uninstall: + @systemctl disable go2py-hw-nodes.service + @systemctl stop go2py-hw-nodes.service + @rm /etc/systemd/system/go2py-hw-nodes.service \ No newline at end of file diff --git a/deploy/launch/hw.launch.py b/deploy/launch/hw.launch.py index 940de08..5267246 100644 --- a/deploy/launch/hw.launch.py +++ b/deploy/launch/hw.launch.py @@ -13,7 +13,7 @@ def generate_launch_description(): remappings=[('cloud_in', '/go2/lidar_points'), ('scan', '/go2/lidar_scans')], parameters=[{ - 'target_frame': 'go2/go2/hesai_lidar', + 'target_frame': 'go2/hesai_lidar', 'transform_tolerance': 0.01, 'min_height': 0.0, 'max_height': 1.0, diff --git a/deploy/scripts/go2py-hw-nodes.service b/deploy/scripts/go2py-hw-nodes.service new file mode 100644 index 0000000..fa9fc68 --- /dev/null +++ b/deploy/scripts/go2py-hw-nodes.service @@ -0,0 +1,13 @@ +[Unit] +Description=ROS2 device driver container +Requires=docker.service +After=docker.service + +[Service] +Restart=always +ExecStartPre=/usr/bin/docker rm -f go2py_docker || true +ExecStart=/bin/bash -c '/usr/bin/docker run --rm --name go2py_docker --privileged --network host -v /home/unitree/locomotion:/home/locomotion -v /dev/*:/dev/* -v /etc/localtime:/etc/localtime:ro --runtime nvidia go2py:latest' +ExecStop=/usr/bin/docker stop -t 2 go2py_docker + +[Install] +WantedBy=default.target \ No newline at end of file