Skip to content

Instantly share code, notes, and snippets.

View PierrickKoch's full-sized avatar

Pierrick Koch PierrickKoch

View GitHub Profile
@PierrickKoch
PierrickKoch / morse-tuto.py
Created March 25, 2011 03:40
merged: github.com/pierriko/proteus/blob/master/proteus.py !
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'
#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;
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;
@PierrickKoch
PierrickKoch / newAPI.py
Created July 8, 2011 09:05
new Morse creator demo
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()
@PierrickKoch
PierrickKoch / ImageView.py
Created November 1, 2011 05:54
ROS image_view wxPython
#!/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
@PierrickKoch
PierrickKoch / viewport_shade.py
Created November 10, 2011 07:10
Blender setDefaultSpaceViewPort script
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':
@PierrickKoch
PierrickKoch / segway.py
Created November 11, 2011 04:56
Morse Segway with motion controller
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')
@PierrickKoch
PierrickKoch / collada_importer.py
Created December 14, 2011 05:17
Blender collada_import with imported_objects return
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):
@PierrickKoch
PierrickKoch / test.py
Created January 6, 2012 05:09
MORSE test
"""
blender --background /usr/local/share/morse/data/morse_default.blend --python test.py
echo $?
"""
try:
import morse
except ImportError:
import os
import sys
@PierrickKoch
PierrickKoch / builder.rst
Created February 22, 2012 03:03
[doc] from reseted commit

MORSE-builder API

Abstract

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.