Skip to content

NaohiroHayashi/bulletsim

 
 

Repository files navigation

Simulation environment with Bullet physics


** Linux Compilation for Alex's branch **

Install the required dependencies using apt-get (this is incomplete):
  sudo apt-get install ros-fuerte-desktop-full libopenscenegraph-dev cmake-curses-gui python-networkx
Maybe these ones too:
  sudo apt-get install ros-fuerte-openni-camera ros-fuerte-openni-launch

Prepare to install openrave:
  sudo add-apt-repository ppa:openrave/release
  sudo apt-get update
Now, open the synaptic ('sudo synaptic') gui:
  openrave0.6-dp-dev
  openrave0.6-dp-plugins-all
  openrave0.6-dp-data
If the above doesn't appear in synaptic, in the terminal do these first and then do the synaptic step again:
  sudo apt-get remove openrave*
  sudo apt-get update

Let BULLETSIM_SOURCE_DIR be the bullesim directory (i.e. the directory cloned by 'git clone [email protected]:hojonathanho/bulletsim.git').
Make a build directory, preferrably outside BULLETSIM_SOURCE_DIR. Let BULLETSIM_BUILD_DIR be this build directory.

Set these two as environment variables. For example (replace with the actual directories):
  echo 'export BULLETSIM_SOURCE_DIR=~/rll/bulletsim' >> ~/.bashrc
  echo 'export BULLETSIM_BUILD_DIR=~/rll/build' >> ~/.bashrc
Restart the terminal and run the following:

# Setup build directories
cd $BULLETSIM_BUILD_DIR
mkdir bulletsim_msgs
mkdir bulletsim

# Generate makefiles, compile and install bulletsim_msgs
cd $BULLETSIM_BUILD_DIR/bulletsim_msgs
cmake $BULLETSIM_SOURCE_DIR/bulletsim_msgs
make -j
sudo make install

# Generate makefile and compile bulletsim
cd $BULLETSIM_BUILD_DIR/bulletsim
cmake $BULLETSIM_SOURCE_DIR -DJOHNS_ADVENTURES=ON
make -j

# Make a link between every binary in the build directory and a new package in ros named binary_symlinks
roscd
roscreate-pkg binary_symlinks
cd binary_symlinks
mkdir bin
cd bin
for node in $BULLETSIM_BUILD_DIR/bulletsim/bin/* ; do ln -s $node ; done



** Test tracking **
$BULLETSIM_BUILD_DIR/bulletsim/bin/tracker_node --cameraTopics=kinect1
roslaunch point_clouds.launch online:=false filename:=sample_rope

$BULLETSIM_BUILD_DIR/bulletsim/bin/tracker_node --cameraTopics=kinect1
roslaunch point_clouds.launch online:=false filename:=sample_cloth

$BULLETSIM_BUILD_DIR/bulletsim/bin/tracker_node --cameraTopics=kinect1 --cameraTopics=kinect2
roslaunch multi_point_clouds.launch online:=false filename:=knot_tie

$BULLETSIM_BUILD_DIR/bulletsim/bin/tracker_node --cameraTopics=kinect1 --cameraTopics=kinect2
roslaunch multi_point_clouds.launch online:=false filename:=double_fold



** Add a new ros node **
Add the source file (node.cpp) to the respective CMakeLists.txt file.

In BULLETSIM_BUILD_DIR , run
  make
Then,
  roscd binary_symlinks
  cd bin
  ln -s BULLETSIM_BUILD_DIR/bin/node



** Add a new ros msg **
Save the msg file in BULLETSIM_SOURCE_DIR/bulletsim_msgs/msg
Add the msg file to the BULLETSIM_SOURCE_DIR/bulletsim_msgs/CMakeLists.txt file.

In BULLETSIM_BUILD_DIR/bullesim_msgs , run
  make
  sudo make install



** Launch files in $BULLETSIM_SOURCE_DIR/launch **

Summary
  point_clouds.launch
    Publishes point clouds from a kinect or from a bagfile (online:=false filename:=sample)
    Drop some point clouds
    Preprocess (segments) the dropped point clouds

  multi_point_clouds.launch
    Publishes point clouds from two kinects or from two bagfiles (online:=false filename:=sample)
    Drop some point clouds
    Merges the dropped point clouds
    Preprocesses (segments) the merged point clouds

  record_cloud.launch and record_two_clouds.launch
    Records point clouds

Example 1: One kinect
  # Get live point clouds from the kinect and record them to a bagfile
  roslaunch point_clouds.launch
  roslaunch record_cloud.launch filename:=sample

  # Replay from the saved bagfile
  roslaunch point_clouds.launch online:=false filename:=sample

Example 2: Two kinects
  # Get live point clouds from two kinects and record them to two bagfiles
  roslaunch multi_point_clouds.launch
  roslaunch record_two_clouds.launch filename:=sample

  # Replay from the saved bagfile
  roslaunch multi_point_clouds.launch online:=false filename:=sample

Note
  When replaying, use_sim_time needs to be true. This is set automatically, but for all nodes to see this change, they need to be restarted (including rviz).

About

Simulation environment with Bullet physics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published