Friday, 7 October 2016

Compile & Install OpenCVBlobsLib on Windows

Win7 64bit, Visual Studio 2012, OpenCV 3.0

1. Install pthread-win32 which is required by OpenCVBlobsLib
Instruction: InstallingpthreadsforVisualStudio.pdf

2. Download OpenCVBlobsLibhttp://opencvblobslib.github.io/opencvblobslib/

3. Configure with CMake. Make sure BUILD_SHARED_LIBS is off. CMAKE_CXX_FLAGS_(DEBUG/RELEASE)/CMAKE_C_FLAGS_(DEBUG/RELEASE) has value /MTd (Debug) and /MT (Release) for static link.

4. Configure/Generate/Build

Wednesday, 24 February 2016

Add additional slice to model in Solidworks

  1. Open part of model if it's in assembly
  2. Sketch tap -> Sketch button (3D Sketch) -> Select Line (ShortcutL)
  3. Draw three lines (points) and define a plane using the points (NOT two lines)
  4. To define a plane, Feature tab -> Reference Geometry -> Plane
  5. Right click the created plane underFeatureManager Design Tree, select sketch
  6. Select the new sketch, press Convert Entities, then select the plane we want to extrude from original model.
  7. With the sketch selected, press Extruded Boss/Base button.
    • After all slices extruded, we can hide the 3D sketches for better visualization.
  8. Hide other part, only leave extruded part shown. Save the extruded part as separate file with proper name (Note: usecopy and continue in save dialog).
  9. Leave the part edit mode without saving or changing anything in assembly.
  10. Import the saved extruded part in assembly.
  11. Mate three planes (front/top/right) between extruded part and original part.

Export to mesh for colouring

  1. Save as IGS (choose specified coordinate)
  2. Open the IGS file, save as VRML (*.wrl) with VRML97 version which is supported by meshlab
  3. Close IGS file without saving it.

Tuesday, 2 February 2016

Setup ROS for multiple machines

1. Pre-request

  • Setup ssh for all computers, usually ssh-client is installed but not ssh-server.
      sudo apt-get install openssh-server
      sudo service ssh status
      sudo ufw allow ssh
    
  • Set host IP for each computer:
    • Get the IP:
        hostname -I
      
    • set IP for ROS_IP
        export ROS_IP=$IP_ADDR$
      

2. Master

There will be a computer run as master machine where roscore will be run.
  • Set ROS_MASTER_URI
      export ROS_MASTER_URI=http://localhost:11311
    
  • Start roscore
  • Start test program
      rosrun rospy_tutorials listener.py
    

3. Slaves (other machines)

  • ssh to remote PC
  • Set ROS_MASTER_URI
      export ROS_MASTER_URI=http://$MASTER_IP_HERE$:11311
    
  • Start test program
      rosrun rospy_tutorials talker.py
    
We should see in the master the message sent by slave is received.
http://nootrix.com/software/ros-networking/