The idea is to allow user to write a simulation in few lines of Python, without having to learn Python (neither Blender). We want to give the ease of a DSL, without its technical complication.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
''' | |
!!! discontinued Gist, merged in: | |
https://github.com/pierriko/proteus/blob/master/proteus.py | |
''' | |
MORSE_DATA = '/home/pierrick/work/morse/data/morse' | |
MORSE_COMPONENTS = MORSE_DATA + '/components' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <rtt/TaskContext.hpp> | |
#include <rtt/Port.hpp> | |
#include <geometry_msgs/Twist.h> | |
#include <ocl/Component.hpp> | |
#include <sensor_msgs/LaserScan.h> | |
#include <numeric> | |
using namespace std; | |
using namespace RTT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.ros.tutorials.pubsub; | |
import org.apache.commons.logging.Log; | |
import org.ros.MessageListener; | |
import org.ros.Node; | |
import org.ros.NodeConfiguration; | |
import org.ros.NodeMain; | |
import org.ros.Subscriber; | |
import org.ros.Publisher; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from morse.builder.sensors import * | |
from morse.builder.actuators import * | |
from morse.builder.middlewares import * | |
from morse.builder.morsebuilder import * | |
# Append ATRV robot to the scene | |
atrv = Robot('atrv') | |
# Append an actuator | |
motion = MotionController() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
usage: | |
rosrun proteus_demo ImageView.py image:=/ATRV/CameraMain | |
""" | |
import roslib | |
roslib.load_manifest('rospy') | |
roslib.load_manifest('sensor_msgs') | |
import rospy | |
from sensor_msgs.msg import Image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
def setDefaultSpaceViewPort(viewport_shade='WIREFRAME'): | |
""" setDefaultSpaceViewPort | |
:param viewport_shade: enum in ['BOUNDBOX', 'WIREFRAME', 'SOLID', 'TEXTURED'], default 'WIREFRAME' | |
:return: number of viewport_shade set; 0 if no 3D View in the current window | |
""" | |
num_view = 0 | |
for area in bpy.context.window.screen.areas: | |
if area.type == 'VIEW_3D': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from morse.builder.morsebuilder import * | |
environment = 'indoors-1/indoor-1' # indoor | |
# in case you launche this script with a .blend file | |
if len(bpy.data.objects) > 0: | |
environment = None | |
# Append ATRV robot to the scene | |
robot = Robot('segwayrmp400') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def diff_list(l1, l2): | |
return [obj for obj in l1 if obj not in l2] | |
import bpy | |
def objects_names(): | |
return [obj.name for obj in bpy.data.objects] | |
def collada_importer(filepath): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
blender --background /usr/local/share/morse/data/morse_default.blend --python test.py | |
echo $? | |
""" | |
try: | |
import morse | |
except ImportError: | |
import os | |
import sys |
OlderNewer