cannot find VehicleObstacleControl module -- in module (veins::PhyLayer80211p) - veins

I have encountered a critical issue in veins-5.2 simulation in the vehicle obstacle shadowing model as follows.
**initializeVehicleObstacleShadowing(): cannot find VehicleObstacleControl module -- in module (veins::PhyLayer80211p)
RSUExampleScenario.rsu[0].nic.phy80211p (id=11), during network initialization**
However, I can find VehicleObstacleControl module in the veins::PhyLayer80211p.cc as follows.
**unique_ptr<AnalogueModel> PhyLayer80211p::initializeVehicleObstacleShadowing(ParameterMap& params)
{
// init with default value
bool useTorus = world->useTorus();
const Coord& playgroundSize = *(world->getPgs());
ParameterMap::iterator it;
VehicleObstacleControl* vehicleObstacleControlP = VehicleObstacleControlAccess().getIfExists();
if (!vehicleObstacleControlP) throw cRuntimeError("initializeVehicleObstacleShadowing(): cannot find VehicleObstacleControl module");
return make_unique<VehicleObstacleShadowing>(this, *vehicleObstacleControlP, useTorus, playgroundSize);
}**
I highly appreciate if you could provide me with some guidance so that I can resolve this problem.
Thank you in advance.
BR.

I have encountered the exactly same issue here. This error can be traced back to PhyLayer80211p.cc and VehicleObstacleControl.h within Veins, and further into OMNet++ files like csimulation.h and cmodule.h. It seems that the wanted scenario just could not find the path of vehicleObstacles (however, for the SimpleObstacleShadowing model, the scenario could find the path of obstacles), which is extremely confusing.
Solved already. In the OMNet++ world, just do not forget about those .ned files. Some modifications needs to be done in the scenario.ned file.

Related

(ROS) Failed to create global planner

My setup is: ROS melodic, Ubuntu: 18.04
I want simulate turtlebot3 moving with my own global planner and have been following this tutorial to get started: http://wiki.ros.org/navigation/Tutorials/Writing%20A%20Global%20Path%20Planner%20As%20Plugin%20in%20ROS#Running_the_Plugin_on_the_Turtlebot. The tutorial seem to be made for ROS hydro, but as it was the best source of guidance I could find I hoped it would work.
The error I'm having is:
Failed to create the global_planner/GlobalPlanner planner, are you sure it is properly registered and that the containing library is built? Exception: MultiLibraryClassLoader: Could not create object of class type global_planner::GlobalPlanner as no factory exists for it. Make sure that the library exists and was explicitly loaded through MultiLibraryClassLoader::loadLibrary()
To my knowledge I've followed the tutorial as much as possible with a only a few things done differently because I wanted to test it, couldn't do as the tutorial asked, or because I thought it wouldn't impact the results. What I have done differently is:
I use the carrot_planner.h and carrot_planner.cpp files in the tutorial section 1 to test that it works before trying with my own code to avoid confusion about where possible errors come from. It's not 'different' from the tutorial to my knowledge, but figured I'd mention it. They are placed in catkin_ws/src/carrot_planner/src/global_planner/
The ros package I'm working from is in catkin_ws/src and is called the carrot_planner. In the tutorial step 1.3 I use add_library(global_planner_lib src/global_planner/carrot_planner.cpp). Would not imagine it affects the results either.
In section 3 of the tutorial it mentions that 'First, you need to copy the package that contains your global planner (in our case global_planner) into the catkin workspace of your Turtlebot (e.g. catkin_ws).' Since my package was already in catkin_ws/src/ I haven't moved it since I guess I didn't need to.
I've altered the 'move_base.launch' file in '/opt/ros/melodic/share/turtlebot3_navigation/launch/' instead of the 'move_base.launch.xml' in '/opt/ros/hydro/share/turtlebot_navigation/launch/includes/' as there doesn't seem to be a destination '...turtlebot3_navigation/launch/includes/'. There are files in launch, but no includes folder. Maybe that a difference from Hydro to Melodic, I don't know. There may be a whole lot of things that need to be done differently from the tutorial when using Melodic, or with turtlebot3, but I don't know.
I haven't made my own launch file for bringup of the turtlebot, but have instead followed this tutorial (https://emanual.robotis.com/docs/en/platform/turtlebot3/nav_simulation/) to guide me with turtlebot3. After finishing this step in the global planner tutorial 'Save and close the move_base.launch.xml. Note that the name of the planner is global_planner/GlobalPlanner the same specified in global_planner_plugin.xml. Now, you are ready to use your new planner' I tested whether it worked by running: 'roslaunch turtlebot3_gazebo turtlebot3_world.launch' and then I tried running: 'roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=$HOME/map.yaml' which led to the error I showed above. I have created the map-yaml, so there's no misunderstanding whether that's missing.
I would be very glad for any help, thank you ^^
Edit: My system only had 'navfn' on it, not 'global_planner' or 'carrot_planner', if that makes a difference.
After looking over the code I found a solution. It doesn't make everything work perfectly yet, but seems to solve the immediate problem.
The problem was that in my 'global_planner_plugin.xml' I just used the code provided in the tutorial:
<library path="lib/libglobal_planner_lib">
<class name="global_planner/GlobalPlanner" type="global_planner::GlobalPlanner" base_class_type="nav_core::BaseGlobalPlanner">
<description>This is a global planner plugin by iroboapp project.</description>
</class>
</library>
But in the carrot_planner.cpp file it says:
PLUGINLIB_EXPORT_CLASS(carrot_planner::CarrotPlanner, nav_core::BaseGlobalPlanner)
Changing type="global_planner::GlobalPlanner to type="carrot_planner::CarrotPlanner and then launching turtlebot3 doesn't give the same error anymore.

Custom submodules in pytorch / libtorch C++

Full disclosure, I asked this same question on the PyTorch forums about a few days ago and got no reply, so this is technically a repost, but I believe it's still a good question, because I've been unable to find an answer anywhere online. Here goes:
Can you show an example of using register_module with a custom module?
The only examples I’ve found online are registering linear layers or convolutional layers as the submodules.
I tried to write my own module and register it with another module and I couldn’t get it to work.
My IDE is telling me no instance of overloaded function "MyModel::register_module" matches the argument list -- argument types are: (const char [14], TreeEmbedding)
(TreeEmbedding is the name of another struct I made which extends torch::nn::Module.)
Am I missing something? An example of this would be very helpful.
Edit: Additional context follows below.
I have a header file "model.h" which contains the following:
struct TreeEmbedding : torch::nn::Module {
TreeEmbedding();
torch::Tensor forward(Graph tree);
};
struct MyModel : torch::nn::Module{
size_t embeddingSize;
TreeEmbedding treeEmbedding;
MyModel(size_t embeddingSize=10);
torch::Tensor forward(std::vector<Graph> clauses, std::vector<Graph> contexts);
};
I also have a cpp file "model.cpp" which contains the following:
MyModel::MyModel(size_t embeddingSize) :
embeddingSize(embeddingSize)
{
treeEmbedding = register_module("treeEmbedding", TreeEmbedding{});
}
This setup still has the same error as above. The code in the documentation does work (using built-in components like linear layers), but using a custom module does not. After tracking down torch::nn::Linear, it looks as though that is a ModuleHolder (Whatever that is...)
Thanks,
Jack
I will accept a better answer if anyone can provide more details, but just in case anyone's wondering, I thought I would put up the little information I was able to find:
register_module takes in a string as its first argument and its second argument can either be a ModuleHolder (I don't know what this is...) or alternatively it can be a shared_ptr to your module. So here's my example:
treeEmbedding = register_module<TreeEmbedding>("treeEmbedding", make_shared<TreeEmbedding>());
This seemed to work for me so far.

Implementation of active appearance models

I'm having an internship in the field of computer vision, and i am really interested to know some details about the implementation of the Active Appearence Models aam-opencv that exists in the Google Code site.
In fact, i downloaded aam-opencv.tar.gz then built it with cmake and i solved some syntax problems but the only error that i am still having when i try to generate the solution is the following :
This function should return something:
aamImage* delaunay:: warpImageToMeanShape(aamImage*input)
{
}
I wonder if there is something missing in that function, or is it a compiler problem.
Please give me an answer or just guide me to complete the missing part of that function.
I would really appreciate if anyone kindly help me.
Thank you.
I suppose that is not used in code function, so it is not important what it return. Some C++ compilers allow to write such code and give only warning, another treat as errors:
ReturnType f()
{
}
looks like you use not the same compiler as author of source code. So just add something like:
aamImage* delaunay:: warpImageToMeanShape(aamImage*input)
{
return NULL;
}

Class redeclaration error on targetEntity="Y" within ZF2

I am facing a weird error within my codebase currently. You can see the full ZF2s project code on my github right here. <- there's a link
I'm having a Module set up with two Entities (X and Y). Entity_X contains a reference to Entity_Y via (targetEntity="Entity_Y"). The Error persist with the FQCN or just the CN itself.
Entity_X:
id int PK,
id_Y int FK,
text varchar
Entity_Y:
id int PK,
text varchar
When loading Entity_Y first and then Entity_X everything is working fine. This remains true for both StandardAutoloader and ClassMapAutoloader. However: when loading Entity_X first with ClassMapAutoloader present, i will be seeing the following error:
Fatal error: Cannot redeclare class Kennzahlen\Entity\Referenzwert (Entity_Y)
in \module\Kennzahlen\src\Kennzahlen\Entity\Referenzwert.php
on line 13
Loading Entity_X first with StandardAutoloader works without any problems, too.
Update
The Problem appears to be within ZF2s ClassMapAutoloader (or Autoloading-Mechanism in General). My Module used the ClassMapAutoloader and using this i've gotten the above mentioned error. When removing the ClassMapAutoloader and simply using the StandardAutoloader, the error vanished into thin air. Thanks to #ocramius and all others i've botheres with this :)
I'm writing a failing test case to try and solve this in doctrine/common. The problem seems to be that silent autoloaders (as explained by #Xerkus) are not compatible with doctrine/common itself. To solve that, use a StandardAutoloader from ZF2 (or from composer) instead of using the ClassMapAutoloader. This will solve the issue until a patch is ready.
Update: patch is being suggested at doctrine/common#216
i have no knowledge of doctrine, but i browsed through source and i think i found issue:
https://github.com/doctrine/common/blob/master/lib/Doctrine/Common/ClassLoader.php#L224
here, this code expects that autoloader will return value evaluated to true, but that is not requirement of spl autoload mechanism, therefore autoloader can return NULL,
To check if i am correct, in in your project in doctrine replace line 224 in Doctrine/Common/ClassLoader.php
} else if ($loader[0]->{$loader[1]}($className)) {
with
} else if ($loader[0]->{$loader[1]}($className) && class_exists($className, false)) {
Ans see if issue is fixed, if i am correct - then report bug to doctrine project

Microsoft Dynamics AX 2009: Error executing code: Wrong argument types in variable assignment

I have added an object member to InventMovement class and have created one parameter method for the same but following line of code is popping up above error:
movement.parmProdJournalId(this.JournalId);
JournalId parmProdJournalId(JournalId _prodJournalId = prodJournalId)
{
;
prodJournalId = _prodJournalId;
return prodJournalId;
}
After adding the object member and parameter method I have also compile forward InventMovement but no success. Will appreciate if anyone of you could help me in this regard
Rgds
PS: I am doing the same thing which is mentioned in this blog post: http://www.artofcreation.be/2009/04/04/wrong-argument-types-in-variable-assignment/
I stopped the AOS, renamed AXAPD.AOI file and restarted the AOS. This resolved the problem. I got this solution from other forum where also I posted this question.
It is kind of strange, should work.
I could not reproduce your problem, but once had a similar problem. Solved it by re-compiling and synchronizing every involved class and table (more than once).
Also make sure nobody else is using any of these objects, maybe best is to restart the AOS.
EDIT (after comment on question):
Another possibility: it seams that you are also mixing JournalId and ProdJournalId.
I think the parameter and return value of parmProdJournalId should also be ProdJournalId.
Just try this one:
ProdJournalId parmProdJournalId(ProdJournalId _prodJournalId = prodJournalId)
{
;
prodJournalId = _prodJournalId;
return prodJournalId;
}
could not try it myself since I could'nt reproduce the error
If you can't restart the AOS, delete the local cache files of the client might work, i.e. *.auc from:
C:\Documents and Settings\Local Settings\Application Data