
787 N.E.2d 858 (2003)
337 Ill. App.3d 849
272 Ill.Dec. 672
The PEOPLE of the State of Illinois, Plaintiff-Appellant,
v.
Montaous E. THOMPSON and Martin G. Hernandez, Defendants-Appellees.
No. 4-02-0129.
Appellate Court of Illinois, Fourth District.
March 28, 2003.
*860 Frank Young, State's Attorney, Danville, Norbert J. Goetten, Director, Robert J. Biderman, Deputy Director, James C. Majors, Staff Attorney, State's Attorneys Appellate Prosecutor, Springfield, for the People.
Daniel D. Yuhas, Deputy Defender, Erica R. Clinton, Assistant Defender, Office of State Appellate Defender, Springfield, for Montaous E. Thompson.
David J. Ryan, Dukes, Ryan, Meyer, Fahey & Freed, Ltd., Danville, for Martin G. Hernandez.
Justice COOK delivered the opinion of the court:
The State filed an appeal from the February 4, 2002, order of the Vermilion County circuit court granting defendants' motion to quash arrest and suppress the evidence. The State filed a notice of appeal and certificate of impairment on the same day.

I. BACKGROUND
On October 27, 2001, at approximately 7:40 p.m., Officers Terry McCord and Ronald Soderstrom were patrolling the Green Meadow Housing Project. There is an insignificant dispute regarding where the officers were located at that time. According to Officer McCord, the officers were traveling west on Edgewood Street when they observed defendants, Montaous E. Thompson and Martin G. Hernandez, walking in the middle of Edgewood Street heading away from the Green Meadow Housing Project on the south side of the street toward Hernandez's truck parked in a lot on the north side of the street. Officer Soderstrom testified the officers were parked in a lot east of Edgewood Street. Regardless, both officers testified defendants turned, appeared to notice the officers' car, and quickened their pace toward Hernandez's truck. Hernandez entered the driver's side of the truck and started it while Thompson entered the passenger's side. The officers were not aware of any crime about to be committed or recently committed in the area but stopped defendants pursuant to an interagency agreement between the Danville police department and the Hispanic Housing Authority (interagency agreement) authorizing Danville police officers to stop and identify any unknown persons on the property. The officers parked their police car behind Hernandez's truck to block it from leaving. They then shined their spotlights on the truck. Officer McCord noticed the truck had an Illinois registration. He approached Hernandez, who was sitting in the driver's seat of the truck. Officer McCord testified Hernandez acted nervous: he would not make eye contact, he consistently watched Thompson, and he rubbed his pants "kinda rocking back and forth in an unusual manner." Hernandez produced an Indiana driver's license. Once Hernandez gave Officer McCord his driver's license, Officer McCord realized Hernandez was neither a resident of Green Meadow Public Housing nor on its bar list. Although Hernandez admitted the truck belonged to him, he could not explain the inconsistency between the Indiana driver's license and the Illinois registration.
Due to Hernandez's nervous actions, Officer McCord asked Hernandez to step out *861 of the truck. He wanted to separate defendants, a common police practice when working in drug areas. Officer McCord asked Hernandez where he was coming from and if he knew Thompson. Hernandez explained he was in the area to drop off a friend who had just been released from jail when Thompson approached him and asked for a ride down the street. Hernandez could not advise Officer McCord of the friend's name or where the friend lived. Next, Officer McCord asked Hernandez if he had any illegal drugs and for permission to search him. Hernandez denied having any illegal drugs and consented to a search. Officer McCord found nothing illegal on Hernandez's person.
Officer Soderstrom obtained Thompson's identification, and Officer McCord ran Thompson's and Hernandez's identifications through communications. There were no warrants out for either defendant, and the truck license was valid through Indiana. Upon returning to the truck, Officer McCord asked Hernandez if he could search the truck. Hernandez consented. Above the driver's visor, Officer McCord found three small clear plastic bags containing cocaine inside a larger sandwich bag. Once the cocaine was recovered, both defendants were handcuffed and placed into custody. Thompson was searched and nothing was found on his person. Officer Josh Campbell arrived at the scene and searched the truck further. In between the console and the driver's seat, Officer Campbell found a brown pill bottle containing a clear plastic bag with one rock of cocaine. A taped statement was taken from Thompson wherein he admitted purchasing cocaine and placing it in the pill bottle found in the truck. Hernandez and Thompson were each charged with possession of a controlled substance (720 ILCS 570/402(c) (West 2000)) and possession of a controlled substance with intent to deliver (720 ILCS 570/401(c)(2) (West 2000)).
Before ruling on defendants' motions to quash arrest and suppress the evidence, the trial court noted the issue was whether the officers engaged in a community-caretaking encounter (see People v. Murray, 137 Ill.2d 382, 387-88, 148 Ill.Dec. 7, 560 N.E.2d 309, 311-12 (1990); Cady v. Dombrowski, 413 U.S. 433, 441, 93 S.Ct. 2523, 2528, 37 L.Ed.2d 706, 714-15 (1973)) or a Terry stop (see Terry v. Ohio, 392 U.S. 1, 88 S.Ct. 1868, 20 L.Ed.2d 889 (1968)). The court concluded the officers were engaged in a community-caretaking encounter but exceeded the scope of the encounter by parking their police car in such a way, as was admitted by the officers, that the defendants were not free to leave in the truck. The court acknowledged that the only expressed purpose for the stop was to determine whether the defendants were subject to the interagency agreement. The court found there was no observation or suspicion of the commission of any crime and officer safety was not an issue. As a consequence, the court found the detention and subsequent requests for consent unlawful. The court granted both defendants' motions to quash the arrests, suppress all evidence seized as a result of the searches of the defendants and their truck, and suppress all statements made by either defendant. This appeal followed.

II. ANALYSIS
At a hearing on a motion to suppress, it is the function of the trial court to determine the credibility of the witnesses, the weight to be given to their testimony, and the inferences to be drawn from the evidence. Accordingly, the trial court's ruling on a motion to suppress generally will not be overturned unless it is manifestly erroneous. Manifestly erroneous means arbitrary, unreasonable, and not based on the evidence. However, de novo review is appropriate when neither the facts nor the credibility of witnesses is questioned. *862 People v. Ballard, No. 88885, slip op. at 7 (August 29, 2002), ___ Ill.2d ___, ___, ___ Ill.Dec. ___, ___ N.E.2d ___, ___, 2002 WL 1987961.
On appeal, the State asserts three theories under which the arrests and seizure of evidence were valid: (1) the officers engaged in a community-caretaking function and performed a consensual search, (2) the officers performed a Terry stop and consensual search, or (3) the officers had probable cause to arrest defendants and made a proper search incident to arrest.
We address the State's first theory and discuss whether the initial stop was a valid exercise of the officers' community-caretaking function. At trial, the State elicited testimony from both officers that the only reason they stopped defendants was to ascertain their identity pursuant to the interagency agreement. Under the terms of this agreement, Danville police officers are agents of the Hispanic Housing Authority and are authorized to stop and identify any subject on the property not known to the officer. The officers are given a list of residents and a list of people who have been barred from the property. If an individual is identified as a resident, he is immediately released. If an individual is identified as a nonresident and not on the bar list, then the officer may ask his reason for being on the property. If it is a valid reason, such as visiting, the individual is released. If the individual cannot give a reason for being on the property, then he is asked to leave the property. Community-caretaking encounters involve consensual contact between police officers and members of the community. People v. Dale, 301 Ill.App.3d 593, 600, 234 Ill.Dec. 827, 703 N.E.2d 927, 932 (1998). A community-caretaking encounter can be characterized as an illegal seizure if the officer's conduct exceeds the scope of the encounter. People v. Avant, 331 Ill.App.3d 144, 149, 264 Ill.Dec. 716, 771 N.E.2d 420, 425 (2001). A person is seized when, by means of physical force or a show of authority, his freedom of movement is restrained and, in view of all of the circumstances surrounding the incident, a reasonable person would have believed he was not free to leave. People v. Brownlee, 186 Ill.2d 501, 517, 239 Ill.Dec. 25, 713 N.E.2d 556, 564 (1999) (defendants were seized when, following the conclusion of a lawful traffic stop, two officers, positioned on each side of defendant's car, remained silent and did not move from their stations for a two-minute period); People v. Gherna, 203 Ill.2d 165, 180, 271 Ill.Dec. 245, 784 N.E.2d 799, 808 (2003) (defendant was seized when two uniformed officers blocked defendant's exit by positioning their bicycles on each side of defendant's "full[-] sized" truck and requested to examine a bottle of beer located in defendant's truck "on the heels of other questioning").
In this case, the officers admitted they used their police car to block Hernandez's truck and prevent defendants from leaving. The officers also shined a spotlight on the truck. Under the circumstances, a reasonable person in defendants' position would not feel free to leave. The officers exceeded the scope of the community-caretaking encounter by illegally seizing defendants. Once the illegal seizure occurred, that illegality tainted the consent, evidence, and arrests that subsequently resulted. Brownlee, 186 Ill.2d at 521, 239 Ill.Dec. 25, 713 N.E.2d at 566.
Next, we address whether the initial stop was valid as a Terry stop. A stop is warranted under Terry if the officer has "knowledge of sufficient articulable facts at the time of the encounter to create a reasonable suspicion that the person in question has committed, or is about to commit, a crime' [citation]." People v. Love, 199 Ill.2d 269, 275, 263 Ill.Dec. 808, *863 769 N.E.2d 10, 15 (2002). The detaining officer must consider the totality of the circumstances and must have a particularized and objective basis for suspecting the particular person stopped of criminal activity. Avant, 331 Ill.App.3d at 151, 264 Ill. Dec. 716, 771 N.E.2d at 426. We should not view the facts with analytical hindsight but instead should consider the facts from the perspective of a reasonable officer at the time the situation confronted him or her. Avant, 331 Ill.App.3d at 153, 264 Ill.Dec. 716, 771 N.E.2d at 427. The State argues the stop in this case was valid under Terry because the officers had a reasonable articulable suspicion to believe defendants (1) violated section 11-1007 of the Illinois Vehicle Code (Code) (625 ILCS 5/11-1007 (West 2000)), pedestrians walking on highways, (2) trespassed under the interagency agreement, and (3) took flight upon seeing the officers.
The State waived its argument that the officers had a reasonable articulable suspicion defendants violated one of the parts of section 11-1007(c) of the Code for walking in the center of Edgewood Street, a two-lane roadway. 625 ILCS 5/11-1007(c) (West 2000). Generally, a party waives its right to challenge an issue on appeal by having failed to raise the issue in the trial court. People v. Holloway, 86 Ill.2d 78, 91, 55 Ill.Dec. 546, 426 N.E.2d 871, 877 (1981). This rule is applicable to the State only when the prosecution is appealing the trial court's decision to grant a defendant's motion to suppress. People v. Rose, 191 Ill.App.3d 1083, 1095, 139 Ill.Dec. 163, 548 N.E.2d 548, 555 (1989). The State is precluded from arguing a new theory on appeal because it acquiesced in an inconsistent theory below. Rose, 191 Ill.App.3d at 1095, 139 Ill.Dec. 163, 548 N.E.2d at 555. A basic consideration supporting this rule is the danger of preventing the opposing party from presenting available, pertinent rebuttal evidence that could have a bearing on the disposition of the question. Holloway, 86 Ill.2d at 91-92, 55 Ill.Dec. 546, 426 N.E.2d at 877.
Although the opportunity arose, the State failed to argue or even mention a violation of the Code. On cross-examination, Thompson's attorney, William Sohn, asked Officer McCord to describe the road on which defendants were walking. During this discussion, Sohn brought out the fact that walking in the middle of the road is a violation of law.
"MR. SOHN: But walking in the road is not a violation of the law, correct Officer.
McCORD: Yes, it is.
MR. SOHN: And you had your headlights on as you came up from behind them?"
No further testimony considering whether defendants violated a law for walking in the middle of the road was elicited by Sohn from Officer McCord. Assistant State's Attorney Lisa Lovelace did not question Officer McCord about this matter on direct or redirect. After the attorneys finished questioning Officer McCord, the court clarified this matter.
"THE COURT: Mr. Sohn asked you about walking in the roadway as being a violation of a law. But that was not one of the reasons for the stop, correct?
OFFICER McCORD: Correct."
The officers themselves repeatedly admitted they did not observe defendants commit a violation of any law nor were they aware of any violation recently committed in the area. Further, the officers admitted the only reason they stopped defendants was to identify them pursuant to the interagency agreement. The trial judge did not have the opportunity to consider and defendants did not have the opportunity to rebut the alleged violation as a basis for a Terry stop.
*864 The State argues the officers had a reasonable articulable suspicion sufficient to perform a Terry stop because the officers observed defendants fleeing from the police. The officers testified they observed defendants appear to notice the officers and then walk quickly toward Hernandez's truck. Officer McCord stated in the police report following the incident "[o]fficers witnessed the above-listed arrestees walking in the middle of Edgewood Street west toward the above-listed S-10 pickup truck. Both subjects noticed officers' squad car traveling towards them, looked back at the squad car, and quickly got into the S-10." There is no indication from the record that defendants did anything more than "pick[] up their pace." The trial court found that when the officers first saw defendants, it was dark and it was likely that defendants were just getting out of the way from an oncoming car and did not see that it was a police car approaching. Nervousness on the part of a defendant when a police officer approaches is not enough to create a reasonable suspicion of criminal activity. People v. Simac, 321 Ill.App.3d 1001, 1004, 255 Ill.Dec. 94, 748 N.E.2d 798, 800 (2001).
The State also argues the officers had a reasonable articulable suspicion that defendants trespassed on Hispanic Housing Authority property. The State raised this issue at hearing but agreed during closing arguments to argue only the community-caretaking doctrine. At hearing, the State elicited testimony from both officers that the only reason the officers stopped defendants was to identify them pursuant to the interagency agreement. In closing argument, the prosecutor reiterated the officers' purpose but argued the initial stop was justified both as a community-caretaking encounter and as a Terry stop.
"MS. LOVELACE: But my point is that while they were investigating, that this was, in fact, an investigatory stop. It was a Terry stop. The investigation was basically determiningstrike that; was investigating a possible trespass to property.
THE COURT: Okay. So the State's position is this is not a community[-]caretaking encounter; this is a Terry stop?
MS. LOVELACE: Well, it's both.
THE COURT: Can't be both. The court's made it pretty clear you can't have both. They may merge one to the other, but they can't be both at the same time because the rights were distinctly different under a Terry stop versus a community[-]caretaking encounter. So take your pick. I mean you're free to pick either one.
MS. LOVELACE: Well, I think on the evidence that we have here and the discussion of the interagency agreement, I think basically what you're looking at is community caretaking.
THE COURT: All right.
MS. LOVELACE: And I would submit that in the course of community caretaking, that what these officers did was proper and within the scope of that; and we would ask the court to deny the motion to quash arrest and suppress evidence."
Although the State chose to argue the community-caretaking doctrine at hearing, the State is not precluded from arguing Terry on appeal. Waiver did not occur in this case because the trial judge and defendants had the opportunity to consider the State's argument regarding this issue. However, we agree with the trial court that the theories are inconsistent. A community-caretaking encounter is "totally divorced from the detection, investigation, or acquisition of evidence relating to the violation of a criminal statute." Avant, 331 Ill.App.3d at 149, 264 Ill.Dec. 716, 771 N.E.2d at 425. Such encounters do not involve coercion, detention, or seizure and, *865 therefore, do not implicate a defendant's fourth amendment rights. People v. Murray, 137 Ill.2d 382, 387, 148 Ill.Dec. 7, 560 N.E.2d 309, 311 (1990). The trial court stated a police-citizen encounter cannot be both a community-caretaking stop and a Terry stop at the same time because "the rights are distinctly different." The interagency agreement gave the officers authority under certain circumstances to perform a community-caretaking encounter and nothing more. Therefore, the interagency agreement cannot be the basis for forming a reasonable articulable suspicion of criminal activity.
Finally, the State argues the initial stop was justified because the State had probable cause to believe defendants committed a violation of section 11-1007 of the Code. 625 ILCS 5/11-1007 (West 2000). The State waived this argument by failing to raise it in the trial court. Holloway, 86 Ill.2d at 91, 55 Ill.Dec. 546, 426 N.E.2d at 877.
We note that there were no circumstances in this case sufficient to reinvest the officers with the authority to continue detaining defendants after the illegal seizure. Hernandez gave a valid reason for being on the property, defendants were not on the Hispanic Housing Authority bar list, defendants' licenses were valid, there were no warrants for their arrest, nothing illegal was found on defendants' persons, and there is no evidence that officer safety was an issue. Defendants' nervousness alone was not enough to warrant detention and search. Simac, 321 Ill.App.3d at 1004, 255 Ill.Dec. 94, 748 N.E.2d at 800.

III. CONCLUSION
For the foregoing reasons, we affirm the February 4, 2002, order of the Vermilion County circuit court granting defendants' motion to quash arrest and suppress evidence.
Affirmed.
MYERSCOUGH, P.J., and APPLETON, J., concur.
