Skip to content

janelia-ros/y_arena_odor_controller_ros

Repository files navigation

y_arena_odor_controller_ros

Repository Information

Author
Peter Polidoro
License
BSD

Odor controller software for the Turner Lab Y-Arena rig.

Setup

https://github.com/janelia-experimental-technology/y-arena

Build Container

cd y_arena_odor_controller_ros
docker stop $(docker ps -aq)
docker system prune -f
docker build -t y_arena_odor_controller:latest .

Run Docker Container

docker run -v /dev/arena:/dev/arena -it --restart unless-stopped \
       --device=/dev/ttyACM0 \
       --device=/dev/ttyACM1 \
       --device=/dev/ttyACM2 \
       --device=/dev/ttyACM3 \
       --device=/dev/ttyACM4 \
       --device=/dev/ttyACM5 \
       --device=/dev/ttyACM6 \
       --device=/dev/ttyACM7 \
       --device=/dev/ttyACM8 \
       --device=/dev/ttyACM9 \
       --device=/dev/ttyACM10 \
       --device=/dev/ttyACM11 \
       --device=/dev/ttyACM12 \
       --device=/dev/ttyACM13 \
       --device=/dev/ttyACM14 \
       --device=/dev/ttyACM15 \
       y_arena_odor_controller:latest \
       ros2 launch y_arena_odor_controller controller.launch.py

Find Running Container Name

docker ps

Run Bash Commands in Container

docker exec -it <container name> /bin/bash
source install/setup.bash
ros2 node list

Stop Docker Container

docker stop $(docker ps -aq)

Run Another Docker Container to Test ROS Interfaces

docker run --rm --net=host --pid=host -it y_arena_odor_controller:latest
ros2 topic pub --once /arena_odors y_arena_interfaces/msg/ArenaOdors "{arena: 0, odors: [0, 1, 2]}"
ros2 service call /get_arenas_available y_arena_interfaces/srv/GetArenas
ros2 run y_arena_odor_controller tester &
ros2 topic echo /arena_odors

Create Test Container for Development

cd y_arena_odor_controller_ros
docker system prune -f
docker create -it --name devel ros:dashing bash
docker start -i devel
mkdir -p /ws/src/y_arena_odor_controller_ros
exit
docker cp . devel:/ws/src/y_arena_odor_controller_ros
docker start -i devel
source /opt/ros/dashing/setup.bash
cd /ws
colcon build
source install/setup.bash

About

Odor controller software for the Turner Lab Y-Arena rig.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published