Skip to content

Commit

Permalink
Updated readme and license notices.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rudolph Peter z003n7ht authored and OTL committed Feb 20, 2017
1 parent a6385bb commit cd4127e
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 11 deletions.
4 changes: 4 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,7 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


nodes/transformation.py:
See license notice at head of "nodes/transformation.py".
30 changes: 22 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ This is **unofficial** ROS node for Anki cozmo.

## Requirements

This is tested on Kinetic/Ubuntu16.04 and Android only.
This is tested on Kinetic/Ubuntu16.04 and Android only. Latest version is tested on Indigo/Ubuntu14.04.

* Ubuntu 16.04
* ROS Kinetic
* Ubuntu 14.04/16.04
* ROS Indigo/Kinetic
* Python3.5
* (Android)
* (Cozmo SDK 0.10)
Expand All @@ -18,6 +18,8 @@ Cozmo SDK will become idle mode if the message is not sent to cozmo for a few mi

## Super hack to run rospy from python3

**Note: Be careful installing python3, you should update python3 alternative to python3.5 before installing and using pip3!**

This is not recommended as usual, but it seems difficult to run rospy from python3 normally. (It requires full recompile of all ROS packages.)
Below hack will allow run python3, at least for cozmo_driver.py.
I don't know the true risk to do that.
Expand All @@ -27,32 +29,44 @@ sudo apt-get install python3-yaml
sudo pip3 install rospkg catkin_pkg
```

Note: To get further python3 compat a local version of "transformations.py" is included!

## TODO

* use trajectory_msgs to command head angle and lift height.
* control and get states of cubes

## Pub/Sub
## Pub / Sub / Tf

### Publish

* /image (sensor_msgs/Image) : camera image from cozmo. This is gray scale, but the format is rgb8.
* /cozmo_camera/image (sensor_msgs/Image) : camera image from cozmo. This is gray scale, but the format is rgb8.
* /cozmo_camera/camera_info (sensor_msgs/CameraInfo) : The camera info from Cozmo's camera ( **Note: I did a very poor calibration!** ).
* /joint_states (sensor_msgs/JointState) : This contains the head angle [rad] and the lift height [m]
* /tf (tf2_msgs/TFMessage) : poses of visialbe cubes and cozmo.
* /imu (sensor_msgs/Imu) : Imu mounted on cozmo head
* /battery (sensor_msgs/BatteryState) : battery voltage and charging status

### Subscribe

* /cmd_vel (geometry_msgs/Twist) : command velocity as usual. (velocity is not correct)
* /cmd_vel (geometry_msgs/Twist) : command velocity as usual. ( **Note: velocity is correct now!** )
* /say (std_msgs/String) : cozmo says this text
* /head_angle (std_msgs/Float64) : command head angle [rad]
* /lift_height (std_msgs/Float64) : command lift height [m]
* /lift_height (std_msgs/Float64) : command lift height (value between 0 and 1, which is autoscaled by Cozmo SDK) [float]
* /backpack_led (std_msgs/ColorRGBA) : led color on backpack

### Transformations provided

* odom_frame -> footprint_frame
* footprint_frame -> base_frame
* base_frame -> head_frame
* head_frame -> camera_frame
* camera_frame -> camera_optical_frame
* odom_frame -> cube_xx (for detected cubes)

## Install cozmo SDK on Ubuntu16.04 and Android

**Note: The current driver whas tested on Ubuntu14.04 with ROS Indigo.**

Please follow the [original document](http://cozmosdk.anki.com/docs/install-linux.html#install-linux). Below is a quick hacky installation for only me.

```bash
Expand Down
22 changes: 19 additions & 3 deletions nodes/cozmo_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@
to this node. Also the TransformBroadcaster is taken from
ROS tf ones.
Copyright {2016} {Takashi Ogura}
Copyright {2017} {Peter Rudolph}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
# system
import sys
Expand Down Expand Up @@ -120,8 +135,6 @@ def __init__(self, coz):
camera_info_url = rospy.get_param('~camera_info_url', '')

# pubs
self._backpack_led_sub = rospy.Subscriber(
'backpack_led', ColorRGBA, self._set_backpack_led, queue_size=1)
self._joint_state_pub = rospy.Publisher('joint_states', JointState, queue_size=1)
self._imu_pub = rospy.Publisher('imu', Imu, queue_size=10)
self._battery_pub = rospy.Publisher('battery', BatteryState, queue_size=1)
Expand All @@ -130,6 +143,8 @@ def __init__(self, coz):
self._camera_info_pub = rospy.Publisher('/cozmo_camera/camera_info', CameraInfo, queue_size=10)

# subs
self._backpack_led_sub = rospy.Subscriber(
'backpack_led', ColorRGBA, self._set_backpack_led, queue_size=1)
self._twist_sub = rospy.Subscriber('cmd_vel', Twist, self._twist_callback, queue_size=1)
self._say_sub = rospy.Subscriber('say', String, self._say_callback, queue_size=1)
self._head_sub = rospy.Subscriber('head_angle', Float64, self._move_head, queue_size=1)
Expand All @@ -156,7 +171,8 @@ def _move_lift(self, cmd):
Move lift to given height.
:type cmd: Float64
:param cmd: The height in millimeters.
:param cmd: A value between [0 - 1], the SDK auto
scales it to the according height.
"""
action = self._cozmo.set_lift_height(height=cmd.data,
Expand Down
14 changes: 14 additions & 0 deletions nodes/head_lift_joy.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@
This script implements a ROS node, which is used to
control cozmo's head angle and lift height via joy-pad.
Copyright {2017} {Peter Rudolph}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

import rospy
Expand Down

0 comments on commit cd4127e

Please sign in to comment.