Coder Social home page Coder Social logo

robot-designer's Introduction

Robot Designer

The Robot Designer tool lets users build custom robots in an easy and quick way. With the automatic snap mechanism you simply have to drag parts at the desired position and the tool will position it for you.

Robot Designer

Demo

https://cyberbotics.github.io/robot-designer/

Run locally

  1. Create an HTTP server on the parent directory:
cd $REPO_CLONE
cd ..
python -m SimpleHTTPServer
  1. Open "http://localhost:8000/robot-designer/"

Toolbar

Toolbar

  • Export: export the modeled robot to JSON, Webots, and NRP compatible (coming soon..) format.
  • Undo: erase the last change done to the robot.
  • Redo: reverse the undo change.
  • Selection tool: disable the translation and rotation tools.
  • Translation tool: enable displaying the translation gizmo for the selected part. Note that translation constraints could be set for the slot connection of the selected part.
  • Rotation tool: enable displaying the rotation gizmo for the selected part. Note that rotation constraints can be set for the slot connection of the selected part.
  • Delete: delete the selected robot part.
  • Fullscreen: enter/exit full screen mode.

Library

Library

The library contains all the available robot parts. The parts are grouped by robotics kit and the kit can be chosen using the combo box. Only parts that can be added to the current robot model are enabled. Parts that need a slot connection that it is currently not available with the robot model are shown in the library but they are disabled.

Part Viewer

Part Viewer

The part viewer shows the properties of the selected part and lets the user customize it In particular it includes the name of the part and all the parameters, if any, that can be modified.

How to build a robot

Adding Parts

To build your custom robot you simply have to click on a part in the library, drag it on the 3D scene and drop it at the desired position.

When you drag the part in the 3D scene you will see a ghost image of the part itself and all the available slot positions where you can place it will be displayed in green.

Slots

If you then drag the part on a slot, the selected slot will be displayed in blue and the ghost image of the part will be automatically displayed in the final position using an automatic snap mechanism.

Snap Mechanism

Translating and Rotating Parts

If the automatic snap mechanism doesn't put the parts at the desired position, it is possible to translate or rotate it enabling the translation or rotation tool. First, you have to select the translation/rotation tool from the toolbar, then you select the part you want to move. At this point the translation/rotation gizmo will be displayed for the selected part and you can move it.

Translation Gizmo Rotation Gizmo

Note that some slot types have special constraints on rotation and translation. For this reason it can happen that the rotation and translation is limited to some axes or that it is not available at all.

Deleting Parts

You can delete parts by selecting them and clicking on the Delete button in the toolbar. Note that all the children parts connected to the selected part will also be deleted.

Interaction with the 3D Scene

Object Selection

If you move your mouse pointer over a robot part, a white outline of the part is displayed. It is possible to select an object or a robot in the 3D scene by clicking on it using the left mouse button. Once selected, a blue outline is displayed.

Navigation in 3D

Rotate Viewpoint

To rotate the camera around the x and y axis, you have to set the mouse pointer in the 3D scene, press the left mouse button, and drag the mouse. The rotation is centered around the scene center.

Translate Viewpoint

To translate the camera in the x and y directions, you have to set the mouse pointer in the 3D scene, press the right mouse button, and drag the mouse.

Zoom

To zoom in or out the 3D scene, set the mouse pointer in the 3D scene and use the wheel or press the middle button of the mouse and drag the mouse.

Export

The created robot model can be exported in three different formats.

Export

Export to JSON

This functionality exports the model in a generic JSON format describing the structure of the robot and the position and customizable parameters of the parts.

Export to Webots

This functionality generates a Webots WBT file containing the created robot that can directly imported in Webots.

Export to NRP (coming soon..)

This functionality generates a robot model compatible wit the Neurorobotics Platform (https://neurorobotics.net/).

robot-designer's People

Contributors

fabienrohrer avatar omichel avatar stefaniapedrazzi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

robot-designer's Issues

Disable mouse over part highlight while translating/rotating a part

After clicking on a translation gizmo and dragging the part the mouse over part highlight continues to change based on the position of the mouse.
Given that in any case the selection cannot be changes during the drag it seems better to disable the highlight changes based on the mouse position.

Improve Asset.parameters

For now, the customizable parameters are TinkerbotsAxle.length (actually not implemented), TinkerbotsCubiePyramid.color and TinkerbotsCubieTriangle.color. In Webots, they are all string enumerations, and affects the Shape (color or shape).

In the contrary of translation or rotation where the THREEjs <-> Webots link is direct, this kind of links should be coded somewhere. For now it's hard-coded here: https://github.com/omichel/robot-designer/blob/master/app/view/mediator/part_mediator.js#L78

To solve this, we should either provide a generic way to write these links, or to have several x3d files (e.g. one x3d file per parameter set).

RobotViewer refresh

For now, the THREEjs view is refreshed at 60fps systematically. Now that the design become more stable it would be good to have a finer control on the refresh, by refreshing only when some event occurs. These events are certainly the command updates, x3d load, textures load, direct GUI modifications (mouse move?).

Error undoing a multiple parts deletion

Steps to reproduce:

  1. add tinkerbots root part
  2. add a cubie (A)
  3. add a cubie (B) to the cubie (A)
  4. delete cubie (A) -> cubie (B) is deleted as well
  5. undo last deletion action

-> everything seems to work correctly but this error is displayed in the console

Uncaught TypeError: Cannot read property 'traverse' of undefined
    at PartMediator.onPartAdded (part_mediator.js:23)
    at PartMediator.model.addObserver (part_mediator.js:13)
    at observers.forEach (Observable.js:18)
    at Array.forEach (<anonymous>)
    at Part.notify (Observable.js:17)
    at part.js:43
    at Part._applyFooRecursively (part.js:92)
    at Part.addPart (part.js:42)
    at commands.js:95
    at UndoStack.undo (UndoStack.js:39)

Improve class name consistency

I think it would be good to rename view/view3d.js to view/robot_viewer.js (and the related class) to be consistent with view/part_browser.js and view/part_viewer.js

Issues undoing mesh color changes

As already reported in #11, there are some issues undoing operations with meshes for which the color has been changed.

For example:

  1. undoing a color change (yellow -> blue)
    -> the mesh remains blue

  2. undoing a delete of a blue part
    -> the mesh appears as yellow, in the part viewer the color is set to yellow, but it seems that internally the blue is stored because changing manually back the color to blue doesn't work the first time. It works if set it to blue, then to yellow (visible color matches internal color?) and then again to blue.

Add keyboard shortcuts

It will be user-friendly to enable some keyboard shortcuts, for example:

  • Delete: delete selected
  • Ctrl + Z: Undo
  • Ctrl + Y: Redo
  • Ctrl + S: save
  • M - Toggle between selection and translation and rotation gizmo (as in mecabricks or any other keyboard shortcuts)

And to add copy/paste buttons and shortcuts

Overall Modules and Classes Design

Here is a new iteration on the module and class design:
https://github.com/omichel/robot-designer/wiki/Design

Since the last version and according the Olivier:

  • The view3D and the partView have been separated into 2 modules.
  • Classes and modules are listed in a more exhaustive way.
  • A top module has been introduced.

Moreover:

  • I renamed "View3D" to "RobotView"
  • I dropped the UIControl classes which could be implicitly added the main class of each module (RobotView, etc.)
  • I added a PartBrowser module.
  • I didn't show all the interactions with the data blocks (DOM, ThreeJS), because they are implicit in most of the cases.

This document needs to be validated and improved with the implementation.

Gap between selection in 3d view and mouse position

Sometimes it happens that there is a gap between selection in the 3D view and the mouse pointer position on the screen.
This is not systematical but i can reproduce it quite often on Chrome especially after working with other applications and returning the robot designer web page.

I had similar issues with webots.js that were due to faulty mouse position initialization.

selection_bug

Milestone build default tinkerbots models

The current version of the robot designer is very close to allow to build all the default models.
But there are a couple of issues with the slots that prevents it:

  • missing slots definition for cubie_box_with_round_slots
  • translation step is too big for the front face of the cubie_box_with_round_slots and cubie_box_with_cross_slots -> it is not possible to move the attached part precisely to the wanted position

Additionally:

  • it should be possible to define multiple slot type for round female slots: they can be connect with both cross and round male parts

Multiple parts per slot

Currently for some faces of the TInkerbots cubies, like the up face, only one slot is defined even if multiple "holes" are available in the slot.
This could be fine for users but in this case we need to support adding multiple parts per slots which is not the case now.

It would also be possible to specify a maximum number of parts per slot.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.