Note that there are some explanatory texts on larger screens.

plurals
  1. POCompiler error message error:expected ')' before '*' token. Error with my constructor
    text
    copied!<p>I keep getting the following compiler error </p> <blockquote> <p>In file included from /home/armon/Development/groovy_workspace/sandbox/smart_wheelchair/trunk/smart_wheelchair/state_machine_planner/src/BasicControllerState.cpp:1:0: /home/armon/Development/groovy_workspace/sandbox/smart_wheelchair/trunk/smart_wheelchair/state_machine_planner/include/state_machine_planner/BasicControllerState.h:38:49: error: expected ‘)’ before ‘*’ token<br> /home/armon/Development/groovy_workspace/sandbox/smart_wheelchair/trunk/smart_wheelchair/state_machine_planner/src/BasicControllerState.cpp:4:44: error: expected constructor, destructor, or type conversion before ‘(’ token In file included from /home/armon/Development/groovy_workspace/sandbox/smart_wheelchair/trunk/smart_wheelchair/state_machine_planner/include/state_machine_planner/StateMachinePlanner.h:16:0, from /home/armon/Development/groovy_workspace/sandbox/smart_wheelchair/trunk/smart_wheelchair/state_machine_planner/src/ControllerNode.cpp:4: /home/armon/Development/groovy_workspace/sandbox/smart_wheelchair/trunk/smart_wheelchair/state_machine_planner/include/state_machine_planner/BasicControllerState.h:38:49: error: expected ‘)’ before ‘<em>’ token make[3]: <strong></em> [CMakeFiles/state_machine_planner.dir/src/BasicControllerState.cpp.o] Error 1 make[3]: *</strong> Waiting for unfinished jobs.... In file included from /home/armon/Development/groovy_workspace/sandbox/smart_wheelchair/trunk/smart_wheelchair/state_machine_planner/include/state_machine_planner/StateMachinePlanner.h:16:0, from /home/armon/Development/groovy_workspace/sandbox/smart_wheelchair/trunk/smart_wheelchair/state_machine_planner/src/StateMachinePlanner.cpp:1: /home/armon/Development/groovy_workspace/sandbox/smart_wheelchair/trunk/smart_wheelchair/state_machine_planner/include/state_machine_planner/BasicControllerState.h:38:49: error: expected ‘)’ before ‘*’ token<br> /home/armon/Development/groovy_workspace/sandbox/smart_wheelchair/trunk/smart_wheelchair/state_machine_planner/src/StateMachinePlanner.cpp: In constructor ‘state_machine_planner::StateMachinePlanner::StateMachinePlanner()’:<br> /home/armon/Development/groovy_workspace/sandbox/smart_wheelchair/trunk/smart_wheelchair/state_machine_planner/src/StateMachinePlanner.cpp:9:30: error: no match for call to ‘(state_machine_planner::BasicControllerState) (costmap_2d::Costmap2DROS*&amp;)’</p> </blockquote> <p>BasicControllerState is a member of StateMachinePlanner</p> <p>here is the code,</p> <p>BasicControllerState.h (relevant piece):</p> <pre><code>class BasicControllerState { public: BasicControllerState(){} BasicControllerState(costmap_2d::costmap2DROS* costmap_ros); </code></pre> <p>BasicControllerState.cpp:</p> <pre><code>#include &lt;state_machine_planner/BasicControllerState.h&gt; namespace state_machine_planner { BasicControllerState::BasicControllerState(costmap_2d::costmap2DROS* costmap_ros) { //init trajectory parameters specific to what state the child class represents //init sim_time_ and sim_granularity_ //init sample space limits //init best_score_thresh_ obstacle_dist_cost_gain_ = 0.1; heading_diff_cost_gain_ = 0.0; linear_vel_cost_gain_ = 0.0; omega_cost_gain_ = 0.0; num_of_linvel_samples_ = 20; num_of_angvel_smaples_ = 40; costmap_ros_ = costmap_ros; costmap_ros_-&gt;getCostmapCopy(costmap_); robot_footprint_ = costmap_ros_-&gt;getRobotFootprint(); world_model_ = new base_local_planner::CostmapModel(costmap_); } </code></pre> <p>StateMachinePlanner.h:</p> <pre><code>class StateMachinePlanner { public: StateMachinePlanner(); void init(int latency_command_queue_size, vel_params_struct vps, time_params_struct tps); void setKey(key_command_t key); geometry_msgs::Twist computeVelocityCommands(); private: std::deque&lt;Eigen::Vector2f&gt; latency_command_queue_; int latency_command_queue_size_; vel_params_struct velocity_parameters_; time_params_struct time_parameters_; navigation_state_t current_state_; key_command_t key_command_; tf::TransformListener* tf_; costmap_2d::Costmap2DROS* costmap_ros_; costmap_2d::Costmap2D costmap_; BasicControllerState forward_state_; </code></pre> <p>StateMachinePlanner.cpp (where I instantiate it):</p> <pre><code>namespace state_machine_planner { StateMachinePlanner::StateMachinePlanner() : tf_(NULL), costmap_ros_(NULL) { tf_ = new tf::TransformListener(ros::Duration(10)); costmap_ros_ = new costmap_2d::Costmap2DROS("costmap",*tf_); costmap_ros_-&gt;getCostmapCopy(costmap_); forward_state_(costmap_ros_); } </code></pre> <p>Forgive me, I know it may seem trivial, but I was hoping to find some c++ wizard to bail me out. Have spent far too long on this one problem.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload