Home | Tutorials | Wiki | Issues
Ask Your Question
0

How to build a Rubik's cube in Gazebo?

asked 2017-08-01 03:57:29 -0500

longwoo gravatar image

I happened watched a demo in https://www.youtube.com/watch?v=4M_ZI.... I am curious about it . Is there any example about how to build it ?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2017-08-01 09:23:35 -0500

The source code for that cube is here:

https://bitbucket.org/chapulina/chapu...

The cube was modeled as boxes connected by ball joints to the center. In the past, I've also tried simulating the real mechanism, where the contacts between parts hold them together, but I never got it to be stable enough.

Have fun!

edit flag offensive delete link more

Comments

Thank you so much. I am trying to play it .

longwoo gravatar imagelongwoo ( 2017-08-01 20:11:00 -0500 )edit
0

answered 2017-08-21 06:56:10 -0500

longwoo gravatar image
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
set (CMAKE_AUTOMOC ON)
find_package(Qt5Widgets)
find_package(Qt5Core)
find_package(Protobuf REQUIRED)
find_package(gazebo REQUIRED)
include_directories(SYSTEM ${GAZEBO_INCLUDE_DIRS} ${Qt5Core_INCLUDE_DIRS})
link_directories(${GAZEBO_LIBRARY_DIRS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GAZEBO_CXX_FLAGS}")
add_library(PuzzleGUIPlugin SHARED ${headers_MOC}
  PuzzleGUIPlugin.cc)
target_link_libraries(PuzzleGUIPlugin ${GAZEBO_LIBRARIES}
    ${OGRE_LIBRARIES}
    ${OGRE-Terrain_LIBRARIES}
    ${Qt5Core_LIBRARIES}
    ${Qt5Widgets_LIBRARIES}
    ${PROTOBUF_LIBRARIES})
add_library(PuzzleModelPlugin SHARED PuzzleModelPlugin.cc)
target_link_libraries(PuzzleModelPlugin ${GAZEBO_LIBRARIES})

Update: In gazebo 8.0, the cmakelist.txt can be used like this since Qt5.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-08-01 03:57:29 -0500

Seen: 64 times

Last updated: 16 hours ago