iRobot Create not returning sensor data - streaming

I am trying to stream sensor data from the iRobot Create. I get tuple out of range errors when I try
bot.stream_sensors(somenumber) and bot.poll_sensors(somenumbers). Whenever I input bot.sensors, I just get an empty array {}. I have even tried sending bot.sensors while pushing in on the bump sensor, still getting an empty array. I am connected to the bot through the Serial port with a serial-to-usb converter on my side. The only code before trying to get the sensor data is
import openinterface
bot = openinterface.CreateBot(com_port="/dev/ttyUSB0", mode="full")
Does anyone have an idea of how to solve this issue? Everywhere else just uses stream_sensors(6) and it seems to work fine.
P.S. I posted a question similar to this topic not too long ago, but no one responded. Not trying to spam, but now I have a more clear question and what the apparent-problem is so I thought I would try again.

I downloaded openinterface.py from this site: which included some sample programs. I'd suggest you take a step back, try the sample code, try to find other, more sophisticated, sample code and play with that first before moving on to your real code. You may be missing a step somewhere.

I may be a bit late to answer this, but for reference purposes. Directly controlling the iRobot is simplified greatly by using
Pyrobot.

Related

Filtering an audio signal and then reading the meter without sending it to master

I'm trying to filter a signal and then analyse the values of the filtered signal using Tone.js / Web-Audio API.
I'm expecting to get values of the filtered signal, but I only get -Infinity, meaning that my connections between the nodes are wrong. I've made a small fiddle demonstrating this, however in my use-case I do not want to send this node to the destination of the context - I only want to analyse it, not hear it.
osc.connect(filter)
filter.connect(gainNode)
gainNode.connect(meter)
console.log(meter.getLevel())
I guess you tested the code in Chrome because there is a problem with Chrome which causes it to not process anything until it is connected to the destination. When using Tone.js that means you need to call .toMaster() at the end of your chain. I updated you fiddle to make it work: https://jsfiddle.net/8f7abzoL/.
In Firefox calling .toMaster() is not necessary therefore the following works in Firefox as well: https://jsfiddle.net/yrjgfdtz/.
After some digging I've found out that I need to have a scriptProcessorNode - which is apparently no longer recommended - so looking into Audio Worklet Nodes

Siemens S7-1200. TRCV_С. Error code: 893A; Event ID 02:253A

Please, help to solve the problem with communication establishment between PC and 1211C (6ES7-211-1BD30-0XB0 Firmware: V 2.0.2). I feel that I've made a stupid mistake somewhere, but can't figure out where exactly it is.
So, I'm using function TRCV_С...
The configuration seems to be okay:
When i set the CONT=1, the connection establishes without any problems...
But, when i set EN_R=1, I'm getting "error 893A".
That's what I have in my diagnostic buffer: (DB9 - is a block where the received data is supposed to be written)
There is an explanation given for "893A" in the manuals: Parameter contains the number of a DB that is not loaded. In diag. buffer its also written that DB9 is not loaded. But in my case it is loaded! So what should I do in this case?
it seems that DB were created or edited manually due to which they are miss aligned with FB instances try removing and DB and FB instances and then add again instances of FBs with automatically created DBs and do a offline dowonload

Ros publisher not working with V-Rep after saving

I've started using V-Rep to simulate some robots (Pioneers and quadrotors, initially), but I've been having problems when I try to connect it with ROS. I tried to replicate the example from RosTopicPublisherAndSubscriber.ttt and it only works the first time, after I close it and load it again, it doesn't work anymore, my code is practically identical to the example, except that I use getPose and it's a Pioneer (the one that comes with V-Rep), here's my code:
if (simGetScriptExecutionCount()==0) then
-- Check if the required plugin is there (libv_repExtRos.so or libv_repExtRos.dylib):
local moduleName=0
local moduleVersion=0
local index=0
local pluginNotFound=true
while moduleName do
moduleName,moduleVersion=simGetModuleName(index)
if (moduleName=='Ros') then
pluginNotFound=false
end
index=index+1
end
if (pluginNotFound) then
simDisplayDialog('Error','ROS plugin was not found.&&nSimulation will not run properly',sim_dlgstyle_ok,false,nil,{0.8,0,0,0,0,0},{0.5,0,0,1,1,1})
else
-- Retrive the handle of the vision sensor we wish to stream:
lHandle=simGetObjectHandle('Pioneer_p3dx')
-- Now enable topic publishing and streaming of the vision sensor's data:
topicName=simExtROS_enablePublisher('p3dx',1,simros_strmcmd_get_object_pose,lHandle,0,'')
if (topicName == nil) then
simDisplayDialog('Error','Nil',sim_dlgstyle_ok,false,nil,{0.8,0,0,0,0,0},{0.5,0,0,1,1,1})
else
simDisplayDialog('Error','Not Nil',sim_dlgstyle_ok,false,nil,{0.8,0,0,0,0,0},{0.5,0,0,1,1,1})
end
-- Retrive the handle of the passive vision sensor. We will use the passive vision sensor
end
end
Any idea is welcome! Thanks in advance!
PS: Also, if anyone with 1500 reputation points could create the v-rep tag, that would be great!
Ok, the people at V-REP helped me solve it. So basically I should used the argument as -1 instead of 0.
So basically, a should have done this
topicName=simExtROS_enablePublisher('p3dx',1,simros_strmcmd_get_object_pose,lHandle,-1,'')
instead of
topicName=simExtROS_enablePublisher('p3dx',1,simros_strmcmd_get_object_pose,lHandle,0,'')

Editing Timeline from CCB file in cocos

I did some research into this and couldn't really find anything, so if this is a repetitive question I apologize. but anyway I have made a CCB file in CocosBuilder and I would like to start the timeline, for example, at one second instead of playing from the beginning. Is there a way to do this? Thanks for the help guys.
Edit: i would like this to be done in the code.
I am using 2.2.1 Cocos2DX version. I think there is no option to play it from given interval. But you can tweak yourself to get it done. (Not simple one)
You have to go to CCBAnimationManager and there you get "mNodeSequences".
It is dictionary and you get difference properties there like "rotation position etc..."
values there.
Internally AnimationManager reads this value (These values are specified in your CCB)
and puts in runAction queue.
So you have to break it as you want.(Ex. 5 min timeline you have. But you want to start
from 1 min then you have run first 1 min Actions without delay and for remaining you
have properly calculate tween intervals.
It's long procedure and needs calculation. If you don't know any other simpler way try this. If you know pls let us know (Post it).

NSStream Event Timer - iPhone

All,
Is there a way to have a minimum time to keep a stream open before it closes? For some reason, my stream is closing prematurely which is causing errors elsewhere. I need to keep it open to make sure ALL of the data is gathered, and then it can run the other code.
Thanks,
James
In the case that someone falls upon this question later, I ended up creating nested if statements to pull it off.
Basically, there is one statement that checks if the end tag is not found (for my code, the END of the ENTIRE data that I should be receiving is </SessionData> - So, I did if([outputString rangeOfString:#"</SessionData>"].location == NSNotFound). I created a string called totalOutput that would have the outputString added onto the end of totalOutput until the </SessionData> is found.
If anyone ever needs help, just go ahead and comment on here and I can give more information.