Commit a5ebb441 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

Format

parent 03e2ab4c
Pipeline #6848 passed with stage
in 5 minutes and 18 seconds
......@@ -17,8 +17,8 @@
SET(LIBRARY_NAME ${PROJECT_NAME})
SET(IDL_SOURCES
rbprmbuilder
)
rbprmbuilder
)
INCLUDE(${HPP_CORBASERVER_CMAKE_PLUGIN})
......@@ -80,27 +80,27 @@ INSTALL(
)
INSTALL(
FILES
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/client.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/rbprmbuilder.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/rbprmfullbody.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/rbprmstate.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/state_alg.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/fewstepsplanner.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/client.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/rbprmbuilder.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/rbprmfullbody.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/rbprmstate.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/state_alg.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/fewstepsplanner.py
DESTINATION ${PYTHON_SITELIB}/hpp/corbaserver/rbprm
)
INSTALL(
FILES
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/tools/__init__.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/tools/generateROMs.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/tools/com_constraints.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/tools/plot_analytics.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/tools/affordance_centroids.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/tools/cwc_trajectory.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/tools/cwc_trajectory_helper.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/tools/path_to_trajectory.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/tools/obj_to_constraints.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/tools/time_out.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/tools/display_tools.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/tools/__init__.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/tools/generateROMs.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/tools/com_constraints.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/tools/plot_analytics.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/tools/affordance_centroids.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/tools/cwc_trajectory.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/tools/cwc_trajectory_helper.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/tools/path_to_trajectory.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/tools/obj_to_constraints.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/tools/time_out.py
${CMAKE_CURRENT_SOURCE_DIR}/hpp/corbaserver/rbprm/tools/display_tools.py
DESTINATION ${PYTHON_SITELIB}/hpp/corbaserver/rbprm/tools
)
# Stand alone corba server
......
import time
def createSphere(name,r,size=0.01,color=[0,0,0,1]):
r.client.gui.addSphere(name,size,color)
r.client.gui.addToGroup(name,r.sceneName)
r.client.gui.setVisibility(name,'ALWAYS_ON_TOP')
r.client.gui.refresh()
def moveSphere(name,r,pos):
if len(pos) == 3:
q=pos+[1,0,0,0]
elif len(pos) == 7:
q = pos
else:
raise ValueError("pos should be of size 3 or 7 ")
r.client.gui.applyConfiguration(name,q)
r.client.gui.refresh()
def displayContactSequence(r,configs,pause=1.):
for i in range(0,len(configs)):
r(configs[i])
time.sleep(pause)
def moveObject(viewer,pos,rotation=[1,0,0,0]):
viewer.client.gui.applyConfiguration(name,pos+rotation)
viewer.client.gui.refresh()
def addVector(viewer,rbprmBuilder,color,v,name=None):
gui = viewer.client.gui
if name==None:
i=0
name='vector_'+str(i)
while name in gui.getNodeList():
i=i+1
name='sphere_'+str(i)
quat = rbprmBuilder.quaternionFromVector(v[3:6])
v[3:7] = quat[::]
gui.addArrow(name,0.02,1,color)
gui.addToGroup(name,viewer.sceneName)
gui.setVisibility(name,"ON")
gui.applyConfiguration(name,v)
gui.refresh()
def displaySurfaceFromPoints(viewer,p_list,color=[0,0,0,1],name=None):
gui = viewer.client.gui
if name==None:
i=0
name='surface_'+str(i)
while name in gui.getNodeList():
i=i+1
name='surface_'+str(i)
gui.addCurve(name,p_list,color)
gui.addToGroup(name,viewer.sceneName)
gui.refresh()
def createSphere(name, r, size=0.01, color=[0, 0, 0, 1]):
r.client.gui.addSphere(name, size, color)
r.client.gui.addToGroup(name, r.sceneName)
r.client.gui.setVisibility(name, 'ALWAYS_ON_TOP')
r.client.gui.refresh()
def moveSphere(name, r, pos):
if len(pos) == 3:
q = pos + [1, 0, 0, 0]
elif len(pos) == 7:
q = pos
else:
raise ValueError("pos should be of size 3 or 7 ")
r.client.gui.applyConfiguration(name, q)
r.client.gui.refresh()
def displayContactSequence(r, configs, pause=1.):
for i in range(0, len(configs)):
r(configs[i])
time.sleep(pause)
def moveObject(viewer, pos, rotation=[1, 0, 0, 0]):
viewer.client.gui.applyConfiguration(name, pos + rotation) # noqa TODO
viewer.client.gui.refresh()
def addVector(viewer, rbprmBuilder, color, v, name=None):
gui = viewer.client.gui
if name is None:
i = 0
name = 'vector_' + str(i)
while name in gui.getNodeList():
i = i + 1
name = 'sphere_' + str(i)
quat = rbprmBuilder.quaternionFromVector(v[3:6])
v[3:7] = quat[::]
gui.addArrow(name, 0.02, 1, color)
gui.addToGroup(name, viewer.sceneName)
gui.setVisibility(name, "ON")
gui.applyConfiguration(name, v)
gui.refresh()
def displaySurfaceFromPoints(viewer, p_list, color=[0, 0, 0, 1], name=None):
gui = viewer.client.gui
if name is None:
i = 0
name = 'surface_' + str(i)
while name in gui.getNodeList():
i = i + 1
name = 'surface_' + str(i)
gui.addCurve(name, p_list, color)
gui.addToGroup(name, viewer.sceneName)
gui.refresh()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment