Update Dockerfile and package naming
This commit is contained in:
parent
21e1b84e7a
commit
be93645b4d
@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "ft_analytics",
|
"name": "ft_analytics",
|
||||||
"image": "ft_analytics:latest",
|
"image": "ft_analytics:latest",
|
||||||
"workspaceFolder": "/workspaces/can_viewer",
|
"workspaceFolder": "/workspaces/ft_analytics",
|
||||||
"runArgs": [
|
"runArgs": [
|
||||||
"--net=host",
|
"--network=host",
|
||||||
"--privileged"
|
"--privileged"
|
||||||
],
|
],
|
||||||
"settings": {},
|
"settings": {},
|
||||||
|
@ -3,7 +3,7 @@ FROM ubuntu:24.04
|
|||||||
ENV PIP_BREAK_SYSTEM_PACKAGES=1 \
|
ENV PIP_BREAK_SYSTEM_PACKAGES=1 \
|
||||||
SHELL=/bin/bash
|
SHELL=/bin/bash
|
||||||
|
|
||||||
ARG USERNAME=can_viewer
|
ARG USERNAME=ft_analytics
|
||||||
ARG USER_UID=1000
|
ARG USER_UID=1000
|
||||||
ARG USER_GID=${USER_UID}
|
ARG USER_GID=${USER_UID}
|
||||||
|
|
||||||
@ -18,34 +18,41 @@ RUN if id -u "${USER_UID}" >/dev/null 2>&1; then \
|
|||||||
&& chmod 0440 /etc/sudoers.d/${USERNAME}
|
&& chmod 0440 /etc/sudoers.d/${USERNAME}
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends \
|
&& apt-get install -y --no-install-recommends curl gnupg lsb-release ca-certificates
|
||||||
python3-pip \
|
|
||||||
nano \
|
|
||||||
iproute2 \
|
|
||||||
can-utils \
|
|
||||||
lsb-release \
|
|
||||||
curl \
|
|
||||||
gnupg \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
RUN pip3 install --no-cache-dir python-can cantools python3-rosdep
|
|
||||||
|
|
||||||
RUN echo "deb [signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list \
|
RUN echo "deb [signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list \
|
||||||
&& curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key | gpg --dearmor -o /usr/share/keyrings/ros-archive-keyring.gpg \
|
&& curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key | gpg --dearmor -o /usr/share/keyrings/ros-archive-keyring.gpg
|
||||||
&& apt-get update \
|
|
||||||
&& apt-get install -y --no-install-recommends ros-jazzy-ros-core python3-colcon-common-extensions \
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
ros-jazzy-ros-core \
|
||||||
|
python3-colcon-common-extensions \
|
||||||
|
python3-pip \
|
||||||
|
nano \
|
||||||
|
iproute2 \
|
||||||
|
can-utils \
|
||||||
|
python3-rosdep \
|
||||||
|
build-essential \
|
||||||
|
cmake \
|
||||||
|
kmod \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN echo "source /opt/ros/jazzy/setup.bash" >> /home/${USERNAME}/.bashrc \
|
RUN pip3 install --no-cache-dir --upgrade --break-system-package \
|
||||||
&& echo "source /workspaces/can_viewer/install/setup.bash" >> /home/${USERNAME}/.bashrc
|
python-can cantools
|
||||||
|
|
||||||
|
RUN echo "source /opt/ros/jazzy/setup.bash" >> /home/${USERNAME}/.bashrc \
|
||||||
|
&& echo "source /workspaces/ft_analytics/install/setup.bash" >> /home/${USERNAME}/.bashrc
|
||||||
|
|
||||||
|
WORKDIR /workspaces/ft_analytics
|
||||||
|
|
||||||
|
RUN mkdir -p /workspaces/ft_analytics/ros2_ws/src
|
||||||
|
|
||||||
WORKDIR /workspaces/can_viewer
|
|
||||||
COPY --chown=${USERNAME}:${USERNAME} ros2_ws/src ros2_ws/src
|
COPY --chown=${USERNAME}:${USERNAME} ros2_ws/src ros2_ws/src
|
||||||
|
|
||||||
#RUN rosdep update \
|
RUN rosdep init \
|
||||||
# && rosdep install -r --rosdistro jazzy \
|
&& apt-get update \
|
||||||
# --from-paths ros2_ws/src --ignore-src -y
|
&& rosdep update \
|
||||||
|
&& rosdep install -r --rosdistro jazzy --from-paths ros2_ws/src --ignore-src -y
|
||||||
|
|
||||||
USER ${USERNAME}
|
USER ${USERNAME}
|
||||||
|
|
||||||
CMD ["/bin/bash"]
|
CMD ["/bin/bash"]
|
||||||
|
4
launch.bash
Normal file
4
launch.bash
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
ros2 run ft_analytics can_viewer_node foxglove_bridge foxglove_bridge \
|
||||||
|
--ros-args -p send_buffer_limit:=1000000000
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
cmake_minimum_required(VERSION 3.8)
|
cmake_minimum_required(VERSION 3.8)
|
||||||
project(ft_can_viewer)
|
project(ft_analytics)
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
|
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
|
||||||
add_compile_options(-Wall -Wextra)
|
add_compile_options(-Wall -Wextra)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||||
<package format="3">
|
<package format="3">
|
||||||
<name>ft_can_viewer</name>
|
<name>ft_analytics</name>
|
||||||
<version>0.1.0</version>
|
<version>0.1.0</version>
|
||||||
<description>CAN - ROS2 Publisher für Foxglove mit Transceiver-Lib</description>
|
<description>CAN - ROS2 Publisher für Foxglove mit Transceiver-Lib</description>
|
||||||
<maintainer email="elias.rosendahl@fasttube.com">Elias</maintainer>
|
<maintainer email="elias.rosendahl@fasttube.com">Elias</maintainer>
|
||||||
|
@ -2,12 +2,13 @@
|
|||||||
#include <rclcpp/rclcpp.hpp>
|
#include <rclcpp/rclcpp.hpp>
|
||||||
#include <std_msgs/msg/float64.hpp>
|
#include <std_msgs/msg/float64.hpp>
|
||||||
#include <std_msgs/msg/bool.hpp>
|
#include <std_msgs/msg/bool.hpp>
|
||||||
#include </workspaces/can_viewer/ros2_ws/src/ft_can_transceiver_lib/include/ft_can_transceiver_lib/transceiver.h>
|
#include </workspaces/ft_analytics/ros2_ws/src/ft_can_transceiver_lib/include/ft_can_transceiver_lib/transceiver.h>
|
||||||
#include </workspaces/can_viewer/ros2_ws/src/ft_can_transceiver_lib/include/ft_can_transceiver_lib/can1.h>
|
#include </workspaces/ft_analytics/ros2_ws/src/ft_can_transceiver_lib/include/ft_can_transceiver_lib/can1.h>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
class CanViewerNode : public rclcpp::Node {
|
class CanViewerNode : public rclcpp::Node {
|
||||||
public:
|
public:
|
||||||
CanViewerNode() : Node("can_viewer_node"), transceiver_("vcan0", {}) {
|
CanViewerNode() : Node("can_viewer_node"), transceiver_("slcan0", {{}}) {
|
||||||
allow_torque_pub_ = this->create_publisher<std_msgs::msg::Bool>("can/telemetrie/allow_torque", 10);
|
allow_torque_pub_ = this->create_publisher<std_msgs::msg::Bool>("can/telemetrie/allow_torque", 10);
|
||||||
brake_ok_pub_ = this->create_publisher<std_msgs::msg::Bool>("can/telemetrie/brake_ok", 10);
|
brake_ok_pub_ = this->create_publisher<std_msgs::msg::Bool>("can/telemetrie/brake_ok", 10);
|
||||||
torque_limit_pub_ = this->create_publisher<std_msgs::msg::Float64>("can/telemetrie/torque_limit", 10);
|
torque_limit_pub_ = this->create_publisher<std_msgs::msg::Float64>("can/telemetrie/torque_limit", 10);
|
||||||
|
9
ros2_ws/src/ft_can_viewer/test/can_gen.sh
Executable file
9
ros2_ws/src/ft_can_viewer/test/can_gen.sh
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# 1 000 Frames, 10 ms Abstand
|
||||||
|
for i in $(seq 0 999); do
|
||||||
|
# Zufallswert 0-255 → zweistelliges Hex
|
||||||
|
v=$(printf '%02X' $((RANDOM % 256)))
|
||||||
|
# Byte0 Byte1 Byte2=[$v] rest = 0
|
||||||
|
cansend slcan0 720#0001${v}00000000
|
||||||
|
sleep 0.01
|
||||||
|
done
|
Loading…
x
Reference in New Issue
Block a user