libcozmo is a C++ library for simulating and running Cozmo based on DART and AIKIDO. Current tools allow you simulate the forklift movement, execute few functions from the Cozmo SDK and execute an interpolated trajectory in simulation.
Checkout and build this package, aikido from source, and install DART (version 6.0 or above). You
can automate the checkout and build by following [development environment]
instructions with this
.rosinstall file if you are using Ubuntu 14.04:
- git: local-name: aikido uri: https://github.com/personalrobotics/aikido.git version: master - git: local-name: libcozmo uri: https://github.com/personalrobotics/libcozmo.git version: master
If you are using Ubuntu 16.04, use this
- git: local-name: aikido uri: https://github.com/personalrobotics/aikido.git version: xenial_fixes - git: local-name: libcozmo uri: https://github.com/personalrobotics/libcozmo.git version: master
To load Cozmo into the Rviz viewer in a catkin and ros environment, run the following commands:
$ catkin build libcozmo $ . devel/setup.bash $ cd libcozmo $ screen -S roscore $ roscore $ <CTRL><A>+<D> $ screen -S rviz $ . devel/setup.bash $ rviz $ <CTRL><A>+<D> $ `catkin locate -b libcozmo`/rviz_example `catkin locate -s libcozmo`/meshes
After all the commands are run, subscribe to the InteractiveMarker
dart_markers topic in Rviz. Cozmo should now appear in the viewer.
This script allows you to enter angles (in radians) for the forklift position; the movement will be reflected by the robot in the viewer.
Similarily, to run the script that moves Cozmo to the specified pose, run the following command:
$ `catkin locate -b libcozmo`/go_to_pose_example `catkin locate -s libcozmo`/meshes
NOTE: You must be connected to Cozmo in SDK Mode to run this script; the script does not simulate the movement in the viewer. For instructions on how to connect to Cozmo in SDK Mode click here.
To load Cozmo in the DART viewer in a non-catkin/ros environment, run the following commands:
$ cd libcozmo $ mkdir build $ cd build $ cmake .. -DCOZMO_BUILD_RVIZ_EXAMPLE=OFF # e.g. if ros/aikido not available $ make $ ./dart_example `pwd`/../meshes
Trajectory Execution in Simulation
A sample script has been provided to show how to simulate trajectory execution in the Rviz viewer. To run this script, run the following commands:
$ screen -S roscore $ roscore $ <CTRL><A>+<D> $ screen -S rviz $ . devel/setup.bash $ rviz $ <CTRL><A>+<D> $ `catkin locate -b libcozmo`/execute_traj `catkin locate -s libcozmo`/meshes
A trajectory is defined by a set of waypoints. First, define waypoints at specific times:
libcozmo::Waypoint w1; w1.x = X_POSITION; w1.y = Y_POSITION; w1.th = ROTATION_THETA; w1.t = TIME;
Pass in an
std::vector of waypoints to the
createInterpolatedTraj function to create an interpolated trajectory. Pass this trajectory and a period into the
executeTrajectory function to execute the trajectory.
libcozmo is licensed under a BSD license. See LICENSE for more information.
libcozmo is developed by Vinitha Ranganeni (@vinitha910) at the Personal Robotics Lab in the Robotics Institute at Carnegie Mellon University. I would like to thank Clint Liddick (@ClintLiddick) and J.S. Lee (@jslee02) for their assistance in developing libcozmo and Ariana Keeling for her assistance in developing the SolidWorks model of Cozmo.