RIG InMoov Project
|
The simulation for the RIGbot runs in ROS. It accepts commands in the same protocol described in index.Arduino. You must first use git to download the project, detailed in Introduction.
This section only details basic usage and slight modification. For the information required to add any new features, model modifications, or bug fixes, you may need to read the beginner level ROS tutorials and the urdf tutorials.
The simulation depends on ROS. We use the Jade version, as it is the long term release. It is recommended you install the full system because of the number of the large number of ROS packages. On Ubuntu, this is achieved with the following commands.
If you experience problems, please read the full wiki article.
To build the simulation, simply run the following from the root directory of the project.
You may also want to build manually. Before running any ROS commands, you must run this command.
There are also .zsh and .sh files for users of zsh or sh. It is recommended you append this command to your shell's .rc file (ex. ~/.bashrc). Make sure to fill in the absolute path to rig-inmoov/catkin-ws.
The following only needs to be run once.
Finally, we can build the project.
After running all the necessary setup commands, you can finally run the simulation.
This requires that an input board such as the flex sensor glove is connected. Replace "port" with the port your desired board is connected on (search for the naming convention for your board online). The output from launch commands is captured in ~/.ros/log/.
You can also set and change the port later with the following command.
The serial publisher does not need to be running.
If the serial publisher crashes because it loses connection, you can re-launch it with this command without ending the visualizer.
We have two custom programs used to maintain the simulation. The first is serial_publisher, compiled from catkin_ws/src/robot_description/src/serial_publisher.cpp. This program accepts input from a serial port and translates it to a ROS topic.
The other program is state_publisher, compiled from state_publisher.cpp in the same directory. This program listens to the topic and translates it into joint positions, which rviz (the visualizer component of ROS) listens to. It expects input of the same protocol as described in Introduction.
The modularity of these programs makes it easy to write publishers for new protocols (such as bluetooth) using just serial_publisher.cpp as reference. It also makes it easy to add new parts to state_publisher. New programs need to be added to catkin_ws/src/robot_description/CMakeLists.txt.
The rviz visualizer is loaded with a urdf file, stored in catkin_ws/src/robot_description/model.xml, that describes how the different 3D models that make up movable parts are positionally related to one another.
There are two example launch files used for debugging, stored in catkin_ws/src/robot_description/launch along with display.launch. The first is debug.launch, which launches state_publisher and serial_publisher in gdb, and the second, memdebug.launch, launches both programs in Valgrind. It is recommended that you use the three launch files as reference when modifying and creating program systems.