Skip to content

ROS package for Anki Vector home robot

License

Notifications You must be signed in to change notification settings

jmc359/vector_ros

 
 

Repository files navigation

vector_ros

This repository contains an unofficial ROS package for Anki Vector. This package is essentially a wrapping of core Vector functions from Vector Python SDK as ROS topics, services and actions(full list below). THe original repository is that we forked from is here

Setup

Requirements

Virtual Environment

It's highly recommended to use a virtual environment in order to run Python 3 properly on ROS. Follow the instructions:

  1. Clone this repository
git clone https://github.com/betab0t/vector_ros
  1. Install virtualenv
# Get virtualenv package
sudo apt update
sudo apt install python3-dev python3-pip
sudo pip3 install -U virtualenv

# Verify installation
python3 --version
pip3 --version
virtualenv --version

# Make python3 virtual environment
cd vector_ros
virtualenv --system-site-packages -p python3 envs/venv
source envs/venv/bin/activate  # sh, bash, ksh, or zsh
pip install --upgrade pip
pip list  # show packages installed within the virtual environment
deactivate  # don't exit until you're done running code
  1. Install Vector SDK

Follow the instructions listed here. Make sure to use your Anki Developer username and password

Topics

  • /vector/camera (sensor_msgs/Image)

Vector camera feed.

  • /lwheel_ticks (std_msgs/Int32)

Cumulative encoder ticks of the left wheel. used by diff_drive package.

  • /rwheel_ticks (std_msgs/Int32)

Cumulative encoder ticks of the right wheel. used by diff_drive package.

  • /lwheel_rate (std_msgs/Int32)

Left wheel rotation rate. used by diff_drive package.

  • /rwheel_rate (std_msgs/Int32)

Right wheel rotation rate. used by diff_drive package.

Services

  • /vector/battery_state

  • /vector/set_head_angle

  • /vector/set_lift_height

  • /vector/anim_list

  • /vector/say_text

Actions

  • /vector/play_animation

Play animation by name.

Examples

Run the following (with your Vector's serial number substituted) to make topics available for subscribing and publishing messages to Vector

roslaunch vector_ros vector.launch serial:="<serial number>"

View single image from camera

rosrun image_view image_saver image:=/vector/camera
[ INFO] [1550425113.646567813]: Saved image left0000.jpg
[ INFO] [1550425113.752592532]: Saved image left0001.jpg
[ INFO] [1550425113.848999553]: Saved image left0002.jpg

Set head angle

rosservice call /vector/set_head_angle "deg: 45.0"

Say text

rosservice call /vector/say_text "text: 'hello world'"

Play animation

rostopic pub /vector/play_animation/goal vector_ros/PlayAnimationActionGoal "header:
  seq: 0
  stamp:
    secs: 0
    nsecs: 0
  frame_id: ''
goal_id:
  stamp:
    secs: 0
    nsecs: 0
  id: ''
goal:
  anim: 'anim_turn_left_01'"

FAQ

About

ROS package for Anki Vector home robot

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 64.1%
  • CMake 25.3%
  • Dockerfile 10.6%