Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Code extentions recommendations #37

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions .github/workflows/ros-docker-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ on:
workflow_dispatch:
inputs:
build_type:
description: "Is it a \"development\" or a \"stable\" release?"
description: 'Is it a "development" or a "stable" release?'
required: true
default: 'development'
default: "development"
type: choice
options:
- development
- stable
target_distro:
description: "In case of \"stable\" release specify the ROS distro of the existing docker image (eg. humble)"
description: 'In case of "stable" release specify the ROS distro of the existing docker image (eg. humble)'
type: string
default: "ardent"
target_release:
description: "In case of \"stable\" release specify the version of the existing docker image (eg. 1.0.12)"
description: 'In case of "stable" release specify the version of the existing docker image (eg. 1.0.12)'
type: string
default: "0.0.0"
target_date:
description: "In case of \"stable\" release specify the date of the existing docker image in format YYYYMMDD (eg. 20220124)"
description: 'In case of "stable" release specify the date of the existing docker image in format YYYYMMDD (eg. 20220124)'
type: string
default: "20131206"
repository_dispatch:
Expand All @@ -36,7 +36,6 @@ jobs:
strategy:
fail-fast: false
matrix:

include:
- dockerfile: Dockerfile.hardware
repo_name: ""
Expand All @@ -56,15 +55,14 @@ jobs:
ros_distro: "iron"

steps:

- name: Checkout
uses: actions/checkout@v2

- name: ${{ matrix.dockerfile }} | ${{ matrix.ros_distro }} | Build
uses: husarion-ci/[email protected]
with:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
main_branch_name: ros2
dockerfile: ${{ matrix.dockerfile }}
repo_name: ${{ matrix.repo_name }}
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/vulcanexus-docker-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ on:
workflow_dispatch:
inputs:
build_type:
description: "Is it a \"development\" or a \"stable\" release?"
description: 'Is it a "development" or a "stable" release?'
required: true
default: 'development'
default: "development"
type: choice
options:
- development
- stable
target_distro:
description: "In case of \"stable\" release specify the ROS distro of the existing docker image (eg. humble)"
description: 'In case of "stable" release specify the ROS distro of the existing docker image (eg. humble)'
type: string
default: "ardent"
target_release:
description: "In case of \"stable\" release specify the version of the existing docker image (eg. 1.0.12)"
description: 'In case of "stable" release specify the version of the existing docker image (eg. 1.0.12)'
type: string
default: "0.0.0"
target_date:
description: "In case of \"stable\" release specify the date of the existing docker image in format YYYYMMDD (eg. 20220124)"
description: 'In case of "stable" release specify the date of the existing docker image in format YYYYMMDD (eg. 20220124)'
type: string
default: "20131206"
repository_dispatch:
Expand All @@ -36,7 +36,6 @@ jobs:
strategy:
fail-fast: false
matrix:

include:
- dockerfile: Dockerfile.hardware
repo_name: ""
Expand All @@ -48,15 +47,14 @@ jobs:
ros_distro: "humble"

steps:

- name: Checkout
uses: actions/checkout@v2

- name: ${{ matrix.dockerfile }} | ${{ matrix.ros_distro }} | Build
uses: husarion-ci/[email protected]
with:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
main_branch_name: ros2
dockerfile: ${{ matrix.dockerfile }}
repo_name: ${{ matrix.repo_name }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rosbot_ros/
rosbot_ros/
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"redhat.vscode-yaml",
"shardulm94.trailing-spaces"
]
}
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"files.insertFinalNewline": true,
"files.associations": {
"*.yaml": "yaml"
}
}
2 changes: 1 addition & 1 deletion Dockerfile.simulation
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ RUN MYDISTRO=${PREFIX:-ros}; MYDISTRO=${MYDISTRO//-/} && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN echo $(cat /ros2_ws/src/rosbot_gazebo/package.xml | grep '<version>' | sed -r 's/.*<version>([0-9]+.[0-9]+.[0-9]+)<\/version>/\1/g') > /version.txt
RUN echo $(cat /ros2_ws/src/rosbot_gazebo/package.xml | grep '<version>' | sed -r 's/.*<version>([0-9]+.[0-9]+.[0-9]+)<\/version>/\1/g') > /version.txt
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ In *docker-compose.yaml* you have to change `device` passed to docker. For more
docker run \
--rm -it --privileged \
husarion/rosbot:humble \
print-serial-number.py
print-serial-number.py
```

## ROS node
Expand Down
2 changes: 1 addition & 1 deletion demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ and run inside `teleop_twist_keyboard` to drive the ROSbot
ros2 run teleop_twist_keyboard teleop_twist_keyboard
```

With keys `i`, `j`, `l`, `,` you can drive forward, counter clockwise, clockwise and backwards. If you are using macanum wheels (see `demo/.env` file) hold `Shift` key that way the ROSbot goes left and right with `j` and `l` keys instead rotates.
With keys `i`, `j`, `l`, `,` you can drive forward, counter clockwise, clockwise and backwards. If you are using macanum wheels (see `demo/.env` file) hold `Shift` key that way the ROSbot goes left and right with `j` and `l` keys instead rotates.
13 changes: 5 additions & 8 deletions demo/compose.simulation.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
x-net-config:
&net-config
x-net-config: &net-config
network_mode: host
ipc: host
env_file: net.env

x-gpu-config:
&gpu-config
x-gpu-config: &gpu-config
runtime: nvidia
environment:
- DISPLAY=${DISPLAY:?err}
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all

x-cpu-config:
&cpu-config
x-cpu-config: &cpu-config
environment:
- DISPLAY=${DISPLAY:?err}
- LIBGL_ALWAYS_SOFTWARE=1

services:
rosbot:
image: husarion/rosbot-gazebo:humble
<<: [ *net-config, *gpu-config]
<<: [*net-config, *gpu-config]
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- /dev:/dev
command: ros2 launch rosbot_gazebo simulation.launch.py mecanum:=${MECANUM:-False}
command: ros2 launch rosbot_gazebo simulation.launch.py mecanum:=${MECANUM:-False}
7 changes: 2 additions & 5 deletions demo/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
x-net-config:
&net-config
x-net-config: &net-config
network_mode: host
ipc: host
env_file: net.env

services:

rosbot:
image: husarion/rosbot:humble
<<: *net-config
environment:
- ROS_DOMAIN_ID
command: ros2 launch rosbot_bringup bringup.launch.py mecanum:=${MECANUM:-False}


micro-xrce-agent:
image: husarion/micro-xrce-agent:v2.4.1
<<: *net-config
devices:
- ${SERIAL_PORT:?err}
environment:
- XRCE_DOMAIN_ID_OVERRIDE=${ROS_DOMAIN_ID} # ***
- XRCE_DOMAIN_ID_OVERRIDE=${ROS_DOMAIN_ID} # ***
- SERIAL_PORT
command: MicroXRCEAgent serial -D $SERIAL_PORT serial -b 576000 # -v6
2 changes: 1 addition & 1 deletion demo/net.env
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ RMW_IMPLEMENTATION=rmw_cyclonedds_cpp

# 4. Cyclone DDS + VPN
# RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
# CYCLONEDDS_URI=file:///husarnet-cyclonedds.xml
# CYCLONEDDS_URI=file:///husarnet-cyclonedds.xml
2 changes: 1 addition & 1 deletion flash-firmware.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@ def main():


if __name__ == "__main__":
main()
main()
15 changes: 5 additions & 10 deletions print-serial-number.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ def hex_to_num(self, hex_str):
# Check if the hex string is valid
if not all(c in string.hexdigits for c in hex_str):
raise ValueError("Invalid hex string")

# Convert the hex string to bytes
try:
hex_bytes = bytes.fromhex(hex_str)
except ValueError:
raise ValueError("Invalid hex string")

# Compute the SHA-256 hash of the hex bytes
hash = hashlib.sha256(hex_bytes).hexdigest()

# Truncate the hash to 6 characters
hash = hash[:6]

# Return the hash as an ASCII string
return hash

Expand Down Expand Up @@ -103,7 +103,7 @@ def generate(self):
print()

# Close the serial port
ser.close()
ser.close()
return result


Expand All @@ -129,8 +129,3 @@ def main():

if __name__ == "__main__":
main()





4 changes: 2 additions & 2 deletions read_cpu_id/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ upload_protocol = stlink

monitor_speed = 460800

build_flags =
build_flags =
-D SERIAL_UART_INSTANCE=1
-D TARGET_STM32F4

debug_tool = stlink
debug_tool = stlink
2 changes: 0 additions & 2 deletions read_cpu_id/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,3 @@ void loop()
// Wait for a second before printing again
delay(1000);
}


2 changes: 1 addition & 1 deletion sync_with_rosbot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ sshpass -p "husarion" rsync -vRr ./ husarion@$1:/home/husarion/${PWD##*/}

while inotifywait -r -e modify,create,delete,move ./ ; do
sshpass -p "husarion" rsync -vRr ./ husarion@$1:/home/husarion/${PWD##*/}
done
done
Loading