ECTO + Kinect Issue
When trying to run a VERY basic ECTO cell before I integrate in any of my own functionality I am getting the following error:
python example.py
Connecting to device.
attempting to turn on registration...
Failed to start generating.Bad Parameter sent to the device!
303:/tmp/buildd/ros-fuerte-ecto-openni-0.3.8-0precise-20130313-1459/cells/Capture.cpp
Connected to device.
Failed to update all contexts.A timeout has occurred when waiting for new data!
430:/tmp/buildd/ros-fuerte-ecto-openni-0.3.8-0precise-20130313-1459/cells/Capture.cpp
Segmentation fault (core dumped)
I am not sure what is causing this as I am simply using ECTO to access the Kinect and to display the point cloud. I have attached the source for the example.py file below:
#!/usr/bin/env python
import ecto
import ecto_openni
import ecto_pcl
plasm = ecto.Plasm()
# capture from kinect and downsample
device = ecto_openni.Capture( 'device' )
cloud_generator = ecto_pcl.NiConverter('cloud_generator')
viewer = ecto_pcl.CloudViewer( "viewer", window_name="Clouds!" )
graph = [ device[:] >> cloud_generator[:],
cloud_generator[:] >> viewer[:]
]
plasm.connect( graph )
if __name__ == "__main__":
from ecto.opts import doit
doit(plasm, description='test.')
Above this line has been resolved.
I have updated my python code to include the following:
#!/usr/bin/env python
import ecto, ecto_pcl, ecto_ros, ecto_pcl_ros
from ecto_openni import Capture
plasm = ecto.Plasm()
# capture from kinect and downsample
cloud_sub = ecto_sensor_msgs.Subscriber_PointCloud2("cloud_sub", topic_name='/camera/depth_registered/points')
msg2cloud = ecto_pcl_ros.Message2PointCloud("msg2cloud", format=ecto_pcl.XYZRGB)
cloud2msg = ecto_pcl_ros.PointCloud2Message("cloud2msg")
cloud_pub = ecto_sensor_msgs.Publisher_PointCloud2("cloud_pub",topic_name='/ecto_pcl/sample_output')
plasm.connect( cloud_sub['output'] >> msg2cloud[:],
msg2cloud[:] >> cloud2msg[:],
cloud2msg[:] >> cloud_pub[:] )
ecto_ros.init(sys.argv, "get_point_cloud")
if __name__ == "__main__":
from ecto.opts import doit
doit(plasm, description='Read a pcd through ROS.')
When I run this code I get following error:
Traceback (most recent call last):
File "ros_example.py", line 10, in <module>
cloud_sub = ecto_sensor_msgs.Subscriber_PointCloud2("cloud_sub", topic_name='/camera/depth_registered/points')
NameError: name 'ecto_sensor_msgs' is not defined
I am also not sure if I am performing the call to ecto_ros.init() properly.