Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 1st, 2012, 09:37 AM
pwsnow pwsnow is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2012
Posts: 1 pwsnow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 27 sec
Reputation Power: 0
Question about C++ wrapper for Python

Hi everyone, I have a question which I think I have a rough idea how to implement but wouldn’t mind a second opinion.


I have two systems I need to establish a 2 way connection with. Vizard 4.0 by Worldviz (Coding in Python and the SDK low level stuff in C++) which we are using to create virtual worlds. The other system is an API for the Moog HapticMaster robot (basically a big robot arm, API in C++) used to interact with Vizard to touch objects and manipulate the virtual world.

We have already written a .dle file using the Vizard SDK to get position data from the HapticMaster and that works fine, we can move a virtual object with 6DOF using the HapticMaster + Gimbal. The .dle file is static in that although position data is sent (via packets over IP to the actual robot) into Vizard, Vizard would need to call methods in the HapticMaster API (Mainly .h files but also to .dll/.cpp/.lib files too) in order to add haptic effects into the environment. The example code from Moog draws (in C++) spheres and other shapes (using GLUT) so that interaction can be achieved. We would need to draw these GLUT shapes in Vizard too.

It should be mentioned that the way high level commands are sent/received to and from (position data/force etc) are sent via network packets. The data retrieved from these packets are then manipulated via the HapticMaster API.


The HapticMaster API files are:

HapticAPI2.dll
HapticAPI2.h
HapticAPI2.lib
HapticAPI2Def.h
HapticMASTER.h
Vector3d.h

With GLUT32 library files including:

Glut.def
Glut.h
Glut32.dll
Glut32.lib

And of course the Vizard files are .py files



Looking around I know there are several options for fusing C++ and Python together.

.h files – ctpyes or boost python

.dll files - ctypes

.cpp files – ctypes or boost python

.lib files - ? Dunno about this one some solutions refer to even writing a DLL file.

.def files - ?

GLUT32 – PyOpenGL 3.x

Any networking stuff – Python socket code



Would this be a good way of doing this or does anyone know of any better modules/libraries? Or can all these files be access using one API such as boost as opposed to boost and ctypes?

Many thanks for any help, if you have any questions please don’t hesitate to ask me.

Reply With Quote
  #2  
Old August 1st, 2012, 01:35 PM
b49P23TIvg's Avatar
b49P23TIvg b49P23TIvg is offline
Contributing User
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Aug 2011
Posts: 3,364 b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 3 Days 10 h 28 m 48 sec
Reputation Power: 383
I've answered a few questions about ctypes in this forum.

http://forums.devshed.com/python-programming-11/reading-dlls-in-python-916431.html

for example. Hope this helps, otherwise, I dare say, .filetypes litter your post.
__________________
[code]Code tags[/code] are essential for python code!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > Question about C++ wrapper for Python

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap