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

Device connections #294

Merged
merged 3 commits into from
Jan 10, 2024
Merged
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
11 changes: 9 additions & 2 deletions docker/Dockerfile.roscube
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ RUN source /home/${USERNAME}/mambaforge/bin/activate; \
RUN rm -rf ./src

# tell ROS to use Cyclone DDS
# ENV RMW_IMPLEMENTATION="rmw_cyclonedds_cpp"
# ENV CYCLONEDDS_URI=file:///home/developer/driverless_ws/src/machines/roscube_machine/cyclonedds.xml
ENV RMW_IMPLEMENTATION="rmw_cyclonedds_cpp"
ENV CYCLONEDDS_URI=file:///home/developer/driverless_ws/src/machines/roscube_machine/cyclonedds.xml
ENV ROS_DOMAIN_ID=69

RUN echo 'export RMW_IMPLEMENTATION="rmw_cyclonedds_cpp"' >> /home/$USERNAME/.bashrc
RUN echo 'export CYCLONEDDS_URI=file:///home/developer/driverless_ws/src/machines/roscube_machine/cyclonedds.xml' >> /home/$USERNAME/.bashrc
RUN echo 'export ROS_DOMAIN_ID=69' >> /home/$USERNAME/.bashrc

COPY ./docker/conda_entrypoint.sh /conda_entrypoint.sh
ENTRYPOINT ["/conda_entrypoint.sh"]
3 changes: 3 additions & 0 deletions docker/conda_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ conda activate driverless_env
# source workspace setup if available
test -f "/home/developer/driverless_ws/install/setup.bash" && source "/home/developer/driverless_ws/install/setup.bash"

ros2 daemon stop
ros2 daemon start

exec "$@"
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ x-volumes-roscube: &volumes-roscube
- ../../datasets:/home/${USERNAME}/driverless_ws/datasets
# /dev/shm is mounted in so that two foxy containers can talk to each other when using net=host, see: https://answers.ros.org/question/370595/ros2-foxy-nodes-cant-communicate-through-docker-container-border/
- /dev/shm:/dev/shm
- /dev/ttyUSB-sbg:/dev/ttyUSB-sbg
- /dev/sbg:/dev/sbg

x-volumes-jetson: &volumes-jetson
volumes:
Expand Down
9 changes: 8 additions & 1 deletion src/hardware/sensors/config/ellipse_D.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@
# Uart configuration
uartConf:
# Port Name
portName: "/dev/ttyUSB-sbg"
### IMPORTANT REQUIRES UDEV RULE TO BE CREATED
# sudo touch /etc/udev/rules.d/99-sbg_example.rules
# sudo nano /etc/udev/rules.d/99-sbg_example.rules
# SUBSYSTEMS=="usb", ATTRS{product}=="USB-RS232 Cable", ATTRS{serial}=="SERIAL_HERE", SYMLINK+="sbg"
### Find serial by walking through ttyUSBs
# udevadm info --name=/dev/ttyUSB0 --attribute-walk # replace with ttyUSB1... etc until you find the RS232

portName: "/dev/sbg"

# Baude rate (4800 ,9600 ,19200 ,38400 ,115200 [default],230400 ,460800 ,921600)
baudRate: 115200
Expand Down
6 changes: 4 additions & 2 deletions src/machines/jetson_machine/cyclonedds.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CycloneDDS xmlns="https://cdds.io/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://cdds.io/config https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/master/etc/cyclonedds.xsd">
<Domain id="any">
<Domain id="69">
<General>
<NetworkInterfaceAddress>wlan0</NetworkInterfaceAddress>
<Interfaces>
<NetworkInterface address='192.168.3.3'/>
</Interfaces>
<AllowMulticast>spdp</AllowMulticast>
</General>
</Domain>
Expand Down
6 changes: 4 additions & 2 deletions src/machines/roscube_machine/cyclonedds.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CycloneDDS xmlns="https://cdds.io/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://cdds.io/config https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/master/etc/cyclonedds.xsd">
<Domain id="any">
<Domain id="69">
<General>
<NetworkInterfaceAddress>enp4s0</NetworkInterfaceAddress>
<Interfaces>
<NetworkInterface address='192.168.3.2'/>
</Interfaces>
<AllowMulticast>spdp</AllowMulticast>
</General>
</Domain>
Expand Down
Loading