Ros2 RViz: Can't update static costmap layer, no map received - python

I have the following project, a 4 wheeled robot based on ROS2 official documentation and
some additional Internet sources.
The link points to a ZIP, simply unpacking it inside "src" of a ROS2 workspace should be sufficient.
Link: https://drive.google.com/file/d/1ZmeCwVyIyx-YxXgc8N7IfW2KdkjQGAxS/view?usp=sharing
In a zip, the lidar is commented out, just so it doesn't clog the picture.
However, before that, I had it enabled, navigated the robot around and got a map (it is in a "maps" folder now).
The next step - one I failed - was to load the map into RViz.
What I do:
Terminal 1:
ros2 launch navigation_bot_05 main_simulation_launch.py world:=src/worlds/maze.sdf map:='src/maps/map.yaml' slam:=False
This brings up RViz and Gazebo, but RViz doesn't show the robot yet, as it is configured
to show map, which is not there yet. To fix it:
Terminal 2:
ros2 launch slam_toolbox online_async_launch.py
Now we have a robot and (if we enable lidar) it can drive around and scan.
... and I am getting "[global_costmap.global_costmap]: Can't update static costmap layer, no map received"
Could someone please tell me how to fix this package and what is wrong in it?
Thank you.

Related

How to obtain data from a marker in VSA software that is running on a computer?

I am using Keysight Command Expert to help me to develop automated testing. I set a marker to try to obtain the result from OBW and ACP measurement. However, I didn't find appropriate SCPI commands for 89600VSA software that is running on the computer that will allow me to read data from the marker or allow me to create a new trace that can be set to display the data of either measurement. Please help.
If you search the helpfile for marker, the 100th entry is Examples and in there you'll find a lot of SCPI code including:
Working with Markers
:INIT:IMM;*OPC?
TRACe1:MARKer1:MAX
TRACe1:MARKer1:Y?
TRACe1:MARKer1:X?
TRACe1:MARKer2:MAX
TRACe1:MARKer2:DOWN
TRAC:MARK2:TYPE DELTA
This gives you an idea of some of the different commands available.
In the end, the code I used for creating an OBW or ACP window is
:TRACe3:DATA:NAME "Obw Summary TrcA"
:TRACe3:DATA:NAME "Acp Summary TrcA"
This creates an Obw or Acp data summary of trace 1 in the third window. Normally, you will create an empty trace beforehand simply by using
:TRACe1:ADD
This webpage tells me how to formulate an SCPI command that is equivalent to an instruction set by using GUI. In short, go to Window > Output and click Show Code checkbox to enable. This shows the .NET API command that is sent to the instrument when you perform an operation. Then, take the last bit of the .NET API command which is after '.' to find an equivalent SCPI command.

How to extend robot-ide (RIDE) to have a tab so that I can drag and drop robot script commands?

I am trying to extend RIDE to have some custom functionality like an extra tab which can hold some diagram with commands (commands editable) and these can be drag and dropped to the right side to have a flow chart which will have the robot script commands.
I have downloaded RIDE source code https://github.com/robotframework/RIDE.
I am relatively new to python programming. Could you please help me get started with this. Any tutorial/pdf related to this will be helpful for me?
Thanks.
You should go to the project page's Wiki, there should be some useful information.
The best approach is to create a standalone program outside of RIDE, and later adapt to be used as a Plugin.
Most important is to learn wxPython, and for that is mandatory to at least run its Demo.

Run a script in Maya by right clicking UI?

I'm fairly new to python, and I am trying to run the code I wrote when I right click the playback range windows in the timeline of maya (where you type your min or max range) . I managed to find ways to run scripts within the attribute editor / timeline / shelf items, but I cant seem to figure out how to interact with Maya's UI... Even typing a new value in there doesn't update the script editor, so I don't really have a lead on where to go. Any help would be fantastic!
you basically want to add a menu item in the timeslider ?. You can get all maya widget using OpenMayaUI.MQtUtil and here is a full repo which modify timeline control https://github.com/robertjoosten/maya-timeline-marker
Everything Maya does when using the UI logs data in the script editor.
Many items in the log are suppressed though as it would spam the log.
To enable it, activate Echo all commands (can be found in script editor under History), then clear the script editor and perform the action you want logged.
You will find that Maya executes a lot of mel script functions, which you can all find in the maya install directory under [MAYA_INSTALL_DIR]/scripts/startup and [MAYA_INSTALL_DIR]/scripts/others
To find the essential function you will have to search a little through the log.
Once you got a mel function you want to look for, I recommend using a find in files search function like the one in Notepad++, to find the corresponding .mel file in which the global proc is defined.
Also note that UI element names that are logged in script editor may have a different name the next time you start maya. So you will have to add functionality to search for the correct UI element name.
The Maya mel scripts are a good resource to find out all sorts of things about how the UI works, including contextual marking menus and the commands of tool windows.

Automatically controlling an app on the PC using openCV Python

I am working on a project to control the PC exclusively by voice control and gestures(via webcam). So, with the voice control I open the app(for example, YouTube). Now, without typing anything on the search bar, I want to do it through voice typing (without even touching the keyboard), like if I say "search water videos" the cursor will automatically search the thing for me, and give me the result.
Basically, I want to find a text box on a screen of an app using image processing.
There shall be some predefined keywords like, search(for searching), delete(for deleting anything that is mistyped) Go Back(to go back to the previous window), Exit(for exiting the app).
Can it be done with the help of openCV Python?
Many thanks in advance!

Python program Airnef stuck while downloading images

I am using Airnef to download pictures from my Canon DSLR camera through python.
I can download one picture without problems so the whole setup seems to work. However, as soon as I want to download another image the software hangs. The code to me looks quite complex.
Two months ago I did post a thread on TestCams.com. Since I haven't gotten a response, I post this as a python-related question here.
The thread
I start airnef from the command line.
python airnefcmd.py --ipaddress 192.168.188.84 --action getfiles --realtimedownload only --downloadexec open #pf# --transferorder newestfirst --outputdir "/Users/besi/Desktop"
I connect the camera and I’m shown some information about my connection:
Connection established to 192.168.188.84:15740
Camera Model “Canon EOS 200D”, S/N “XXXXXXXXX”
Now airnef tells me:
Waiting for realtime photos from camera to download.
Press to exit |
I take a picture and it downloads it as expected:
Downloading “IMG_0084.JPG”: 96%
Airnef then shows some more information about this image:
/Users/besi/Desktop/IMG_0084.JPG [size = 4,602,357] in 1.94 seconds (2.26 MB/s)
I take some more pictures but they’re not downloaded and the software is stuck at the prompt:
Waiting for realtime photos from camera to download. Press to exit \
Source code
The source code is available at the Airnef Website. I created a github repository for tackling this issue: https://github.com/besi/airnef
The place where the code is stuck is at airnefcmd.py:3203
Update: Forum Post
Here is the link to the forum post on testcams.com
Update: Debugging
The first image called IMG_0182 was downloaded successfully.
In the debug output I can see a new picture being taken, but the download is skipped because the prior image was already downloaded:
See airnef.log:433:
filename = DCIM\100CANON\IMG_0183.JPG
captureDateSt = 20180926T071759
modificationDateStr= 20180926T071758
A new image called IMG_0183.JPG was found.
Skipping IMG_0182.JPG - already downloaded this session
The old downloaded image seems to block the further processing of the current image.
Skipping 100CANON - object is not file - MTP_OBJFORMAT_Assocation (0x3001)
Skipping DCIM - object is not file - MTP_OBJFORMAT_Assocation (0x3001)
Waiting for realtime photos from camera to download. Press <ctrl-c> to exit -execMtpOp: MTP_OP_GetObjectHandles - CmdReq payload:
Now we end up again in the loop waiting for more pictures.
When a new picture is taken, the same procedure happens again.
I don't have a compatible camera, so I'm basing my answer solely on the logs (in Debug mode) posted on the forum. Also it was a trial and error suggestion in one of the comments, so it's not the "scientific" approach (where the cause is being identified, and then fixed).
A team (#Besi and I) effort was required in order to come up with this answer (and the credit should be split accordingly).
According to logs, there is a difference between how the 2 files are handled:
...
filename = DCIM\100CANON\IMG_0182.JPG
captureDateSt = 20180926T071747
modificationDateStr= 20180926T071748
Download history file “/Users/besi/Library/Application Support/airnef/appdata/Canon EOS 200D-SN59074c1578e347a3bf1f6f85e8dec624-downloadhist” loaded – 53 entries
>> MTP_OP_GetObject
Downloading “IMG_0182.JPG”: 0%IMG_0182.JPG – downloading next piece, offset=0x0, count=0x100000
...
filename = DCIM\100CANON\IMG_0183.JPG
captureDateSt = 20180926T071759
modificationDateStr= 20180926T071758
Skipping IMG_0182.JPG – already downloaded this session
Skipping 100CANON – object is not file – MTP_OBJFORMAT_Assocation (0x3001)
Skipping DCIM – object is not file – MTP_OBJFORMAT_Assocation (0x3001)
Waiting for realtime photos from camera to download. Press <ctrl-c> to exit -execMtpOp: MTP_OP_GetObjectHandles – CmdReq payload:
...
As seen when handling the 2nd file (IMG_0183.JPG), the existence of the 1st one (IMG_0182.JPG), triggers everything to be abandoned.
Browsing [TestCams]: airnef - Wireless download from your Nikon Camera!, one of the command line argument (actually, there were more that I suggested) caught my eye: --rtd_mtppollingmethod_newobjdetection, and I suggested specifying numobjs (and thus, overriding the default). Apparently, this was the (main) problem. The other part was the presence of --transferorder newestfirst. By default, in Realtime Download mode, it's set to oldestfirst (see below). Removing it (or redundantly specifying --transferorder oldestfirst) did the trick.
Conclusion
In order to fix the problem, 2 things were necessary (in terms of cmdline args for airnefcmd.py):
Specify --rtd_mtppollingmethod_newobjdetection numobjs
Remove --transferorder newestfirst
According to [GitHub]: besi/airnef - (master) airnef/airnefcmd.py#3403:
g.args['transferorder'] = 'oldestfirst' # so that downloadMtpFileObjects() will properly enumerate through multiple realtime images as we add them
I consider this a bug on airnef's side (regarding --transferorder). It's located in either
Code: --transferorder should be ignored when in Realtime mode
Doc: Specify that --transferorder newestfirst is not compatible with Realtime mode

Categories

Resources